Static code scanning method, device and equipment, medium and program product

By generating the target abstract syntax tree and performing static scanning, it solves the problem that existing tools have difficulty analyzing code for the e-commerce application framework in the financial industry, and achieves a more efficient and accurate code scanning effect.

CN119807002APending Publication Date: 2025-04-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411869328.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Existing static code analysis tools are difficult to effectively analyze the unique transaction logic of the e-commerce application framework for the financial industry, and cannot accurately identify complex transaction processing and business rules, resulting in unsatisfactory scanning results.

Method used

By obtaining the files to be parsed under the framework of e-commerce application for the financial industry, a target abstract syntax tree is generated based on the abstract syntax tree creation rules, and the files are statically scanned based on the tree.

Benefits of technology

It improves the accuracy of code scanning of e-commerce application frameworks for the financial industry, enhances the adaptability to application frameworks in this field, and can more accurately identify business logic, code specifications and exception transaction processing problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807002A_ABST
    Figure CN119807002A_ABST
Patent Text Reader

Abstract

The invention discloses a static code scanning method, device and equipment, a medium and a program product, and relates to the technical field of financial science and technology. The static code scanning method comprises the steps of obtaining a to-be-analyzed file under an electronic commerce application framework oriented to the financial industry; generating a target abstract syntax tree composed of file tags according to an abstract syntax tree creation rule and the to-be-analyzed file; and performing static scanning on the to-be-analyzed file based on the target abstract syntax tree. According to the technical scheme provided by the embodiment of the invention, the adaptability to the electronic commerce application framework oriented to the financial industry can be enhanced, and the code scanning accuracy of the electronic commerce application framework oriented to the financial industry is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a static code scanning method, device, equipment, medium and program product. Background Art

[0002] As software systems become increasingly complex, especially in the financial services industry and multi-level transaction management systems, e-commerce application frameworks for the financial industry are widely used to build complex transaction systems. In order to improve code quality and reduce potential errors, static code scanning tools are widely used in the development process to identify logical errors, security vulnerabilities and performance bottlenecks in the code.

[0003] However, existing static code analysis tools, such as source code auditing tools and code standardization tools, are mainly general-purpose tools that fail to effectively analyze the unique transaction logic of e-commerce application frameworks for the financial industry, and fail to accurately identify the complex transaction processing and business rules therein. E-commerce application frameworks for the financial industry usually involve complex interactions between multiple components, and existing tools have difficulty detecting logical errors and potential exception handling issues between these business components. In summary, existing analysis methods lack a deep understanding of e-commerce application frameworks for the financial industry, resulting in unsatisfactory results when scanning applications based on e-commerce application frameworks for the financial industry. Summary of the invention

[0004] The present invention provides a static code scanning method, device, equipment, medium and program product to solve the problem that the current static code analysis method has poor compatibility with the e-commerce application framework for the financial industry and cannot accurately scan the code of the e-commerce application framework for the financial industry.

[0005] According to one aspect of the present invention, a static code scanning method is provided, comprising:

[0006] Get the files to be parsed under the e-commerce application framework for the financial industry;

[0007] Generate a target abstract syntax tree consisting of file tags according to the abstract syntax tree creation rules and the file to be parsed;

[0008] Based on the target abstract syntax tree, static scanning is performed on the file to be parsed.

[0009] According to another aspect of the present invention, there is provided a static code scanning device, comprising:

[0010] The file acquisition module is used to acquire the files to be parsed under the e-commerce application framework for the financial industry;

[0011] A syntax tree creation module is used to create rules and files to be parsed according to the abstract syntax tree, and generate a target abstract syntax tree consisting of file tags;

[0012] The code static scanning module is used to perform static scanning on the file to be parsed based on the target abstract syntax tree.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the static code scanning method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the static code scanning method described in any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the static code scanning method according to any embodiment of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention obtains the file to be parsed under the e-commerce application framework for the financial industry, thereby generating a target abstract syntax tree composed of file tags according to the abstract syntax tree creation rules and the file to be parsed, and then statically scanning the file to be parsed based on the target abstract syntax tree. In this solution, the abstract syntax tree creation rules can extract file tags based on the format characteristics of the file to be parsed and the structure of the e-commerce application framework for the financial industry, so that the target abstract syntax tree composed of file tags can greatly improve the scanning effect of the code under the e-commerce application framework for the financial industry, solve the problem that the current static code analysis method is poorly compatible with the e-commerce application framework for the financial industry and cannot accurately scan the code of the e-commerce application framework for the financial industry, and can enhance the adaptability to the e-commerce application framework for the financial industry and improve the accuracy of code scanning of the e-commerce application framework for the financial industry.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A flowchart of a static code scanning method provided in Embodiment 1 of the present invention;

[0023] Figure 2 A flowchart of a static code scanning method provided in Embodiment 2 of the present invention;

[0024] Figure 3 A schematic diagram of a static code scanning system provided in Embodiment 2 of the present invention;

[0025] Figure 4 A schematic diagram of the structure of a static code scanning device provided in Embodiment 3 of the present invention;

[0026] Figure 5 A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Embodiment 1

[0030] Figure 1 This is a flowchart of a static code scanning method provided in the first embodiment of the present invention. This embodiment can be applied to the case of efficiently and accurately scanning the business logic code of the e-commerce application framework for the financial industry. The method can be executed by a static code scanning device, which can be implemented in the form of hardware and / or software, and the static code scanning device can be configured in an electronic device. The electronic device can include but is not limited to a computer or a server. Figure 1 As shown, the method includes:

[0031] Step 110: Obtain the file to be parsed under the e-commerce application framework for the financial industry.

[0032] The file to be parsed may be a financial business code file of an e-commerce application framework application code source for the financial industry. The file format of the file to be parsed may be an XML (Extensible Markup Language) format.

[0033] In the embodiment of the present invention, the to-be-parsed file of the application code source of the e-commerce application framework for the financial industry which needs to be subjected to static code scanning may be obtained first.

[0034] Step 120: Generate a target abstract syntax tree consisting of file tags according to the abstract syntax tree creation rules and the file to be parsed.

[0035] The abstract syntax tree creation rule may be a pre-set syntax tree creation rule adapted to an e-commerce application framework for the financial industry. The file tag may be a code tag in the file to be parsed. The target abstract syntax tree may be a syntax tree created based on the abstract syntax tree creation rule and the file to be parsed.

[0036] In an embodiment of the present invention, rules can be created based on an abstract syntax tree to parse the file to be parsed, obtain file tags in the file to be parsed, and further filter all file tags to obtain key file tags of the file to be parsed under an e-commerce application framework for the financial industry, thereby creating a target abstract syntax tree using the key file tags.

[0037] For example, rules can be created based on an abstract syntax tree to parse the XML-formatted file to be parsed, extract the business logic, transaction processing logic, and the unique structure of the e-commerce application framework for the financial industry in the file to be parsed, and determine the key file tags for static code scanning based on the above extracted information. Among them, the key file tags can be necessary file tags for detecting business logic and code specifications in the file to be parsed, and processing abnormal transactions.

[0038] Step 130: Based on the target abstract syntax tree, statically scan the file to be parsed.

[0039] In an embodiment of the present invention, the target abstract syntax tree can be used to perform static scanning on the to-be-parsed files of the e-commerce application framework for the financial industry to complete the detection of business logic and code specifications, as well as the troubleshooting of abnormal transactions.

[0040] The technical solution of the embodiment of the present invention obtains the file to be parsed under the e-commerce application framework for the financial industry, thereby generating a target abstract syntax tree composed of file tags according to the abstract syntax tree creation rules and the file to be parsed, and then statically scanning the file to be parsed based on the target abstract syntax tree. In this solution, the abstract syntax tree creation rules can extract file tags based on the format characteristics of the file to be parsed and the structure of the e-commerce application framework for the financial industry, so that the target abstract syntax tree composed of file tags can greatly improve the scanning effect of the code under the e-commerce application framework for the financial industry, solve the problem that the current static code analysis method is poorly compatible with the e-commerce application framework for the financial industry and cannot accurately scan the code of the e-commerce application framework for the financial industry, and can enhance the adaptability to the e-commerce application framework for the financial industry and improve the accuracy of code scanning of the e-commerce application framework for the financial industry.

[0041] Embodiment 2

[0042] Figure 2 This is a flowchart of a static code scanning method provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment and provides a specific optional implementation method for generating a target abstract syntax tree composed of file tags according to the abstract syntax tree creation rules and the file to be parsed. Figure 2 As shown, the method includes:

[0043] Step 210: Obtain the file to be parsed under the e-commerce application framework for the financial industry.

[0044] Step 220: Create rules based on the abstract syntax tree to determine the primary file tags and secondary file tags of the files to be parsed in the e-commerce application framework for the financial industry.

[0045] The first-level file label may be a label node connected to the root node in the target abstract syntax tree, and the second-level file label may be a sub-label node under the first-level file label.

[0046] In an embodiment of the present invention, rules can be created based on an abstract syntax tree to parse files to be parsed in an e-commerce application framework for the financial industry, and file tags can be extracted to obtain primary file tags and secondary file tags.

[0047] In an optional embodiment of the present invention, the first-level file tag may include a data part tag, a data and program connection tag, and a program flow tag; wherein the data part tag may include a data definition tag, an interface send and return tag, and a stored procedure tag.

[0048] The data part tag may be a data related tag in the e-commerce application framework for the financial industry. The data definition tag may be a data tag in the e-commerce application framework for the financial industry. The interface sending and returning tags may be format tags in the e-commerce application framework for the financial industry. The stored procedure tag may be a procedure tag in the e-commerce application framework for the financial industry.

[0049] The data and program connection tag may be a context tag in an e-commerce application framework for the financial industry, and the program flow tag may be an operation tag in an e-commerce application framework for the financial industry.

[0050] In an embodiment of the present invention, data definition labels, interface send and return labels, stored procedure labels, data and program connection labels, and program flow labels are used as first-level file labels, which, while being adapted to the e-commerce application framework for the financial industry, achieves the most simplified processing of the next-level label nodes of the root node.

[0051] Step 230: Create a target abstract syntax tree according to the primary file tags and the secondary file tags.

[0052] In an embodiment of the present invention, the first-level file label and the second-level file label can be used as nodes of the syntax tree, and the first-level file label is connected to the root node, and the second-level file label is connected in series with the corresponding first-level file label of the previous level to obtain the target abstract syntax tree.

[0053] Exemplarily, the secondary file tags under the data definition tag may include but are not limited to the kColl (single data) tag, or the iColl (data set consisting of a group of single data tags) tag. The secondary file tags under the interface send and return tag may include but are not limited to the List (receiving interface send and return) tag. The secondary file tags under the stored procedure tag may include but are not limited to the inputParam (stored procedure send item) tag and the outParam (stored procedure return item) tag. The secondary file tags under the data and program connection tag may include but are not limited to the refKColl (reference data definition to program) tag and the refService (reference data service to program) tag. The secondary file tags under the program flow tag may include but are not limited to the refFormat (reference interface send return definition to program) tag and the opStep (call different program flows) tag. The kColl tag may include the field (variable definition tag) and refData (reference iColl to data definition tag) fields. The List tag may include the id (interface send return variable unique identifier) ​​field and the config (interface send return variable configuration) field. The refKColl tag may include the refld (reference data definition unique identifier) ​​field, and the refService tag may include the refld (reference service unique identifier) ​​field, alias (service alias) field, and type (service type) field. The refFormat tag may include the name (reference name sent back by the interface) field and the refld (reference unique identifier sent back by the interface) field. The opStep tag may include the id (process unique identifier) ​​field, alias (process alias) field, stepConfig (configuration item within the process) field, and jumpConfig (jump configuration between processes) field.

[0054] In an optional embodiment of the present invention, creating a target abstract syntax tree based on primary file tags and secondary file tags may include: determining the file tag nesting relationship of the file to be parsed under the e-commerce application framework for the financial industry; creating a target abstract syntax tree based on the primary file tags, secondary file tags and the file tag nesting relationship.

[0055] The file tag nesting relationship may be a relationship that describes the hierarchical structure between the file tags.

[0056] In an embodiment of the present invention, the nested relationship of file tags of a file to be parsed under an e-commerce application framework for the financial industry can be parsed, and the first-level file tag can be used as a node connected to the root node in a syntax tree, and then based on the nested relationship of the file tags, the second-level file tag corresponding to the first-level file tag can be determined, so that the second-level file tag can be used as a node in the syntax tree and connected to the node of the first-level file tag with a nested relationship to obtain a target abstract syntax tree, that is, based on the nested relationship of the file tags, the first-level file tags and the second-level file tags are automatically associated and spliced ​​without human intervention to build a syntax tree required for static scanning.

[0057] Step 240: Based on the target abstract syntax tree, statically scan the file to be parsed.

[0058] In an embodiment of the present invention, after static scanning of the file to be parsed is performed based on the target abstract syntax tree, a static scanning report can be generated according to the static scanning results to record the code anomalies, anomaly types, and code correction suggestions of the file to be parsed through the static scanning report.

[0059] Optionally, an intuitive and friendly graphical user interaction interface can also be provided to display the static scanning results based on the user interaction interface, that is, allowing the user to view the static scanning results and static scanning reports, and also allowing the user to configure static scanning tasks through the user interaction interface, that is, using static scanning tasks to personalize the analysis of the files to be parsed.

[0060] In an optional embodiment of the present invention, static scanning of the file to be parsed based on the target abstract syntax tree may include: based on the target abstract syntax tree, scanning the reference behavior data of the secondary file tag of the file to be parsed under the program flow tag; based on the target abstract syntax tree, scanning the reference behavior data in the secondary file tag of the file to be parsed under the data and program connection sub-tag.

[0061] The reference behavior data may be a defined reference behavior in the code representing the file to be parsed.

[0062] In an embodiment of the present invention, based on the target abstract syntax tree, the secondary file tag under the program flow tag can be determined, thereby scanning the file to be parsed and obtaining the reference behavior data of the secondary file tag under the program flow tag. Then, based on the reference behavior data of the secondary file tag under the program flow tag, it is determined whether the interface sending and returning definitions are referenced under the secondary file tag of the program flow tag in the file to be parsed, thereby realizing failure troubleshooting of the format, that is, failure troubleshooting of the interface sending and returning.

[0063] In an embodiment of the present invention, it is also possible to determine the secondary file tag under the data and program connection subtag based on the target abstract syntax tree, and scan the file to be parsed to obtain the reference behavior data of the file to be parsed in the secondary file tag under the data and program connection subtag, and then determine whether the defined procedure, that is, the defined stored procedure, is referenced under the refService tag of the context tag based on the reference behavior data in the secondary file tag under the data and program connection subtag, thereby realizing the troubleshooting of missing method declarations.

[0064] In an optional embodiment of the present invention, static scanning of the file to be parsed is performed based on the target abstract syntax tree, and may also include: scanning the process atomic operations used by the program under the program flow label in the file to be parsed based on the target abstract syntax tree; scanning the process atomic operation number and the number of process atomic operation definitions in the file to be parsed based on the target abstract syntax tree.

[0065] The process atomic operation may be an operation using opStep in the file to be parsed. The process atomic operation number may be an identifier corresponding to the process atomic operation. The process atomic operation definition count may be a description of the definition count for a process atomic operation.

[0066] In an embodiment of the present invention, based on the target abstract syntax tree, the code segments under the program flow label in the file to be parsed can be scanned to obtain the process atomic operations used by the program under the program flow label, and then determine whether the process atomic operations are defined in the .xml file under the e-commerce application framework for the financial industry. If not defined, it is determined that the method declaration is missing, thereby realizing the troubleshooting of the missing declared methods.

[0067] In an embodiment of the present invention, the process atomic operation number and the number of process atomic operation definitions defined under the secondary file label of the program flow label in the file to be parsed can also be scanned based on the target abstract syntax tree. If the process atomic operation is used to perform a business jump, it is detected whether the process atomic operation number is missing to achieve the troubleshooting of logical error jumps. If it is found that the process atomic operation number is repeatedly defined, it is further determined whether the instruction alias field (such as the alias field) under the secondary file label of the program flow label is the same. When the process atomic operation number and the instruction alias field are the same at the same time, it is determined that a step jump error occurs, and the step jump error is checked.

[0068] Figure 3 Schematic diagram of a static code scanning system provided by Embodiment 2 of the present invention. Figure 3As shown, the static code scanning system includes a user interaction interface, a user configuration parsing module, a report generation module, a localization operation module, a syntax tree creation module, and a code static scanning module. The user interaction interface serves as the interaction entrance between the user and the static code scanning system, allowing the user to configure static scanning tasks and view static scanning reports. The user configuration parsing module is used to obtain relevant configuration items for code scanning and pass them down to the syntax tree creation module. The syntax tree creation module parses the source code of the e-commerce application framework for the financial industry and generates a target abstract syntax tree for static analysis. The code static scanning module is the core of the entire system and analyzes the target abstract syntax tree according to the custom rule base. The report generation module integrates the static analysis results and generates a detailed static scanning report. The localization operation module ensures that the system can run efficiently in the local environment and improves scanning performance.

[0069] This solution enhances the adaptability of the e-commerce application framework for the financial industry: it provides a detection function specifically for the transaction logic and business rules of the e-commerce application framework for the financial industry, improves the accuracy of scanning, and can parse and analyze the multi-component interaction in the e-commerce application framework system for the financial industry, detect potential logical errors, missing exception handling and other problems, and improve the level of complex business logic analysis. The system can run efficiently in the developer's local environment, reduce dependence on cloud resources, and improve development efficiency.

[0070] The technical solution of the embodiment of the present invention obtains the file to be parsed under the e-commerce application framework for the financial industry, thereby determining the first-level file label and the second-level file label of the file to be parsed under the e-commerce application framework for the financial industry based on the abstract syntax tree creation rule, and then creates a target abstract syntax tree according to the first-level file label and the second-level file label, and further performs static scanning on the file to be parsed based on the target abstract syntax tree. In this solution, the abstract syntax tree creation rule can extract the first-level file label and the second-level file label according to the format characteristics of the file to be parsed and the structure of the e-commerce application framework for the financial industry, so as to create two core levels in the target abstract syntax tree through these two types of labels, while achieving the simplification of the number of nodes in the target abstract syntax tree, it can greatly improve the scanning effect of the code under the e-commerce application framework for the financial industry, solve the problem that the current static code analysis method is poorly compatible with the e-commerce application framework for the financial industry, and cannot accurately scan the code of the e-commerce application framework for the financial industry, and can enhance the adaptability to the e-commerce application framework for the financial industry and improve the code scanning accuracy of the e-commerce application framework for the financial industry.

[0071] Embodiment 3

[0072] Figure 4This is a schematic diagram of the structure of a static code scanning device provided in Embodiment 3 of the present invention.

[0073] like Figure 4 As shown, the device comprises:

[0074] The file acquisition module 310 is used to acquire the file to be parsed of the BBT application code source;

[0075] A syntax tree creation module 320, for generating a target abstract syntax tree consisting of file tags according to an abstract syntax tree creation rule and a file to be parsed;

[0076] The code static scanning module 330 is used to perform static scanning on the file to be parsed based on the target abstract syntax tree.

[0077] The technical solution of the embodiment of the present invention obtains the file to be parsed under the e-commerce application framework for the financial industry, thereby generating a target abstract syntax tree composed of file tags according to the abstract syntax tree creation rules and the file to be parsed, and then statically scanning the file to be parsed based on the target abstract syntax tree. In this solution, the abstract syntax tree creation rules can extract file tags based on the format characteristics of the file to be parsed and the structure of the e-commerce application framework for the financial industry, so that the target abstract syntax tree composed of file tags can greatly improve the scanning effect of the code under the e-commerce application framework for the financial industry, solve the problem that the current static code analysis method is poorly compatible with the e-commerce application framework for the financial industry and cannot accurately scan the code of the e-commerce application framework for the financial industry, and can enhance the adaptability to the e-commerce application framework for the financial industry and improve the accuracy of code scanning of the e-commerce application framework for the financial industry.

[0078] Optionally, the syntax tree creation module 320 includes a label determination unit and a syntax tree creation unit. The label determination unit is used to determine the primary file label and the secondary file label of the file to be parsed in the e-commerce application framework for the financial industry based on the abstract syntax tree creation rule. The syntax tree creation unit is used to create the target abstract syntax tree according to the primary file label and the secondary file label.

[0079] Optionally, the first-level file tag includes a data part tag, a data and program connection tag, and a program flow tag; wherein the data part tag includes a data definition tag, an interface send and return tag, and a stored procedure tag.

[0080] Optionally, the syntax tree creation unit is specifically used to determine the file tag nesting relationship of the file to be parsed under the e-commerce application framework for the financial industry; and create the target abstract syntax tree according to the first-level file tag, the second-level file tag and the file tag nesting relationship.

[0081] Optionally, the code static scanning module 330 is specifically used to scan the reference behavior data of the secondary file tag of the file to be parsed under the program flow tag based on the target abstract syntax tree; based on the target abstract syntax tree, scan the reference behavior data in the secondary file tag of the file to be parsed under the data and program connection sub-tag.

[0082] Optionally, the code static scanning module 330 is specifically used to scan the process atomic operations used by the program under the program flow label in the file to be parsed based on the target abstract syntax tree; based on the target abstract syntax tree, scan the process atomic operation number and the number of process atomic operation definitions in the file to be parsed.

[0083] The static code scanning device provided in the embodiment of the present invention can execute the static code scanning method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0084] Embodiment 4

[0085] Figure 5 A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0086] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0087] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0088] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a static code scanning method.

[0089] In some embodiments, the static code scanning method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the static code scanning method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the static code scanning method in any other appropriate manner (e.g., by means of firmware).

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

[0091] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0092] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

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

[0094] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0095] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of traditional physical hosts and VPS servers, which are difficult to manage and have weak business scalability.

[0096] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0097] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A static code scanning method, characterized in that: include: Get the files to be parsed under the e-commerce application framework for the financial industry; Generate a target abstract syntax tree consisting of file tags according to the abstract syntax tree creation rule and the file to be parsed; Based on the target abstract syntax tree, static scanning is performed on the file to be parsed.

2. The method according to claim 1, characterized in that According to the abstract syntax tree creation rule and the file to be parsed, a target abstract syntax tree consisting of file tags is generated, including: Determine the primary file label and the secondary file label of the file to be parsed in the e-commerce application framework for the financial industry based on the abstract syntax tree creation rule; The target abstract syntax tree is created according to the first-level file tag and the second-level file tag.

3. The method according to claim 2, characterized in that The first-level file tag includes a data part tag, a data and program connection tag, and a program flow tag; wherein the data part tag includes a data definition tag, an interface sending and returning tag, and a stored procedure tag.

4. The method according to claim 2, characterized in that: Creating the target abstract syntax tree according to the primary file tag and the secondary file tag includes: Determine the file tag nesting relationship of the to-be-parsed file under the e-commerce application framework for the financial industry; The target abstract syntax tree is created according to the first-level file tag, the second-level file tag and the file tag nesting relationship.

5. The method according to claim 3, characterized in that: Based on the target abstract syntax tree, statically scanning the file to be parsed includes: Based on the target abstract syntax tree, scanning the reference behavior data of the secondary file tag under the program flow tag of the file to be parsed; Based on the target abstract syntax tree, the reference behavior data in the secondary file tag under the data and program connection subtag of the file to be parsed is scanned.

6. The method according to claim 3, characterized in that: Based on the target abstract syntax tree, static scanning is performed on the file to be parsed, further comprising: Based on the target abstract syntax tree, scanning the process atomic operations used by the program under the program process label in the file to be parsed; Based on the target abstract syntax tree, the process atomic operation number and the number of process atomic operation definitions in the file to be parsed are scanned.

7. A static code scanning device, characterized in that: include: The file acquisition module is used to acquire the files to be parsed under the e-commerce application framework for the financial industry; A syntax tree creation module, used to generate a target abstract syntax tree consisting of file tags according to an abstract syntax tree creation rule and the file to be parsed; The code static scanning module is used to perform static scanning on the file to be parsed based on the target abstract syntax tree.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the static code scanning method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the static code scanning method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the static code scanning method according to any one of claims 1 to 6.