Target information acquisition method, electronic equipment and medium
By setting up target filtering information, target scanning engine and target filter, filtering information templates are generated and scanned and filtered multiple times, the accuracy and efficiency of target information acquisition in the existing technology are solved, and flexible expansion and accurate location information are achieved.
Patent Information
- Application Number
- CN202510366757.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
In the prior art, when a code scanning tool acquires target information, there are problems such as missed selection, low efficiency and non-target information mixing, resulting in poor accuracy in obtaining target information and unable to achieve flexible expansion.
By setting up the target filter information, the target scanning engine list and the target filter list, a filter information template is generated. Multiple target scanning engines perform a comprehensive scan, merge to generate an intermediate scan file, and finally the target filter processes it to generate a target information report.
It improves the efficiency and accuracy of obtaining target information, realizes flexible expansion and accurate location information, and facilitates engineers' analysis.
Smart Images

Figure CN119883284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a method, electronic equipment and medium for acquiring target information. Background Art
[0002] Before the chip code is released, it is necessary to scan the chip code to obtain the target information. The target information is the information that does not meet the chip code release requirements. The target information is then processed by engineers and released after the chip code fully meets the release requirements. In the prior art, the target information is obtained through code scanning tools. Due to the single function of some scanning tools, the target information may be missed, resulting in poor accuracy in obtaining the target information; some scanning tools have very slow scanning speeds, resulting in low efficiency in obtaining the target information; some scanning tools have fast scanning speeds, but in the scanning results, a large amount of information that actually meets the chip code release requirements will be introduced as target information, which creates a burden on the subsequent analysis process of engineers, resulting in poor accuracy in obtaining the target information. In addition, the existing code scanning tools cannot be flexibly expanded. It can be seen that how to improve the efficiency and accuracy of obtaining target information has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present invention aims to provide a method, electronic device and medium for acquiring target information, which improve the efficiency and accuracy of acquiring target information.
[0004] According to a first aspect of the present invention, there is provided a method for acquiring target information, comprising: Step S1, setting target screening information, a target scanning engine list and a target filter list, wherein the target screening information includes keywords and screening constraint information, the target scanning engine list includes at least one target scanning engine, and the target filter list includes at least one target filter arranged in a preset filtering order; Step S2, parsing the target screening information to generate a screening information template; Step S3, each target scanning engine in the target scanning engine list obtains the screening information template, and scans the to-be-processed file based on the screening information template to generate a scanning result corresponding to each target scanning engine, wherein the scanning result includes target scanning information and non-target scanning information; Step S4: Merge the scanning results corresponding to all target scanning engines to generate an intermediate scanning file; Step S5: The target filters in the target filter list process the intermediate scan files in sequence according to a preset filtering order, filter out non-target information of the intermediate scan files, and generate a target information report.
[0005] According to a second aspect of the present invention, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to execute the method described in the first aspect of the present invention.
[0006] According to a third aspect of the present invention, there is provided a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the first aspect of the present invention.
[0007] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the target information acquisition method, electronic device and medium provided by the present invention can achieve considerable technical advancement and practicality, and have wide industrial utilization value, and at least have the following beneficial effects: The present invention can flexibly set target screening information, target scanning engine and target filter according to application requirements, generate a screening information template that can be reused by multiple target scanning engines based on the target screening information, comprehensively acquire all possible target information based on multiple target scanning engines, and then filter out non-target information in all possible target information based on the target filter, thereby improving the efficiency and accuracy of acquiring target information. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] 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.
[0009] Figure 1 A flow chart of a method for acquiring target information provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0010] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0011] The embodiment of the present invention provides a method for obtaining target information. Figure 1 As shown, including: Step S1, setting target screening information, a target scanning engine list and a target filter list, wherein the target screening information includes keywords and screening constraint information, the target scanning engine list includes at least one target scanning engine, and the target filter list includes at least one target filter arranged in a preset filtering order.
[0012] The keyword is a specified string, and the filter constraint condition can be a writing rule in the code specification. Specifically, the target filter information, the target scanning engine list, and the target filter list can be obtained based on a unified I / O interface.
[0013] Step S2: parsing the target screening information to generate a screening information template.
[0014] The screening information template can be reused by all target scanning engines in the target scanning engine list.
[0015] Step S3: Each target scanning engine in the target scanning engine list obtains the screening information template, and scans the to-be-processed file based on the screening information template to generate a scanning result corresponding to each target scanning engine, wherein the scanning result includes target scanning information and non-target scanning information.
[0016] It should be noted that setting multiple target scanning engines can fully obtain target information, that is, it can ensure that target information is not missed. However, during the scanning process, some non-target scanning information may also be misjudged as scanning results. Therefore, the scanning results include both target scanning information and non-target scanning information. The file to be processed can specifically be a chip code file.
[0017] Step S4: The scanning results corresponding to all target scanning engines are merged to generate an intermediate scanning file.
[0018] Step S5: The target filters in the target filter list process the intermediate scan files in sequence according to a preset filtering order, filter out non-target information of the intermediate scan files, and generate a target information report.
[0019] It should be noted that the intermediate scan file generated by the fusion of the scan results corresponding to all target scanning engines through multiple target filters is filtered to ensure the accuracy of the target information acquisition. In addition, in the prior art, the filter is bound to the scanning engine, which cannot realize the expansion of the scanning engine or the expansion of the filter, and lacks flexibility.
[0020] The target scanning engine, target filter, and target screening information of the present invention can all be flexibly configured and are expandable. In addition, in the prior art, binding the filter to the scanning engine will cause filtering to be pre-placed, resulting in changes in the code position in the file to be processed, so that the position corresponding to the target information finally generated is not the position in the original code to be processed, and engineers cannot directly check based on the position information of the target information. In the embodiment of the present invention, the processing flow of the filter is a post-processing flow, and the position information in the scanning results is all the original position information in the file to be processed, which is convenient for engineers to check based on the position information of the target information.
[0021] The target information is information that does not meet the chip code release requirements, and may specifically include preset confidential information, information that does not meet preset coding specifications, preset error information, etc.
[0022] As an embodiment, the step S1 includes: Step S11: setting target screening information according to target information acquisition requirements.
[0023] Among them, the target screening information is flexibly set according to the target information acquisition requirements.
[0024] Step S12: selecting at least one target scanning engine from a preset scanning engine list according to a target information acquisition requirement, and generating the target scanning engine list. The scanning engines in the preset scanning engine list can be increased or decreased.
[0025] The scanning engines in the preset scanning engine list are universal and can be selected for use in different application scenarios, and the scanning engines can be flexibly adjusted or expanded by adding or reducing the scanning engines in the preset scanning engine list.
[0026] Step S13: Select at least one target filter from a preset filter list according to the target information acquisition requirement to generate the target filter list. The filters in the preset filter list can be increased or decreased.
[0027] The filters in the preset filter list are universal and can be selected for use in different application scenarios, and the filters can be flexibly adjusted or expanded by adding or reducing the filters in the preset filter list.
[0028] As an embodiment, step S2 includes: Step S21: If the target screening information is a keyword, execute step S22; if the target screening information is screening constraint information, execute step S23.
[0029] Step S22: Based on the keyword and the preset boundary conditions, a regular expression corresponding to the keyword is generated in the screening information template, and step S24 is executed.
[0030] Among them, assuming that the keyword is "ABC", the preset boundary conditions are that "ABC-D" is the target information and "ABC-E" is the non-target information, and the corresponding regular expression is generated based on this boundary condition and the keyword.
[0031] Step S23: Setting filtering options according to the filtering constraint information and storing the information in the filtering information template.
[0032] Step S24: Generate the screening information template based on all generated screening information templates and screening options.
[0033] As an embodiment, step S3 includes: Step S31: The target scanning engine selects corresponding filtering information from the filtering information template.
[0034] The filtering information may specifically be a keyword and a regular expression corresponding to the keyword, or a filtering constraint and a filtering option corresponding to the filtering constraint.
[0035] Step S32: The target scanning engine scans the file to be processed based on the corresponding filtering information and generates a corresponding scanning result. The scanning result includes: path information of the file to be processed, location information of the problem point, filtering information corresponding to the problem point and content information corresponding to the problem point. The content information corresponding to the problem point includes problem point code information and problem point context code information.
[0036] The path information of the file to be processed may be specifically composed of the path of the file to be processed and the file name to be processed. The problem point location information depends on the type of the file to be processed. For example, if the file to be processed is a text file, the problem point location information is the line number. If the file to be processed is an Excel file, the problem point location information is a combination of the line number and the column number.
[0037] As an embodiment, step S4 includes: Step S41: Divide the scan results corresponding to all target scan engines with the same to-be-processed file path information into a group of to-be-processed scan results.
[0038] Step S42: merge the screening information corresponding to the same problem point location information in each group of scan results to be processed into a screening information sequence, and merge the content information corresponding to the same problem point location information into a content information set.
[0039] It should be noted that multiple target information may appear at the same problem point location, so it is necessary to obtain a screening information sequence and a content information set.
[0040] Step S43, construct a root node corresponding to the intermediate scanning file, set each file path information to be processed as a child node corresponding to the root node, set all problem point location information corresponding to each file path information to be processed as a child node corresponding to the file path information to be processed, set the screening information sequence and content information set corresponding to each problem point location information as the child node corresponding to the problem point location information, and generate an intermediate scanning file with a tree structure.
[0041] It should be noted that setting the intermediate scan file to a tree structure facilitates the storage of the intermediate scan file, facilitates the parsing process of subsequent filters, and facilitates the clear display of the final target information, thereby increasing the readability of the target information.
[0042] As an embodiment, the target filter in the target filter list is {F 1 ,F 2 ,...,F n ,...,F N}, F n is the nth target filter in the target filter list, where n ranges from 1 to N, and N is the total number of target filters in the target filter list. 1 ,F 2 ,...,F n ,...,F N The filtering capabilities are arranged from high to low. It should be noted that F 1 ,F 2 ,...,F n ,...,F N Arranging the filters in descending order of filtration capacity can improve the overall filtration speed. The step S5 comprises: Step S51, set n=1.
[0043] Step S52: Determine whether there is a file in the intermediate scan that meets the requirements of F n The content of the corresponding filter condition, if it exists, will meet F n The filtering information and content information corresponding to the content of the corresponding filtering condition are deleted. If the corresponding problem point location information does not have a child node after deletion, the corresponding problem point location information will be deleted. If the corresponding file path information to be processed corresponding to the corresponding problem point location information does not have a child node after deletion, the corresponding file path information to be processed will be deleted.
[0044] Among them, F nThe corresponding filtering conditions include a preset whitelist, preset file header scanning items, and scanning items corresponding to preset function features to be deleted. It should be noted that the preset whitelist stores preset non-target information. When querying based on the preset whitelist, if the information in the intermediate scanned file exists in the preset whitelist, the corresponding screening information and content information will be deleted. Based on the tree structure of the intermediate file, it is possible to further determine whether the corresponding problem point location information and the path information of the file to be processed need to be deleted.
[0045] Step S53: Compare n and N. If n < N, set n = n + 1 and return to execute Step S52. If n = N, generate a target information report based on the current intermediate scanned file according to the preset file type.
[0046] Among them, the preset file types include txt, json, yaml, and xml. The target information report of the txt type can be directly viewed by engineers. The target information reports of the json, yaml, and xml types are convenient for the computer to perform other processing based on the target information. Set the file type of the target information report according to specific application requirements.
[0047] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0048] An embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0049] An embodiment of the present invention also provides a computer-readable storage medium storing computer-executable instructions, and the computer instructions are used to execute the method described in the embodiment of the present invention.
[0050] The embodiment of the present invention can flexibly set target screening information, target scanning engines, and target filters according to application requirements, generate a screening information template that can be reused by multiple target scanning engines based on the target screening information, comprehensively obtain all possible target information based on multiple target scanning engines, and then filter out the non-target information in all possible target information based on the target filter, improving the efficiency and accuracy of obtaining target information.
[0051] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A method for acquiring target information, characterized in that: include: Step S1, setting target screening information, a target scanning engine list and a target filter list, wherein the target screening information includes keywords and screening constraint information, the target scanning engine list includes at least one target scanning engine, and the target filter list includes at least one target filter arranged in a preset filtering order; Step S2, parsing the target screening information to generate a screening information template; Step S3, each target scanning engine in the target scanning engine list obtains the screening information template, and scans the to-be-processed file based on the screening information template to generate a scanning result corresponding to each target scanning engine, wherein the scanning result includes target scanning information and non-target scanning information; Step S4: Merge the scanning results corresponding to all target scanning engines to generate an intermediate scanning file; Step S5: The target filters in the target filter list process the intermediate scan files in sequence according to a preset filtering order, filter out non-target information of the intermediate scan files, and generate a target information report.
2. The method according to claim 1, characterized in that The step S1 comprises: Step S11, setting target screening information according to target information acquisition requirements; Step S12: selecting at least one target scanning engine from a preset scanning engine list according to a target information acquisition requirement, and generating the target scanning engine list, wherein the scanning engines in the preset scanning engine list can be increased or decreased; Step S13: Select at least one target filter from a preset filter list according to the target information acquisition requirement to generate the target filter list. The filters in the preset filter list can be increased or decreased.
3. The method according to claim 1, characterized in that The step S2 comprises: Step S21: if the target screening information is a keyword, execute step S22; if the target screening information is screening constraint information, execute step S23; Step S22: Based on the keyword and the preset boundary conditions, a regular expression corresponding to the keyword is generated in the screening information template, and step S24 is executed; Step S23, setting filtering options according to the filtering constraint information, and storing them in the filtering information template; Step S24: Generate the screening information template based on all generated screening information templates and screening options.
4. The method according to claim 3, characterized in that The step S3 comprises: Step S31, the target scanning engine selects corresponding screening information from the screening information template; Step S32: The target scanning engine scans the file to be processed based on the corresponding filtering information and generates a corresponding scanning result. The scanning result includes: path information of the file to be processed, location information of the problem point, filtering information corresponding to the problem point and content information corresponding to the problem point. The content information corresponding to the problem point includes problem point code information and problem point context code information.
5. The method according to claim 4, characterized in that The step S4 comprises: Step S41: Divide the scan results with the same path information of the files to be processed in the scan results corresponding to all target scan engines into a group of scan results to be processed; Step S42: Merge the screening information corresponding to the same problem point location information in each group of scan results to be processed into a screening information sequence, and merge the content information corresponding to the same problem point location information into a content information set; Step S43: Construct a root node corresponding to the intermediate scan file, set each path information of the file to be processed as a child node corresponding to the root node, set all problem point location information corresponding to each path information of the file to be processed as a child node corresponding to the path information of the file to be processed, and set the screening information sequence and content information set corresponding to each problem point location information as a child node corresponding to the problem point location information, to generate an intermediate scan file in a tree structure.
6. The method according to claim 5, wherein The target filters in the target filter list are {F1, F2, ..., F n ,...,F N }, F n is the nth target filter in the target filter list, the value range of n is 1 to N, N is the total number of target filters in the target filter list, F1, F2, ..., F n ,...,F N The filtering capabilities are arranged from high to low, and the step S5 comprises: Step S51: Set n = 1; Step S52: Determine whether there is a file in the intermediate scan that meets the requirements of F n The content of the corresponding filter condition, if it exists, will meet F n The screening information and content information corresponding to the content of the corresponding filtering condition are deleted. If the corresponding problem point location information does not have a child node after the deletion, the corresponding problem point location information is deleted. If the to-be-processed file path information corresponding to the corresponding problem point location information does not have a child node after the deletion, the corresponding to-be-processed file path information is deleted; Step S53: Compare n and N. If n < N, then set n = n + 1 and return to execute Step S52. If n = N, then generate a target information report based on the current intermediate scan file according to a preset file type.
7. The method according to claim 6, wherein F n The corresponding filtering conditions include a preset whitelist, preset file header scanning items, and preset scanning items corresponding to functional features to be deleted.
8. The method according to claim 6, wherein The preset file types include txt, json, yaml, xml.
9. An electronic device, characterized in that: Comprising: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are configured to execute the method described in any one of the foregoing claims 1-8.
10. A computer-readable storage medium, characterized in that: Stores computer-executable instructions for executing the method described in any one of the foregoing claims 1-8.
Citation Information
Patent Citations
Static code scanning method and device
CN108153664A
Log stack information analysis method and apparatus, computer device, and storage medium
CN109522209A
Code scanning and filtering method and device
CN111367819A
Multi-dimensional data processing method and system, electronic equipment and storage medium
CN115525633A
Website vulnerability scanning result display method and device, equipment and storage medium
CN116340658A