Target Information Acquisition Method, Electronic Device, and Medium

By setting up target filter information and filter lists, combining multiple scanning engines to generate filter templates, comprehensively scan and filter out target information, solving the problem of inaccuracy and efficiency in chip code scanning tools, and achieving efficient, accurate acquisition and flexible expansion of target information.

CN119883284BActive Publication Date: 2025-07-04METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510366757.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-04
Estimated Expiration
2045-03-26

AI Technical Summary

Technical Problem

When obtaining target information, existing chip code scanning tools have problems such as poor accuracy, low efficiency, or mixed non-target information in the scanning results, and cannot achieve flexible expansion.

Method used

By setting up target filter information, target scanning engine list and target filter list, filter the filter information templates, use multiple scanning engines to scan comprehensively and filter the target information through filters to generate target information reports.

Benefits of technology

It achieves efficient acquisition and accuracy of target information, supports flexible configuration and expansion, ensures the accuracy of scan result location information, and is convenient for engineers to check.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883284B_ABST
    Figure CN119883284B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of chip technology, and in particular, to a method for obtaining target information, an electronic device, and a medium. The method includes the steps of: S1, setting target screening information, a target scanning engine list, and a target filter list; S2, parsing the target screening information to generate a screening information template; S3, each target scanning engine obtains the screening information template, and scans the file to be processed based on the screening information template to generate a scanning result corresponding to each target scanning engine; S4, fusing the scanning results corresponding to all target scanning engines to generate an intermediate scanning file; S5, the target filter processes the intermediate scanning file in sequence according to a preset filtering order, filters out the non-target information in the intermediate scanning file, and generates a target information report. The present invention improves the efficiency and accuracy of obtaining target information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and in particular, to a method for obtaining target information, an electronic device, and a medium. Background Art

[0002] Before the chip code is released, it is necessary to scan the chip code to obtain target information, where the target information is information that does not meet the chip code release requirements. Then, engineers process the target information, and the chip code is released only when it fully meets the release requirements. In the prior art, target information is obtained through a code scanning tool. Some scanning tools may cause the situation of missing target information due to their single function, resulting in poor accuracy of obtaining target information; some scanning tools have a very slow scanning speed, resulting in low efficiency of obtaining target information; some scanning tools have a fast scanning speed, but in the scanning results, a large amount of information that actually meets the chip code release requirements is introduced as target information, causing a burden on the subsequent analysis process of engineers and resulting in poor accuracy of obtaining target information. In addition, the existing code scanning tools cannot be flexibly extended. It can be seen that how to improve the efficiency and accuracy of obtaining target information has become an urgent technical problem to be solved. Summary of the Invention

[0003] The object of the present invention is to provide a method for obtaining target information, an electronic device, and a medium, which improve the efficiency and accuracy of obtaining target information.

[0004] According to a first aspect of the present invention, a method for obtaining target information is provided, including:

[0005] Step S1, setting target screening information, a target scanning engine list, and a target filter list, where the target screening information includes keywords and screening constraint condition 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;

[0006] Step S2, parsing the target screening information to generate a screening information template;

[0007] Step S3, each target scanning engine in the target scanning engine list obtains the screening information template, and scans the file to be processed based on the screening information template to generate a scanning result corresponding to each target scanning engine, where the scanning result includes target scanning information and non-target scanning information;

[0008] Step S4, fusing the scanning results corresponding to all target scanning engines to generate an intermediate scanning file;

[0009] Step S5: The target filters in the target filter list process the intermediate scan file in sequence according to a preset filtering order, filter out the non-target information in the intermediate scan file, and generate a target information report.

[0010] According to a second aspect of the present invention, there is provided an electronic device, including: 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, and the instructions are configured to execute the method according to the first aspect of the present invention.

[0011] According to a third aspect of the present invention, there is provided a computer-readable storage medium storing computer-executable instructions for executing the method according to the first aspect of the present invention.

[0012] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solutions, a target information acquisition method, an electronic device and a medium provided by the present invention can achieve considerable technical progressiveness and practicality, and have wide industrial utilization value. It has at least the following beneficial effects:

[0013] 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 filters, improving the efficiency and accuracy of acquiring target information. Description of the Drawings

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0015] Figure 1 It is a flowchart of the target information acquisition method provided for the embodiments of the present invention. Detailed Embodiments

[0016] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0017] An embodiment of the present invention provides a method for obtaining target information, as Figure 1 shown, including:

[0018] Step S1, set target screening information, a target scan engine list, and a target filter list. The target screening information includes keywords and screening constraint condition information. The target scan engine list includes at least one target scan engine, and the target filter list includes at least one target filter arranged in a preset filtering order.

[0019] Among them, the keyword is a specified string, and the screening constraint condition can specifically be a writing rule in the code specification. Specifically, the target screening information, the target scan engine list, and the target filter list can be obtained based on a unified I / O interface.

[0020] Step S2, parse the target screening information to generate a screening information template.

[0021] Among them, the screening information template can be reused by all target scan engines in the target scan engine list.

[0022] Step S3, each target scan engine in the target scan engine list obtains the screening information template, and scans the file to be processed based on the screening information template to generate a scan result corresponding to each target scan engine. The scan result includes target scan information and non-target scan information.

[0023] It should be noted that setting multiple target scan engines can comprehensively obtain target information, that is, it can ensure that no target information is missed. However, during the scanning process, some non-target scan information may also be misjudged as scan results. Therefore, the scan result includes both target scan information and non-target scan information. The file to be processed can specifically be a chip code file.

[0024] Step S4, fuse the scan results corresponding to all target scan engines to generate an intermediate scan file.

[0025] Step S5, the target filters in the target filter list sequentially process the intermediate scan file according to the preset filtering order, filter out the non-target information in the intermediate scan file, and generate a target information report.

[0026] It should be noted that multiple target filters are used to filter the intermediate scan file generated by fusing the scan results corresponding to all target scan engines to ensure the accuracy of target information acquisition. In addition, in the prior art, the filter is bound to the scan engine, which cannot achieve the expansion of the scan engine or the expansion of the filter, lacking flexibility.

[0027] The target scanning engine, target filter, and target screening information of the present invention can all be flexibly configured and are extensible. Additionally, in the prior art, binding the filter to the scanning engine results in pre-filtering, causing changes in the code positions in the file to be processed, so that the positions corresponding to the final generated target information are not the positions in the original code to be processed, and engineers cannot directly check based on the position information of the target information. In the embodiments of the present invention, the processing flow of the filter is a post-processing flow, and all the position information in the scanning result is the original position information in the file to be processed, facilitating engineers to check based on the position information of the target information.

[0028] The target information is information that does not meet the chip code release requirements, and specifically may include preset confidential information, information that does not meet the preset coding specifications, preset error information, etc.

[0029] As an embodiment, step S1 includes:

[0030] Step S11: Obtain the target screening information according to the requirements of the target information.

[0031] Among them, the target screening information is flexibly set according to the requirements for obtaining the target information.

[0032] Step S12: Select at least one target scanning engine from the preset scanning engine list according to the requirements for obtaining the target information to generate the target scanning engine list, and the scanning engines in the preset scanning engine list can be increased or decreased.

[0033] Among them, 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 extended by increasing or decreasing the scanning engines in the preset scanning engine list.

[0034] Step S13: Select at least one target filter from the preset filter list according to the requirements for obtaining the target information to generate the target filter list, and the filters in the preset filter list can be increased or decreased.

[0035] Among them, 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 extended by increasing or decreasing the filters in the preset filter list.

[0036] As an embodiment, step S2 includes:

[0037] Step S21: If the target screening information is a keyword, execute step S22; if the target screening information is screening constraint condition information, execute step S23.

[0038] Step S22: Based on the keyword and the preset boundary conditions, generate a regular expression corresponding to the keyword in the screening information template, and execute Step S24.

[0039] Among them, assuming the keyword is "ABC", and the preset boundary condition is that "ABC-D" is the target information and "ABC-E" is the non-target information, generate the corresponding regular expression based on this boundary condition and the keyword.

[0040] Step S23: Set the screening options according to the screening constraint condition information and store them in the screening information template.

[0041] Step S24: Generate the screening information template based on all the generated screening information templates and screening options.

[0042] As an embodiment, Step S3 includes:

[0043] Step S31: The target scanning engine selects the corresponding screening information from the screening information template.

[0044] Among them, the screening information can specifically be the keyword and the regular expression corresponding to the keyword, or the screening constraint condition and the screening options corresponding to the screening constraint condition.

[0045] Step S32: The target scanning engine scans the file to be processed based on the corresponding screening information and generates the corresponding scanning result. The scanning result includes: the path information of the file to be processed, the location information of the problem point, the screening information corresponding to the problem point, and the content information corresponding to the problem point. The content information corresponding to the problem point includes the problem point code information and the problem point context code information.

[0046] Among them, the path information of the file to be processed can specifically be composed of the path of the file to be processed and the name of the file to be processed. The location information of the problem point depends on the type of the file to be processed. For example, if the file to be processed is a text file, the location information of the problem point is the line number; if the file to be processed is an Excel file, the location information of the problem point is a combination of the line number and the column number.

[0047] As an embodiment, Step S4 includes:

[0048] Step S41: Divide the scanning results with the same path information of the file to be processed in all the scanning results corresponding to the target scanning engines into a group of scanning results to be processed.

[0049] Step S42: Merge the screening information corresponding to the same location information of the problem point in each group of scanning results to be processed into a screening information sequence, and merge the content information corresponding to the same location information of the problem point into a content information set.

[0050] It should be noted that multiple target information may appear at the same problem point location. Therefore, it is necessary to obtain the screening information sequence and the content information set.

[0051] Step S43: Construct the root node corresponding to the intermediate scan file. Set each to-be-processed file path information as the child node corresponding to the root node. Set all the problem point location information corresponding to each to-be-processed file path information as the child node corresponding to the to-be-processed file path information. Set the screening information sequence and the 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 scan file in a tree structure.

[0052] It should be noted that setting the intermediate scan file in a tree structure facilitates the storage of the intermediate scan file, facilitates the parsing and processing of subsequent filters, and is convenient for clearly displaying the final target information, increasing the readability of the target information.

[0053] As an embodiment, 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, where the value range of n is from 1 to N, and N is the total number of target filters in the target filter list. F1, F2,..., F n ,..., F N are arranged in descending order of filtering ability. It should be noted that F1, F2,..., F n ,..., F N are arranged in the order of descending filtering ability, which can improve the overall filtering speed. The step S5 includes:

[0054] Step S51: Set n = 1.

[0055] Step S52: Determine whether there is content in the intermediate scan file that meets the filtering conditions corresponding to F n . If so, delete the screening information and the content information corresponding to the content that meets the filtering conditions corresponding to F n . If there are no child nodes corresponding to the problem point location information after deletion, delete the corresponding problem point location information. If there are no child nodes corresponding to the to-be-processed file path information corresponding to the problem point location information after deletion, delete the corresponding to-be-processed file path information.

[0056] 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. Based on the preset whitelist for querying, if the information in the preset whitelist exists in the intermediate scanned file, 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.

[0057] 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.

[0058] 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 facilitate other processing by the computer based on the target information. Set the file type of the target information report according to specific application requirements.

[0059] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict 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 operations are 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.

[0060] An embodiment of the present invention further 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.

[0061] An embodiment of the present invention further 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.

[0062] 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 non-target information from all possible target information based on the target filter, improving the efficiency and accuracy of obtaining target information.

[0063] The above are only the preferred embodiments of the present invention, and do not impose any form of limitation on the present invention. Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to equivalent embodiments of equivalent changes within the scope of the technical solution of the present invention by using the above-disclosed technical content. However, as long as it does not depart from the content of the technical solution of the present invention, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention still fall within the scope of the technical solution of the present invention.

Claims

1. A method for obtaining target information, characterized in that, Including: Step S1: Set target screening information, a target scanning engine list, and a target filter list. The target screening information includes keywords and screening constraint condition 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: Parse 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 file to be processed based on the screening information template to generate a scanning result corresponding to each target scanning engine. The scanning result includes: file path information to be processed, problem point location information, screening 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; Step S4: Integrate the scanning results corresponding to all target scanning engines to generate an intermediate scanning file; The step S4 includes: Step S41: Divide the scanning results with the same file path information to be processed in the scanning results corresponding to all target scanning engines into a group of scanning results to be processed; Step S42: Merge the screening information corresponding to the same problem point location information in each group of scanning 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 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, 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 a tree-structured intermediate scanning file; Step S5: The target filters in the target filter list process the intermediate scanning file in sequence according to the preset filtering order, filter out the non-target information in the intermediate scanning file, and generate a target information report.

2. The method according to claim 1, characterized in that, The step S1 includes: Step S11: Set target screening information according to the target information acquisition requirement; Step S12: Select at least one target scanning engine from a preset scanning engine list according to the target information acquisition requirement to generate the target scanning engine list. 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 includes: Step S21: If the target screening information is a keyword, execute step S22; if the target screening information is screening constraint condition information, execute step S23; Step S22: Based on the keyword and the preset boundary conditions, generate a regular expression corresponding to the keyword in the screening information template, and execute Step S24; Step S23: Set the screening options according to the screening constraint condition information and store them in the screening information template; Step S24: Generate the screening information template based on all the generated screening information templates and screening options.

4. The method according to claim 3, wherein: The step S3 includes: Step S31: The target scanning engine selects the corresponding screening information from the screening information template; Step S32: The target scanning engine scans the file to be processed based on the corresponding screening information and generates a corresponding scanning result.

5. The method according to claim 4, 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, where n ranges from 1 to N, and N is the total number of target filters in the target filter list. F1, F2,..., F n ,..., F N are arranged in descending order of filtering ability. The step S5 includes: Step S51: Set n = 1; Step S52: Determine whether there is content in the intermediate scanned file that meets the filtering condition F n If there is, delete the screening information and content information corresponding to the content that meets the filtering condition F n If there are no child nodes in the corresponding problem point location information after deletion, delete the corresponding problem point location information. If there are no child nodes in the corresponding file path information to be processed for the corresponding problem point location information after deletion, delete the corresponding file path information to be processed; 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 scanned file according to the preset file type.

6. The method according to claim 5, wherein: F n The corresponding filtering conditions include a preset whitelist, preset file header scanning items, and scanning items corresponding to preset function features to be deleted.

7. The method according to claim 5, wherein: The preset file types include txt, json, yaml, xml.

8. 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 according to any one of the foregoing claims 1-7.

9. A computer-readable storage medium, characterized in that, Store computer-executable instructions for executing the method according to any one of the foregoing claims 1-7.

Citation Information

Patent Citations

  • Static code scanning method and device

    CN108153664A

  • Code scanning and filtering method and device

    CN111367819A

  • Website vulnerability scanning result display method and device, equipment and storage medium

    CN116340658A