Configuration data extraction and verification method, device and equipment based on source code analysis

By scanning static source code to parse Java language feature marker information, configuration data can be obtained and verified. This solves the problems of high difficulty in obtaining configuration data and lag in verification in existing technologies, and enables the acquisition and verification of configuration data without running the program, thus improving development efficiency.

CN119311550APending Publication Date: 2025-01-14QIAN JIN NETWORK INFORMATION TECH SHANGHAI LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411324386.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In existing technologies, configuration data can only be retrieved from the configuration data storage after the program runs, and cannot be obtained before the program runs. This makes it difficult to obtain configuration data and causes a delay in verification, which affects development efficiency.

Method used

By scanning static source code, extracting and parsing code snippets containing Java language feature markers, obtaining configuration data, and uploading it to the target server for management and global verification, configuration data can be obtained and verified without running the program.

Benefits of technology

It enables quick acquisition and verification of configuration data before program execution, reducing the difficulty of acquisition, improving development efficiency, and enabling timely detection of configuration anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311550A_ABST
    Figure CN119311550A_ABST
Patent Text Reader

Abstract

The invention discloses a configuration data extraction and verification method, device and equipment based on source code analysis, and the method comprises the steps: under the condition of obtaining a static source code of a current program, scanning the static source code, and extracting a code snippet containing java language characteristic marking information from the static source code, the java language characteristic marking information comprising an annotation and an identifier; analyzing the code snippets containing the java language characteristic marking information to obtain configuration data of the current program; automatically uploading the configuration data of the current program to a target server, wherein the target server is used for managing the configuration data of each program; downloading the configuration data of each program to the local for visual display, performing global verification on the configuration data of each program downloaded to the local, and outputting a verification result; and running each program under the condition that the verification result is used for representing that the verification is passed. According to the method and the device, the configuration data of each program is quickly obtained and globally verified, so that the configuration abnormality is found in time, and the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to the field of data processing technology, and in particular to a configuration data extraction and verification method, device and equipment based on source code analysis. Background Art

[0002] At present, in order to improve the reliability, scalability and performance of applications, an application can be split into a set of computer programs (referred to as programs) distributed on multiple computing nodes. Each node is an independent physical device or software process, but all work to realize the functions of the application.

[0003] In the related art, the configuration data defined in each program can only be extracted from the configuration data storage of each program after the program is run, and when the program is not running, the configuration data of the program cannot be obtained. Based on this, the acquisition of configuration data depends on the running of the program, and it is impossible to obtain the configuration data and verify it before the program runs. The acquisition of configuration data is difficult. When the program configuration is wrong, it can only be discovered when the program runs abnormally. There is a lag in the verification, and the program configuration abnormality cannot be discovered in time, which affects the development efficiency of the program. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a configuration data extraction and verification method, device, equipment, medium and product based on source code parsing, which can quickly obtain the configuration data of each program and perform a global verification on it without running the program, and can promptly discover configuration anomalies, which helps to improve development efficiency.

[0005] In a first aspect, an embodiment of the present application provides a configuration data extraction and verification method based on source code parsing, the method comprising: when the static source code of the current program is obtained, scanning the static source code, extracting code snippets containing Java language feature marking information from the static source code, wherein the Java language feature marking information comprises annotations and identifiers; parsing the code snippets containing Java language feature marking information to obtain the configuration data of the current program; automatically uploading the configuration data of the current program to a target server, the target server being used to manage the configuration data of each program; downloading the configuration data of each program to a local computer for visual display, and performing a global verification on the configuration data of each program downloaded to the local computer, and outputting the verification result; and when the verification result is used to indicate that the verification has passed, running each program.

[0006] In some implementation methods of the first aspect, the configuration data includes view configuration data corresponding to Listview and data source configuration data corresponding to DataSource, the annotations include @HroListview, @HroJoinDataSource, @HroListviewColumn, @HroDataSource, and @HroDataSourceColumn, and the code snippets containing Java language feature marking information are parsed to obtain the configuration data of the current program, including: parsing the code snippets containing @HroListview, @HroJoinDataSource, and @HroListviewColumn respectively to obtain the view configuration data corresponding to Listview; parsing the code snippets containing @HroDataSource and @HroDataSourceColumn respectively to obtain the data source configuration data corresponding to DataSource.

[0007] In some implementable methods of the first aspect, the code snippets where @HroListview, @HroJoinDataSource, and @HroListviewColumn are located are parsed respectively to obtain view configuration data corresponding to Listview, including: parsing the first code snippet where @HroListview is located, extracting the parameter values ​​of the annotation parameters name and orderBy, and using the parameter value of name as the view name of Listview, and using the parameter value of orderBy as the default sorting rule of the view of Listview; parsing the second code snippet where @HroJoinDataSource is located, extracting the parameter values ​​of the annotation parameters name, condition, masterColumn, and slaveColumn, and using the parameter value of name as the name of the data source bound to Listview, using the parameter value of condition as the query condition when the data source is bound to Listview, and using the parameter values ​​of masterColumn and slaveColumn as the associated fields when the data source is bound to Listview; parsing the third code snippet where @HroListviewColumn is located, extracting the parameter values ​​of the annotation parameters displayName and listIndex, and using the parameter value of displayName as the view column display name, and using the parameter value of listIndex as the sorting position of the view column.

[0008] In some implementable methods of the first aspect, the code snippets where @HroDataSource and @HroDataSourceColumn are located are parsed respectively to obtain the data source configuration data corresponding to DataSource, including: parsing the fourth code snippet where @HroDataSource is located, extracting the parameter values ​​of the annotation parameters name, table, and database, and using the parameter value of name as the data source name, the parameter value of table as the name of the data table corresponding to the data source, and the parameter value of database as the database name where the data table is located; parsing the fifth code snippet where @HroDataSourceColumn is located, extracting the parameter value of the annotation parameter name as the data source column name, extracting the parameter value of the annotation parameter queryExpression as the query expression, and extracting the parameter value of the annotation parameter qualifiedColumnName as the column alias.

[0009] In some possible implementations of the first aspect, the configuration data of each program is downloaded locally for visual display, including: after the configuration data of each program is downloaded locally, determining that the configuration data corresponding to each program is global configuration data, and the configuration data corresponding to the current program is local configuration data; in the local interface corresponding to the current program, displaying the local configuration data and the global configuration data in different tabs.

[0010] In some implementations of the first aspect, local configuration data and global configuration data are displayed in a first list, view configuration data in the local configuration data and the global configuration data include multiple rows, each row corresponds to a view, and after displaying the local configuration data and the global configuration data in different tabs, the method further includes: in response to a first selection operation on a target row in the multiple rows of view configuration data in the first list, displaying all view column data of the view corresponding to the target row in a second list of the local interface, and displaying all data source data of the view corresponding to the target row in a third list.

[0011] In some implementations of the first aspect, when the static source code of the current program is obtained, the method also includes: displaying the static source code of the current program in the code interface; in response to a second selection operation on the target string in the static source code, displaying multiple function options for the target string; in response to a third selection operation on the target function option in the multiple function options, combining the target string with @HroDataSource to obtain a combined field; querying the combined field in the static source code of the current program, determining the code line where the combined field is located and jumping, and locating the data source defined by the target string in the static source code.

[0012] In some implementations of the first aspect, the configuration data corresponding to each program is global configuration data, the global configuration data includes view configuration data and data source configuration data, the data source configuration data of the global configuration data is displayed in a list form in the local interface of the current program, after querying the combined field in the static source code of the current program, the method also includes: when the combined field is not found in the static source code of the current program, querying the combined field in the data source configuration data of the global configuration data; when the combined field is found in the data source configuration data of the global configuration data, determining the list row where the combined field is located in the local interface and jumping to it, and locating the data source defined by the target string in the global configuration data.

[0013] In the second aspect, an embodiment of the present application provides a configuration data extraction and verification device based on source code parsing, the device comprising: an extraction module, for scanning the static source code when the static source code of the current program is obtained, and extracting code snippets containing Java language feature marking information from the static source code, wherein the Java language feature marking information includes annotations and identifiers; a parsing module, for parsing the code snippets containing Java language feature marking information to obtain the configuration data of the current program; an upload module, for automatically uploading the configuration data of the current program to a target server, the target server being used to manage the configuration data of each program; a download verification module, for downloading the configuration data of each program to a local computer for visual display, and performing a global verification on the configuration data of each program downloaded to the local computer, and outputting the verification result; a running module, for running each program when the verification result is used to indicate that the verification has passed.

[0014] In some implementation methods of the second aspect, the configuration data includes view configuration data corresponding to Listview and data source configuration data corresponding to DataSource, the annotations include @HroListview, @HroJoinDataSource, @HroListviewColumn, @HroDataSource, @HroDataSourceColumn, and the parsing module includes: a view parsing unit, used to parse the code snippets where @HroListview, @HroJoinDataSource, and @HroListviewColumn are located, respectively, to obtain the view configuration data corresponding to Listview; a data source parsing unit, used to parse the code snippets where @HroDataSource and @HroDataSourceColumn are located, respectively, to obtain the data source configuration data corresponding to DataSource.

[0015] In some implementation methods of the second aspect, the view parsing unit is specifically used to: parse the first code snippet where @HroListview is located, extract the parameter values ​​of the annotation parameters name and orderBy, and use the parameter value of name as the view name of Listview, and use the parameter value of orderBy as the default sorting rule of the view of Listview; parse the second code snippet where @HroJoinDataSource is located, extract the parameter values ​​of the annotation parameters name, condition, masterColumn, and slaveColumn, and use the parameter value of name as the name of the data source bound to Listview, use the parameter value of condition as the query condition when the data source is bound to Listview, and use the parameter values ​​of masterColumn and slaveColumn as the associated fields when the data source is bound to Listview; parse the third code snippet where @HroListviewColumn is located, extract the parameter values ​​of the annotation parameters displayName and listIndex, and use the parameter value of displayName as the view column display name, and use the parameter value of listIndex as the sorting position of the view column.

[0016] In some implementation methods of the second aspect, the data source parsing unit is specifically used to: parse the fourth code snippet where @HroDataSource is located, extract the parameter values ​​of the annotation parameters name, table, and database, and use the parameter value of name as the data source name, the parameter value of table as the name of the data table corresponding to the data source, and the parameter value of database as the database name where the data table is located; parse the fifth code snippet where @HroDataSourceColumn is located, extract the parameter value of the annotation parameter name as the data source column name, extract the parameter value of the annotation parameter queryExpression as the query expression, and extract the parameter value of the annotation parameter qualifiedColumnName as the column alias.

[0017] In some possible implementations of the second aspect, the download verification module includes: a determination unit, used to determine that the configuration data corresponding to each program is global configuration data, and the configuration data corresponding to the current program is local configuration data after the configuration data of each program is downloaded locally; a display unit, used to display the local configuration data and the global configuration data in different tabs on the local interface corresponding to the current program.

[0018] In some implementations of the second aspect, local configuration data and global configuration data are displayed in a first list, and view configuration data in the local configuration data and the global configuration data include multiple rows, each row corresponding to a view. The device also includes: a display module, which is used to display all view column data of the view corresponding to the target row in the second list of the local interface in response to a first selection operation on the target row in the multiple rows of view configuration data in the first list after displaying the local configuration data and the global configuration data with different tabs, and to display all data source data of the view corresponding to the target row in the third list.

[0019] In some possible implementations of the second aspect, the device also includes: a display module, which is used to display the static source code of the current program in the code interface when the static source code of the current program is obtained; the display module is also used to display multiple function options for the target string in response to a second selection operation on the target string in the static source code; a combination module, which is used to combine the target string with @HroDataSource to obtain a combined field in response to a third selection operation on the target function option in the multiple function options; and a code navigation module, which is used to query the combined field in the static source code of the current program, determine the code line where the combined field is located and jump, and locate the data source defined by the target string in the static source code.

[0020] In some implementation methods of the second aspect, the configuration data corresponding to each program is global configuration data, the global configuration data includes view configuration data and data source configuration data, the data source configuration data of the global configuration data is displayed in the local interface of the current program in the form of a list, and the device also includes: a query module, which is used to query the combined field in the static source code of the current program, and if the combined field is not found in the static source code of the current program, query the combined field in the data source configuration data of the global configuration data; a list navigation module, which is used to determine the list row where the combined field is located in the local interface and jump to it when the combined field is found in the data source configuration data of the global configuration data, and locate the data source defined by the target string in the global configuration data.

[0021] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the configuration data extraction and verification method based on source code parsing as in the first aspect are implemented.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the steps of the configuration data extraction and verification method based on source code parsing as in the first aspect are implemented.

[0023] In a fifth aspect, an embodiment of the present application provides a computer program product, which is stored in a non-volatile storage medium. When the computer program product is executed by a processor, it implements the steps of the configuration data extraction and verification method based on source code parsing as in the first aspect.

[0024] In a sixth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the configuration data extraction and verification method based on source code parsing as in the first aspect.

[0025] The present application provides a configuration data extraction and verification method, device, equipment, medium and product based on source code parsing. When the static source code of the current program is obtained, by scanning the static source code, a code fragment containing java language feature marking information can be extracted from the static source code, and the java language feature marking information includes annotations and identifiers. Based on this, the configuration data of the current program can be obtained by parsing the code fragment containing java language feature marking information. In this way, the configuration data can be effectively obtained without running the program, which reduces the threshold and difficulty of obtaining the configuration data, and the configuration data of each program can be obtained by scanning and parsing the static source code, so as to realize the fast and effective acquisition of the configuration data of each program. On this basis, the target server can receive the configuration data uploaded by each program, and can download the configuration data of each program to the local for visual display. In this way, the configuration data of each program can be globally verified and the verification result can be output. The verification step is for the configuration data of each program, not limited to the current program, so that distributed data verification can be realized in the global range, and there is no need to wait until the program is running to find the configuration error. When the verification result is used to characterize the verification passing, each program is run again, which helps to improve the efficiency of program development. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.

[0027] Figure 1 It is a flowchart of a configuration data extraction and verification method based on source code analysis provided by an embodiment of the present application;

[0028] Figure 2 It is a flowchart of a configuration data extraction and verification method based on source code analysis provided by another embodiment of the present application;

[0029] Figure 3 is an exemplary schematic diagram of a local interface provided by an embodiment of the present application;

[0030] Figure 4is an exemplary schematic diagram of a local interface provided by another embodiment of the present application;

[0031] Figure 5 It is a structural diagram of a configuration data extraction and verification device based on source code analysis provided in an embodiment of the present application;

[0032] Figure 6 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present application clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present application. The exemplary embodiments provided herein are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians of the art without creative work are within the scope of protection of this application.

[0034] In this document, terms such as first, second, third, etc. are only used to distinguish one entity (or operation) from another entity (or operation), but not to require or imply any order or relationship between these entities (or operations).

[0035] Before describing the technical solutions provided by the embodiments of the present application, in order to facilitate the understanding of the embodiments of the present application, the present application first specifically describes the problems existing in the related art:

[0036] At present, the configuration data defined in each program can only be extracted from the configuration data storage of each program after the program is run, and the program needs to configure its running environment before running. In addition, for some programs, their configuration data depends not only on the running of their own programs, but also on the running of other programs. For example, the complete configuration data of program A can only be obtained after program A and program B are running. Based on this, when obtaining the configuration data of some programs, it is necessary to perform tedious configuration of the running environment, publish multiple programs to a specific environment, and run multiple programs, so as to obtain complete configuration data.

[0037] It can be seen that in the related technology, when obtaining the configuration data of the program, it depends on the program running, and the running environment needs to be tediously configured in advance, and the configuration data acquisition efficiency is low and delayed. Therefore, in the coding stage, only manual efforts can be made to ensure the correctness and consistency of the configuration data and the relationship between the data. Only then can the correctness and consistency of the data and other logical relationships be verified by running the program. In the coding stage, the configuration data cannot be verified as necessary, such as spelling errors, data association errors, etc. Any errors can only be discovered when the program is running, and the development efficiency is low.

[0038] In view of the above research findings of the applicant, the embodiments of the present application provide a configuration data extraction and verification method, device and equipment based on source code analysis, which can solve at least one of the above technical problems existing in the related technology.

[0039] The following is a detailed description of the configuration data extraction and verification method based on source code parsing provided by the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0040] Figure 1 It is a flow chart of a configuration data extraction and verification method based on source code parsing provided in an embodiment of the present application. The executor of the configuration data extraction and verification method based on source code parsing may be a business system, which includes various programs and a target server. The target server may communicate with each program and receive configuration data uploaded by each program.

[0041] Exemplarily, in an online recruitment scenario, the business system can be the B-end or C-end corresponding to the online recruitment platform. The B-end can be the online talent recruitment system, online application recruitment system, training system, etc. used by recruiting users, and the C-end can be the fresh graduate job search system, online application job search system, job recommendation system, etc. used by job seekers.

[0042] The following takes the execution subject of the configuration data extraction and verification method based on source code analysis as an example of a business system to illustrate the configuration data extraction and verification method based on source code analysis of the present application. It should be noted that the above execution subjects and application scenarios do not constitute a limitation on the present application.

[0043] like Figure 1 As shown, the configuration data extraction and verification method based on source code analysis provided in the embodiment of the present application may include steps 110 to 150.

[0044] Step 110, when the static source code of the current program is obtained, the static source code is scanned to extract code fragments containing Java language feature marking information from the static source code, wherein the Java language feature marking information includes annotations and identifiers;

[0045] Step 120, parsing the code snippet containing the Java language feature tag information to obtain the configuration data of the current program;

[0046] Step 130, automatically uploading the configuration data of the current program to the target server, which is used to manage the configuration data of each program;

[0047] Step 140, downloading the configuration data of each program to the local computer for visual display, and performing a global verification on the configuration data of each program downloaded to the local computer, and outputting the verification result;

[0048] Step 150: When the verification result indicates that the verification has passed, run each program.

[0049] The configuration data extraction and verification method based on source code parsing provided by the embodiment of the present application, when the static source code of the current program is obtained, by scanning the static source code, a code fragment containing java language feature marking information can be extracted from the static source code, and the java language feature marking information includes annotations and identifiers. Based on this, the configuration data of the current program can be obtained by parsing the code fragment containing java language feature marking information. In this way, the configuration data can be effectively obtained without running the program, which reduces the threshold and difficulty of obtaining the configuration data, and the configuration data of each program can be obtained by scanning and parsing the static source code. On this basis, the target server can receive the configuration data uploaded by each program, and can download the configuration data of each program to the local for visual display. In this way, the configuration data of each program can be globally verified and the verification result can be output. The verification step is for the configuration data of each program, not limited to the current program, so it can realize distributed data verification in the global range, and there is no need to wait until the program is running to find the configuration error. When the verification result is used to characterize the verification, each program is run again, which helps to improve the efficiency of program development.

[0050] The specific implementation of the above steps will be described in detail below in conjunction with specific embodiments.

[0051] In step 110, when the static source code of the current program is obtained, the static source code is scanned to extract code fragments containing Java language feature tag information from the static source code.

[0052] In step 110, the static source code may be obtained from the code file of the current program and scanned by a pre-configured plug-in. The Java language feature marking information may include annotations and identifiers.

[0053] Annotations are instructions for the Java compiler, which are used to explain the role of the code. Annotations can be used on classes, methods, packages, scopes, etc. Annotating Java packages, types (classes, interfaces, enumerations), constructors, methods, domains, parameters, and local variables is equivalent to adding some additional auxiliary information to them. The format of annotations is @annotation name, and parameters can be added when necessary. Annotation-related information mainly includes annotation name (Annotation), annotation parameter name (Annotation ArgName) and annotation parameter value (AnnotationArg Value).

[0054] Identifiers may include, but are not limited to: class name / interface name (Class / Interface), member method name of a class / interface (Method), member attribute name of a class (Field), comment information (Comment), and project information (Project).

[0055] Involving step 120, parsing the code snippet containing Java language feature tag information to obtain configuration data of the current program.

[0056] In step 120, the code snippet carrying the Java language feature marking information includes the configuration items set by the developer for the current program. Therefore, by parsing the code snippet containing the Java language feature marking information and extracting the parameter values ​​corresponding to the annotations and identifiers, the configuration data of the current program can be obtained.

[0057] In some embodiments of the present application, in order to reduce the difficulty of obtaining configuration data and improve the efficiency of obtaining configuration data, the configuration data may include view configuration data corresponding to Listview and data source configuration data corresponding to DataSource. The annotations may include @HroListview, @HroJoinDataSource, @HroListviewColumn, @HroDataSource, and @HroDataSourceColumn. Figure 2 1 is a flow chart of a configuration data extraction and verification method based on source code parsing provided by another embodiment of the present application. The above step 120 parses the code fragment containing the Java language feature tag information to obtain the configuration data of the current program, which may include the following steps 210 and 220:

[0058] Step 210, respectively parse the code snippets where @HroListview, @HroJoinDataSource, and @HroListviewColumn are located to obtain the view configuration data corresponding to Listview;

[0059] Step 220, respectively parse the code snippets where @HroDataSource and @HroDataSourceColumn are located to obtain the data source configuration data corresponding to DataSource.

[0060] Specifically, the view configuration data is the configuration data corresponding to Listview, and the data source configuration data is the configuration data corresponding to DataSource. The configuration data of each program may include but is not limited to view configuration data and data source configuration data.

[0061] In the embodiment of the present application, it can be pre-determined that the annotations related to the view configuration data include @HroListview, @HroJoinDataSource, and @HroListviewColumn, and the annotations related to the data source configuration data include @HroDataSource and @HroDataSourceColumn. Based on this, on the basis of obtaining the static source code of the current program from the code file, the code snippet where the above annotations are located in the static source code is directly parsed, and the annotation related information can be obtained by parsing the code snippet. Without running the current program, the view configuration data and the data source configuration data can be quickly and effectively obtained from the annotation related information, which reduces the difficulty of obtaining the configuration data and improves the efficiency of obtaining the configuration data.

[0062] In some embodiments of the present application, in order to effectively obtain the view configuration data of the current program, the above step 210 parses the code snippets where @HroListview, @HroJoinDataSource, and @HroListviewColumn are located respectively to obtain the view configuration data corresponding to Listview, which may specifically include the following steps:

[0063] Parse the first code snippet where @HroListview is located, extract the parameter values ​​of the annotation parameters name and orderBy, and use the parameter value of name as the view name of Listview, and the parameter value of orderBy as the default sorting rule of Listview.

[0064] Parse the second code snippet where @HroJoinDataSource is located, extract the parameter values ​​of the annotation parameters name, condition, masterColumn, and slaveColumn, and use the parameter value of name as the name of the data source bound to Listview, the parameter value of condition as the query condition when the data source is bound to Listview, and the parameter values ​​of masterColumn and slaveColumn as the associated fields when the data source is bound to Listview;

[0065] Parse the third code snippet where @HroListviewColumn is located, extract the parameter values ​​of the annotation parameters displayName and listIndex, and use the parameter value of displayName as the view column display name and the parameter value of listIndex as the sort position of the view column.

[0066] In an embodiment of the present application, by respectively parsing the code snippets where @HroListview, @HroJoinDataSource, and @HroListviewColumn are located, different annotation parameters of each annotation can be extracted from the Listview-related code snippets, and the parameter values ​​of different annotation parameters can be used as configuration items of the view configuration data, thereby effectively obtaining the view configuration data of the current program.

[0067] In some embodiments of the present application, the configuration data may include view configuration data corresponding to Listview, and the corresponding annotations of Listview may include @HroListview, @HroJoinDataSource, and @HroListviewColumn. Some view configuration data may be obtained by parsing the code segment where the identifier is located. The above step 120 may specifically include:

[0068] Scan the static source code of the current program and extract the classes / interfaces annotated with @HroListview;

[0069] Get the project information of the current program, and extract the program name from the project information as the program to which the view belongs;

[0070] Parse the member methods / attributes annotated with @HroListviewColumn in the class annotated with @HroListview and parse them into view columns;

[0071] Extract the member method / attribute name as the view column key.

[0072] As a specific example, the complete parsing process of the view configuration data corresponding to the above Listview may include:

[0073] 1.1.1. Scan the static source code of the current program and extract the classes / interfaces annotated with @HroListview;

[0074] 1.1.2. Extract the value of the @HroListview annotation parameter name as the view name;

[0075] 1.1.3. Extract the value of the @HroListview annotation parameter orderBy as the default sorting rule for the view;

[0076] 1.1.4. Continue to extract other parameters of @HroListview annotation as other configuration items of the view according to the general parsing rules;

[0077] 1.1.5. Get the project information of the current program and extract the program name as the program (app) to which the view belongs;

[0078] 1.1.6. Parse the @HroJoinDataSource annotation on the class, extract the value of the annotation parameter name as the name of the bound data source, extract the value of the annotation parameter condition as the query condition when the data source is bound to the view, and extract the values ​​of the annotation parameters masterColumn and slaveColumn as the associated fields when the data source is bound to the view;

[0079] 1.1.7. Parse the member methods / attributes annotated with @HroListviewColumn in the class and parse them into view columns;

[0080] 1.1.7.1. Extract the name of the member method / attribute as the key of the view column;

[0081] 1.1.7.2. Extract the value of the @HroListviewColumn annotation parameter displayName as the view column display name;

[0082] 1.1.7.3. Extract the value of the listIndex parameter of the @HroListviewColumn annotation as the sorting position of the view column. If listIndex is not specified, try to obtain the value of the @Order annotation on the member method / property as the sorting position. If none is obtained, the sorting position defaults to 0;

[0083] 1.1.7.4. Extract the value of the @HroListviewColumn annotation parameter width as the width of the view column;

[0084] 1.1.7.5. Extract other parameter values ​​of @HroListviewColumn as other configurations of the view column.

[0085] In some embodiments of the present application, in order to effectively obtain the data source configuration data of the current program, the above step 220 parses the code snippets where @HroDataSource and @HroDataSourceColumn are located respectively to obtain the data source configuration data corresponding to DataSource, which may specifically include the following steps:

[0086] Parse the fourth code snippet where @HroDataSource is located, extract the parameter values ​​of the annotation parameters name, table, and database, and use the parameter value of name as the data source name, the parameter value of table as the name of the data table corresponding to the data source, and the parameter value of database as the name of the database where the data table is located;

[0087] Parse the fifth code snippet where @HroDataSourceColumn is located, extract the parameter value of the annotation parameter name as the data source column name, extract the parameter value of the annotation parameter queryExpression as the query expression, and extract the parameter value of the annotation parameter qualifiedColumnName as the column alias.

[0088] In an embodiment of the present application, by respectively parsing the code snippets where @HroDataSource and @HroDataSourceColumn are located, different annotation parameters of each annotation can be extracted from the DataSource-related code snippets, and the parameter values ​​of different annotation parameters can be used as configuration items of the data source configuration data, thereby effectively obtaining the data source configuration data of the current program.

[0089] In some embodiments of the present application, the configuration data may include data source configuration data corresponding to DataSource, and the annotations corresponding to DataSource may include @HroDataSource and @HroDataSourceColumn. Part of the data source configuration data may be obtained by parsing the code segment where the identifier is located. The above step 120 may specifically include:

[0090] Scan the static source code of the current program and extract classes annotated with @HroDataSource;

[0091] Get the project information of the current program, and extract the program name from the project information as the program to which the data source belongs;

[0092] Parse the member methods and member properties in the class annotated with @HroDataSource, and each member method and member property is used as a data source column (DataSourceColumn);

[0093] For each data source column, if the member method or member property does not have the annotation @HroDataSourceColumn, the method / property name is used as the column name of the data source column;

[0094] As a specific example, the complete parsing process of the data source configuration data corresponding to the above DataSource may include:

[0095] 1.2.1. Scan all static source codes of the current program and extract classes with the annotation @HroDataSource;

[0096] 1.2.2. Extract the value of the @HroDataSource annotation parameter name as the data source name;

[0097] 1.2.3. Extract the value of the @HroDataSource annotation parameter table as the database table name corresponding to the data source;

[0098] If the table value of the @HroDataSource annotation parameter is empty or not provided, try to get the class annotation @Table and get the value of its parameter name as the table name;

[0099] 1.2.4. Extract the value of the @HroDataSource annotation parameter database as the library name where the above table is located;

[0100] 1.2.5. Get the current program project information and extract the program name as the program (app) to which the data source belongs;

[0101] 1.2.6. Parse all member methods and member properties of the class, and each method and property is used as a data source column (DataSourceColumn);

[0102] 1.2.7. For each data source column, if the member method / property has the annotation @HroDataSourceColumn, the value of its parameter name is extracted as the column name, otherwise the method / property name is used as the column name;

[0103] Or, 1.2.8. For each data source column, if the member method / property has the annotation @HroDataSourceColumn, extract the value of the annotation parameter queryExpression as the query expression and extract the annotation parameter qualifiedColumnName as the column alias;

[0104] 1.2.9. If a member method or property has @HroExclude, the method or property is ignored and is not included as a data source column.

[0105] In step 130, the configuration data of the current program is automatically uploaded to the target server, and the target server is used to manage the configuration data of each program.

[0106] In step 130, the business system may include various programs and a target server. The target server is a server that is uniformly connected to various programs. The front-end interface of the business system may provide a target control. By clicking the target control, the configuration data defined by the current program can be uploaded to a unified server. The server can save the configuration data defined on different programs and different development machines.

[0107] In step 140, the configuration data of each program is downloaded to the local computer for visual display, and the configuration data of each program downloaded to the local computer is globally verified, and the verification result is output.

[0108] In step 140, the configuration data stored in the target server is structured data, and the configuration data may include view configuration data corresponding to Listview and data source configuration data corresponding to DataSource. The present application may pre-configure a first data verification rule corresponding to the view configuration data, and a second data verification rule corresponding to the data source configuration data. Based on this, the configuration data of each program is uniformly verified using the first data verification rule and the second data verification rule, and the configuration data of all programs are verified at one time using a unified data verification rule, rather than being limited to the current program, to achieve system-wide verification.

[0109] In some embodiments of the present application, the business system may provide a plug-in window interface, and in response to a touch operation on a target verification control in the plug-in window interface, the view configuration data and data source configuration data of each program may be verified.

[0110] In some embodiments of the present application, the first data verification rule corresponding to the view configuration data verification may include a first error verification rule and a first warning verification rule, wherein the first error verification rule is used to identify erroneous configuration items in the view configuration data that affect program operation and must be corrected, and the first warning verification rule is used to identify erroneous configuration items in the view configuration data that do not affect program operation and are recommended to be modified.

[0111] As a specific example, the first error checking rule may include but is not limited to: the view must be configured with a primary data source, the Slave data source must be configured with associated columns, whether the view column is bound to the data source column (only the default data source column is checked, and the column bound to the custom data source is not checked), the view must have at least one visible column, and view column columnKey check; the first warning checking rule may include but is not limited to: unnecessary primary data source associated columns, unnecessary columnKey, unnecessary single-table data source table alias, join-table type data source column alias is recommended to have an alias, visible view columns have no specified order, the view does not have exportable columns, the data source is recommended to add with(nolock), various name before and after space checks, unnecessary Always data source columns, some known plug-in automatically generated fields should be excluded in the data source class (to prevent them from being automatically parsed as data source columns), and it is recommended to add @breadcrumb in the comment.

[0112] In some embodiments of the present application, the second data verification rule corresponding to the data source configuration data verification may include a second error verification rule and a second warning verification rule, wherein the second error verification rule is used to identify erroneous configuration items in the data source configuration data that affect program operation and must be corrected, and the second warning verification rule is used to identify erroneous configuration items in the data source configuration data that do not affect program operation and are recommended to be modified.

[0113] As a specific example, the second error checking rule may include but is not limited to: the data source must specify a name, whether the data source name is repeated throughout the system, the data source must specify a table name, the data source must specify a database name, the data source must have at least one data source column, and columns with the same name cannot exist in the same data source; the second warning checking rule may include but is not limited to: the table name should contain the NOLOCK keyword, and if the data source column specifies both the queryExpression and qualifiedColumnName parameters, the latter is unnecessary.

[0114] It should be noted that different data has different validation rules, and the same data can also have validation rules continuously expanded as the development progresses. Therefore, as the view configuration data and the data source configuration data are continuously developed, the first data validation rule and the second data validation rule can be continuously expanded.

[0115] In some embodiments of the present application, a central server may be set up to uniformly manage and verify the configuration data of each program.

[0116] Referring to step 150 , when the verification result is used to indicate that the verification has passed, various programs are run.

[0117] In step 150, each program may correspond to a verification result, and the developer may choose to run each program based on the verification result of each program. In this way, before the program is run, the configuration data may be verified based on the static code, and the configuration error may not be found until the program is run, thereby ensuring that the program can run normally.

[0118] In the related art, the configuration data of each program is maintained separately by the program itself, and the configuration data of each program cannot be displayed centrally.

[0119] In some embodiments of the present application, in order to centrally display the configuration data of each program, the above step 140 of downloading the configuration data of each program to the local computer for visual display may include the following steps:

[0120] After downloading the configuration data of each program to the local computer, the configuration data corresponding to each program is determined to be global configuration data, and the configuration data corresponding to the current program is determined to be local configuration data;

[0121] In the local interface corresponding to the current program, local configuration data and global configuration data are displayed in different tabs.

[0122] Specifically, the configuration data can be divided into view configuration data and data source configuration data, wherein the view configuration data and data source configuration data in the global configuration data, and the view configuration data and data source configuration data in the local configuration data, are displayed in different tabs.

[0123] For example, Figure 3 As shown, the Tab corresponding to the view configuration data in the global configuration data is "RemoteListviews", the Tab corresponding to the data source configuration data in the global configuration data is "Remote Data Sources", the Tab corresponding to the view configuration data in the local configuration data is "Listviews", and the Tab corresponding to the data source configuration data in the local configuration data is "Data Sources".

[0124] As a specific example, if each program includes program A and program B, program A corresponds to view a1 and view a2, and program B corresponds to view b1 and view b2, then the configuration data of view a1, view a2, view b1 and view b2 can be displayed under the "Remote Listviews" Tab. If the current program is program A, the configuration data of view a1 and view a2 can be displayed under "Listviews".

[0125] In the embodiment of the present application, the configuration data of each program can be uploaded to the same target server and managed uniformly by the target server. Based on this, the present application can download the configuration data of all programs stored on the target server to the local display with one click, and the global configuration data and the configuration data corresponding to the current program are displayed in different tabs, which is convenient for viewing all distributed data in the entire system. If the definition data of the current program depends on the data of the non-current program, it can also be found from the global configuration data, which is more practical.

[0126] In some embodiments of the present application, in order to fully display the complete configuration data of different views, the local configuration data and the global configuration data are displayed in the first list, and the view configuration data in the local configuration data and the global configuration data includes multiple rows, each row corresponding to a view. After the local configuration data and the global configuration data are displayed in different tabs, the method may further include the following steps:

[0127] In response to a first selection operation on a target row in the multiple rows of view configuration data in the first list, all view column data of the view corresponding to the target row is displayed in the second list of the local interface, and all data source data of the view corresponding to the target row is displayed in the third list.

[0128] Specifically, the local configuration data and the global configuration data are displayed in different tabs in the first list. Both the local configuration data and the global configuration data contain multiple rows of view configuration data, and each row of view configuration data is associated with a view identifier. The first selection operation can be a click operation on the target row, and the view corresponding to the target row can be the target view. The second list is used to display all columns of the target view, and the third list is used to display data of all data sources bound to the target view.

[0129] For example, Figure 4 As shown, the first list contains four tabs, namely "Listviews", "DataSources", "Remote Listviews", and "Remote Data Sources". Under "Listviews" or "RemoteListviews", multiple rows of view configuration data can be displayed, each row corresponds to a view, and the "Name" column can be the view identifier. Taking the currently selected Tab as "Listviews" as an example, when the target view "Same Supplier List" is selected from the multiple rows of view configuration data, all view column data of the "Same Supplier List" can be displayed in the second list below, and the data source data of the "Same Supplier List" can be displayed in the third list.

[0130] In an embodiment of the present application, the local interface can provide three lists, and the user can flexibly select the view they want to view in the first list. In this way, the complete configuration data of the view can be comprehensively displayed in the second list and the third list, which is convenient for the user to view. The user can view the detailed information of a view in the current program, and can also view the detailed information of a view in any program in each program, so as to better meet the needs of developers.

[0131] In the related art, when searching for the associated data of a certain string in the configuration data of a program, the string is usually input for searching to obtain multiple matching results, and then the matching results are manually compared and checked. However, since the amount of configuration data is usually large, the number of matching results obtained by searching is large, and the subsequent manual comparison and checking is time-consuming and laborious, and the search efficiency is low. Moreover, after finding the expected matching result, one can only rely on manual jump files and locate code lines, which also affects the efficiency of code location.

[0132] In some embodiments of the present application, in order to improve the efficiency of searching for associated data in the configuration data, when the static source code of the current program is obtained, the method may further include:

[0133] Display the static source code of the current program in the code interface;

[0134] In response to a second selection operation on a target character string in the static source code, displaying a plurality of function options for the target character string;

[0135] In response to a third selection operation on a target function option from among the multiple function options, the target string is combined with @HroDataSource to obtain a combined field;

[0136] Query the combined field in the static source code of the current program, determine the code line where the combined field is located and jump, and locate the data source defined by the target string in the static source code.

[0137] Specifically, the second selection operation may be an operation of selecting a target string, such as a click operation, a long press operation, a double click operation, etc. of the target string. The target function option among the multiple function options is used to represent the code navigation function, such as displaying the words "jump to data source definition". The third selection operation may be an operation of selecting a target function option, such as a click operation on the target function option.

[0138] In the embodiment of the present application, the code interface can provide an automatic code navigation function for strings. By selecting the target string and the target function option in the code interface, the target string can be combined with @HroDataSource to obtain a combined field. Based on this, when searching using the combined field, the code line where the combined field is located can be directly found in the static source code. This code line is the data source annotation code line associated with the target string. In this way, the data source associated with the target string can be accurately located in the code file, realizing the code navigation function of the associated data in the configuration data.

[0139] In the related art, when searching for a target string related data source in the static source code of the current program, the related data source may not be defined by the current program, and therefore the related data source cannot be found in the static source code of the current program.

[0140] Based on this, in some embodiments of the present application, the configuration data corresponding to each program is global configuration data, and the global configuration data includes view configuration data and data source configuration data. The data source configuration data of the global configuration data is displayed in the local interface of the current program in a list form. After querying the combination field in the static source code of the current program, the method may further include the following steps:

[0141] When the combined field is not found in the static source code of the current program, the combined field is found in the data source configuration data of the global configuration data;

[0142] When the data source configuration data of the global configuration data is queried, the list row where the combined field is located in the local interface is determined and jumped, and the data source defined by the target string is located in the global configuration data.

[0143] For example, the user selects the target string P1 in the static source code of program A, and combines it with @HroDataSource to obtain the combined field "P1@HroDataSource". The data source Q1 bound to P1 is defined by program B, so the relevant data of the data source Q1 is configured in the configuration data of program B. Based on this, if P1 cannot be found in the static source code of program A, the combined field is directly queried in the global configuration data of the local interface, the list row where the combined field is located is located, and a jump is made.

[0144] In the embodiment of the present application, in order to improve the success rate of code navigation, the present application first searches for the combination field containing the target string from the static source code, and if it is not found, searches from the global configuration data. Since the global configuration data contains the data source configuration data of all programs, in the scenario where the data source bound to the target string is not defined by the current program, the data source can also be retrieved from the downloaded global configuration data, and then the list row where the data source is located can be located, and the code navigation of the target string can be successfully completed.

[0145] Corresponding to the method embodiment of the present application, the present application also provides a configuration data extraction and verification device based on source code analysis.

[0146] Figure 5 Schematic diagram of a configuration data extraction and verification device based on source code analysis provided by an embodiment of the present application. Figure 5 As shown, the configuration data extraction and verification device 500 based on source code analysis may include: an extraction module 510, a parsing module 520, an upload module 530, a download verification module 540 and an operation module 550.

[0147] Among them, the extraction module 510 is used to scan the static source code of the current program after obtaining the static source code of the current program, and extract the code fragment containing the Java language feature marking information from the static source code, wherein the Java language feature marking information includes annotations and identifiers; the parsing module 520 is used to parse the code fragment containing the Java language feature marking information to obtain the configuration data of the current program; the upload module 530 is used to automatically upload the configuration data of the current program to the target server, and the target server is used to manage the configuration data of each program; the download verification module 540 is used to download the configuration data of each program to the local for visual display, and perform global verification on the configuration data of each program downloaded to the local, and output the verification result; the running module 550 is used to run each program when the verification result is used to indicate that the verification has passed.

[0148] The configuration data extraction and verification device based on source code parsing provided by the embodiment of the present application can extract code fragments containing java language feature marking information from the static source code by scanning the static source code when the static source code of the current program is obtained, and the java language feature marking information includes annotations and identifiers. Based on this, the configuration data of the current program can be obtained by parsing the code fragments containing java language feature marking information. In this way, the configuration data can be effectively obtained without running the program, which reduces the threshold and difficulty of obtaining the configuration data, and the configuration data of each program can be obtained by scanning and parsing the static source code, so as to realize the fast and effective acquisition of the configuration data of each program. On this basis, the target server can receive the configuration data uploaded by each program, and can download the configuration data of each program to the local for visual display. In this way, the configuration data of each program can be globally verified and the verification result can be output. The verification step is for the configuration data of each program, not limited to the current program, so that distributed data verification can be realized in the global scope, and configuration errors can be found without waiting until the program is running. When the verification result is used to characterize the verification passing, each program can be run again, which helps to improve the efficiency of program development.

[0149] In some embodiments of the present application, the configuration data includes view configuration data corresponding to Listview and data source configuration data corresponding to DataSource, and the annotations include @HroListview, @HroJoinDataSource, @HroListviewColumn, @HroDataSource, and @HroDataSourceColumn. The parsing module 520 includes: a view parsing unit, used to parse the code snippets where @HroListview, @HroJoinDataSource, and @HroListviewColumn are located, respectively, to obtain the view configuration data corresponding to Listview; a data source parsing unit, used to parse the code snippets where @HroDataSource and @HroDataSourceColumn are located, respectively, to obtain the data source configuration data corresponding to DataSource.

[0150] In some embodiments of the present application, the view parsing unit is specifically used to: parse the first code snippet where @HroListview is located, extract the parameter values ​​of the annotation parameters name and orderBy, and use the parameter value of name as the view name of Listview, and use the parameter value of orderBy as the default sorting rule of the view of Listview; parse the second code snippet where @HroJoinDataSource is located, extract the parameter values ​​of the annotation parameters name, condition, masterColumn, and slaveColumn, and use the parameter value of name as the name of the data source bound to Listview, use the parameter value of condition as the query condition when the data source is bound to Listview, and use the parameter values ​​of masterColumn and slaveColumn as the associated fields when the data source is bound to Listview; parse the third code snippet where @HroListviewColumn is located, extract the parameter values ​​of the annotation parameters displayName and listIndex, and use the parameter value of displayName as the view column display name, and use the parameter value of listIndex as the sorting position of the view column.

[0151] In some embodiments of the present application, the data source parsing unit is specifically used to: parse the fourth code snippet where @HroDataSource is located, extract the parameter values ​​of the annotation parameters name, table, and database, and use the parameter value of name as the data source name, the parameter value of table as the name of the data table corresponding to the data source, and the parameter value of database as the database name where the data table is located; parse the fifth code snippet where @HroDataSourceColumn is located, extract the parameter value of the annotation parameter name as the data source column name, and extract the parameter value of the annotation parameter queryExpression as the query expression, and extract the parameter value of the annotation parameter qualifiedColumnName as the column alias.

[0152] In some embodiments of the present application, the download verification module 540 includes: a determination unit, which is used to determine that the configuration data corresponding to each program is global configuration data, and the configuration data corresponding to the current program is local configuration data after the configuration data of each program is downloaded locally; and a display unit, which is used to display the local configuration data and the global configuration data in different tabs on the local interface corresponding to the current program.

[0153] In some embodiments of the present application, local configuration data and global configuration data are displayed in a first list, and view configuration data in the local configuration data and the global configuration data includes multiple rows, each row corresponding to a view. The device also includes: a display module, which is used to display all view column data of the view corresponding to the target row in the second list of the local interface in response to a first selection operation on the target row in the multiple rows of view configuration data in the first list after displaying the local configuration data and the global configuration data with different tabs, and to display all data source data of the view corresponding to the target row in the third list.

[0154] In some embodiments of the present application, the device also includes: a display module, which is used to display the static source code of the current program in the code interface when the static source code of the current program is obtained; the display module is also used to display multiple function options for the target string in response to a second selection operation on the target string in the static source code; a combination module, which is used to combine the target string with @HroDataSource in response to a third selection operation on the target function option in multiple function options to obtain a combined field; a code navigation module, which is used to query the combined field in the static source code of the current program, determine the code line where the combined field is located and jump, and locate the data source defined by the target string in the static source code.

[0155] In some embodiments of the present application, the configuration data corresponding to each program is global configuration data, and the global configuration data includes view configuration data and data source configuration data. The data source configuration data of the global configuration data is displayed in the local interface of the current program in the form of a list. The device also includes: a query module, which is used to query the combined field in the static source code of the current program, and if the combined field is not found in the static source code of the current program, query the combined field in the data source configuration data of the global configuration data; a list navigation module, which is used to determine the list row where the combined field is located in the local interface and jump to it when the combined field is found in the data source configuration data of the global configuration data, and locate the data source defined by the target string in the global configuration data.

[0156] The configuration data extraction and verification device based on source code analysis provided in the embodiment of the present application can achieve Figure 1-4 The various processes implemented by the service platform in the method embodiment can achieve the same technical effect. To avoid repetition, they will not be described here.

[0157] Figure 6 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0158] like Figure 6 As shown, the electronic device 600 includes a memory 601 , a processor 602 , and a computer program stored in the memory 601 and executable on the processor 602 .

[0159] In an example, the processor 602 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0160] The memory 601 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it can be operated to perform the operations described in the card opening method in the embodiment according to the first aspect of the present application.

[0161] The processor 602 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 601, so as to implement the card activation method in the embodiment of the first aspect.

[0162] In some examples, the electronic device 600 may further include a communication interface 603 and a bus 610. Figure 6 As shown, the memory 601, the processor 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0163] The communication interface 603 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 603 can also be used to access input devices and / or output devices.

[0164] The bus 610 includes hardware, software, or both, coupling the components of the electronic device 600 to each other. By way of example and not limitation, the bus 610 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 610 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0165] The electronic device provided in the embodiment of the present application can realize Figure 1-4 The various processes implemented by the electronic device in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described here.

[0166] In combination with the configuration data extraction and verification method based on source code parsing in the above embodiments, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the steps of any one of the configuration data extraction and verification methods based on source code parsing in the above embodiments are implemented.

[0167] In combination with the configuration data extraction and verification method based on source code parsing in the above embodiments, the present application embodiment can provide a computer program product for implementation. The (computer) program product is stored in a non-volatile storage medium, and when the program product is executed by at least one processor, it implements the steps of any one of the configuration data extraction and verification methods based on source code parsing in the above embodiments.

[0168] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned configuration data extraction and verification method embodiment based on source code parsing, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0169] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0170] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0171] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code fragments used to perform the required tasks. The program or code fragment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code fragment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0172] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0173] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0174] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A configuration data extraction and verification method based on source code analysis, characterized in that: include: When the static source code of the current program is obtained, the static source code is scanned to extract code fragments containing Java language feature marking information from the static source code, wherein the Java language feature marking information includes annotations and identifiers; Parsing the code snippet containing the Java language feature tag information to obtain the configuration data of the current program; Automatically uploading the configuration data of the current program to a target server, where the target server is used to manage the configuration data of each program; Download the configuration data of each program to the local computer for visual display, perform a global verification on the configuration data of each program downloaded to the local computer, and output the verification result; When the verification result is used to indicate that the verification has passed, the various programs are run.

2. The method according to claim 1, characterized in that The configuration data includes view configuration data corresponding to Listview and data source configuration data corresponding to DataSource, the annotations include @HroListview, @HroJoinDataSource, @HroListviewColumn, @HroDataSource, @HroDataSourceColumn, and the parsing of the code snippet containing the Java language feature tag information to obtain the configuration data of the current program includes: Parse the code snippets of @HroListview, @HroJoinDataSource, and @HroListviewColumn respectively to obtain the view configuration data corresponding to the Listview; Parse the code snippets where @HroDataSource and @HroDataSourceColumn are located respectively to obtain the data source configuration data corresponding to the DataSource.

3. The method according to claim 2, characterized in that The code snippets where @HroListview, @HroJoinDataSource and @HroListviewColumn are respectively parsed to obtain the view configuration data corresponding to the Listview, including: Parse the first code snippet where @HroListview is located, extract the parameter values ​​of the annotation parameters name and orderBy, and use the parameter value of name as the view name of Listview, and the parameter value of orderBy as the default sorting rule of Listview. Parse the second code snippet where @HroJoinDataSource is located, extract the parameter values ​​of the annotation parameters name, condition, masterColumn, and slaveColumn, and use the parameter value of name as the name of the data source bound to Listview, the parameter value of condition as the query condition when the data source is bound to Listview, and the parameter values ​​of masterColumn and slaveColumn as the associated fields when the data source is bound to Listview; Parse the third code snippet where @HroListviewColumn is located, extract the parameter values ​​of the annotation parameters displayName and listIndex, and use the parameter value of displayName as the view column display name and the parameter value of listIndex as the sort position of the view column.

4. The method according to claim 2, characterized in that: The code snippets where @HroDataSource and @HroDataSourceColumn are respectively parsed to obtain the data source configuration data corresponding to the DataSource include: Parse the fourth code snippet where @HroDataSource is located, extract the parameter values ​​of the annotation parameters name, table, and database, and use the parameter value of name as the data source name, the parameter value of table as the name of the data table corresponding to the data source, and the parameter value of database as the name of the database where the data table is located; Parse the fifth code snippet where @HroDataSourceColumn is located, extract the parameter value of the annotation parameter name as the data source column name, extract the parameter value of the annotation parameter queryExpression as the query expression, and extract the parameter value of the annotation parameter qualifiedColumnName as the column alias.

5. The method according to claim 1, characterized in that: The downloading of the configuration data of each program to a local computer for visual display includes: After downloading the configuration data of each program to the local computer, determining that the configuration data corresponding to each program is global configuration data, and the configuration data corresponding to the current program is local configuration data; In the local interface corresponding to the current program, the local configuration data and the global configuration data are displayed in different tabs.

6. The method according to claim 5, characterized in that The local configuration data and the global configuration data are displayed in a first list, the view configuration data in the local configuration data and the global configuration data include multiple rows, each row corresponds to a view, and after displaying the local configuration data and the global configuration data in different tabs, the method further includes: In response to a first selection operation on a target row in the multiple rows of view configuration data in the first list, all view column data of the view corresponding to the target row are displayed in the second list of the local interface, and all data source data of the view corresponding to the target row are displayed in the third list.

7. The method according to claim 1, characterized in that In the case where the static source code of the current program is obtained, the method further includes: Display the static source code of the current program on the code interface; In response to a second selection operation on a target character string in the static source code, displaying a plurality of function options for the target character string; In response to a third selection operation on a target function option from the plurality of function options, combining the target string with @HroDataSource to obtain a combined field; The combined field is searched in the static source code of the current program, the code line where the combined field is located is determined and jumped, and the data source defined by the target string is located in the static source code.

8. The method according to claim 7, characterized in that The configuration data corresponding to each program is global configuration data, and the global configuration data includes view configuration data and data source configuration data. The data source configuration data is displayed in a list form on the local interface of the current program. After querying the combination field in the static source code of the current program, the method further includes: In the case where the combination field is not found in the static source code of the current program, searching the data source configuration data of the global configuration data for the combination field; When the data source configuration data of the global configuration data is queried, the list row where the combination field is located in the local interface is determined and jumped to locate the data source defined by the target string in the global configuration data.

9. A configuration data extraction and verification device based on source code analysis, characterized in that: include: an extraction module, configured to scan the static source code of the current program and extract code segments containing Java language feature marking information from the static source code when the static source code of the current program is acquired, wherein the Java language feature marking information includes annotations and identifiers; A parsing module, used for parsing the code fragment containing the Java language feature tag information to obtain the configuration data of the current program; An upload module, used to automatically upload the configuration data of the current program to a target server, where the target server is used to manage the configuration data of each program; A download verification module, used to download the configuration data of each program to a local computer for visual display, and to perform a global verification on the configuration data of each program downloaded to a local computer, and output the verification result; The running module is used to run the various programs when the verification result is used to indicate that the verification has passed.

10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Application program development method, device, equipment and medium

    CN110716715A

  • Application configuration information acquisition method, scaffold management device, medium and equipment

    CN116302087A

  • Analysis method and device of battery configuration file, storage medium and electronic equipment

    CN116976307A

  • Method and device for rendering page view

    CN117742704A

  • Check dependency and setup with metaprogramming for low-code and no-code development

    US20240126523A1