Data processing method, device, electronic device and storage medium
By analyzing the target code files and historical version code files of the target project, a statistical list of functional modules is generated, which solves the problem of low code file detection efficiency in the existing technology, and realizes efficient warning item detection and task division of labor for the target project .
Patent Information
- Application Number
- CN202111560487.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-12-20
AI Technical Summary
The prior art is less efficient when detecting warning items in project code files, and requires scanning a large number of files, resulting in inefficient detection.
By obtaining the target code file of the target project under the target version, parsing out the target warning items of each functional module, comparing them with the historical warning items of the historical version, generating a statistical list of functional modules, and sending them to the corresponding processing object. For subsequent processing.
The warning item detection efficiency of target projects is improved, and the task division in multi-person collaboration projects is realized, which is convenient for warning item detection of code files at the functional module level.
Smart Images

Figure CN114237685B_ABST
Abstract
Description
Technical Field
[0001] The present application is applied to the field of computer technology, and in particular relates to a data processing method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of computer technology, when developing a project, such as developing a software or a web page, it is usually necessary to detect whether there are problems with the project's code files. At present, the detection of whether there are problems with the project's code files is usually done by scanning all the project's files and then determining the warning items in the project's code files. Since all the files need to be scanned, a large amount of data needs to be analyzed, resulting in low efficiency in detecting warning items in the code files. Summary of the invention
[0003] The embodiments of the present application provide a data processing method, device, electronic device, and storage medium, which are helpful to improve the efficiency of detecting warning items of target items.
[0004] On the one hand, an embodiment of the present application discloses a data processing method, the method comprising:
[0005] Obtaining the target code file of the target project under the target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object;
[0006] Parsing the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer;
[0007] Obtaining a historical code file of the target project under a historical version, and extracting historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions;
[0008] Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module;
[0009] According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0010] On the other hand, an embodiment of the present application discloses a data processing device, the device comprising:
[0011] An acquisition unit, used for acquiring a target code file of a target project under a target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object;
[0012] A processing unit, configured to parse the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer;
[0013] The acquisition unit is further used to acquire a historical code file of the target project under a historical version, and extract historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions;
[0014] The processing unit is further used to generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module;
[0015] The sending unit is used to send the statistical information of each functional module in the target statistical list to the corresponding processing object according to the processing object corresponding to the functional module corresponding to each target code file.
[0016] In another aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to perform the following steps:
[0017] Obtaining the target code file of the target project under the target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object;
[0018] Parsing the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer;
[0019] Obtaining a historical code file of the target project under a historical version, and extracting historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions;
[0020] Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module;
[0021] According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0022] In another aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the computer program instructions are used to perform the following steps:
[0023] Obtaining the target code file of the target project under the target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object;
[0024] Parsing the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer;
[0025] Obtaining a historical code file of the target project under a historical version, and extracting historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions;
[0026] Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module;
[0027] According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0028] In another aspect, the present application discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned data processing method.
[0029] The present application provides a data processing scheme, which can obtain the target code file of the target project under the target version, each target code file corresponds to each functional module, thereby selecting the target code file corresponding to the functional module that needs to detect the warning item, and flexibly realizing the code detection of the target project; then, according to the target code file, the target warning item corresponding to each target code file is parsed, and the historical warning items corresponding to the historical code files of the target project under the historical version are obtained, and then, according to the warning association information of the K dimensions corresponding to the target warning item and the warning association information of the K dimensions corresponding to the historical warning item, a target statistical list is generated, thereby detecting the difference between the detection results of the historical version and the target version; then, the statistical information of each functional module in the target statistical list is sent to the processing object corresponding to the functional module, so that the processing object corresponding to each functional module can perform subsequent processing based on the detection result of the corresponding functional module, which is convenient for the division of tasks in multi-person collaborative projects. Thus, the warning item detection of the code file of any functional module in the target project can be realized by dividing the functional modules of the target project, which helps to improve the efficiency of the detection of the warning items of the target project. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0031] Figure 1 It is a structural diagram of a data processing system provided in an embodiment of the present application;
[0032] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0033] Figure 3 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0034] Figure 4 This is a schematic diagram of the effect of a target statistical list provided in an embodiment of the present application;
[0035] Figure 5 This is a schematic diagram of the effect of a target statistical list provided in an embodiment of the present application;
[0036] Figure 6 This is a schematic diagram of the effect of a target statistical list provided in an embodiment of the present application;
[0037] Figure 7 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0038] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] The present application provides a data processing scheme, which can obtain the target code file of the target project under the target version, each target code file corresponds to each functional module, thereby selecting the target code file corresponding to the functional module that needs to detect the warning item, and flexibly realizing the code detection of the target project; then, according to the target code file, the target warning item corresponding to each target code file is parsed, and the historical warning items corresponding to the historical code files of the target project under the historical version are obtained, and then, according to the warning association information of the K dimensions corresponding to the target warning item and the warning association information of the K dimensions corresponding to the historical warning item, a target statistical list is generated, thereby detecting the difference between the detection results of the historical version and the target version; then, the statistical information of each functional module in the target statistical list is sent to the processing object corresponding to the functional module, so that the processing object corresponding to each functional module can perform subsequent processing based on the detection result of the corresponding functional module, which is convenient for the division of tasks in multi-person collaborative projects. Thus, the warning item detection of the code file of any functional module in the target project can be realized by dividing the functional modules of the target project, which helps to improve the efficiency of the detection of the warning items of the target project.
[0041] In a possible implementation manner, the technical solution of the present application can be applied to a data processing system, see Figure 1 , Figure 1It is a structural diagram of a data processing system provided by an embodiment of the present application, and the data processing system may include a data processing device and a processing client. Among them, the data processing device can be used to execute the above-mentioned data processing scheme to detect the warning items of the target code file of the target project, and send the statistical information corresponding to each functional module to the corresponding processing object. The target project can be a project corresponding to any application software, web page or product, such as the target project can be a social application, an online payment application, an information platform, etc., which is not limited here. The target project may include M functional modules, each of which may include at least one code file, and M is a positive integer. For example, for a project of a social application, the project may include multiple functional modules, such as the functional module may be a functional module for displaying an information list, a functional module for displaying friend information, a functional module for displaying own user information, etc., which is not limited here. The processing object may be a person for processing the warning item (such as repairing the warning item in the code file), or a client corresponding to the person for processing the warning item, which is not limited here. The processing client may be the client corresponding to the person for processing the warning item, that is, the above-mentioned processing object. In one scenario, when the processing client receives the statistical information of the corresponding functional module, the statistical information can be displayed to facilitate the processing personnel to determine the warning items in the code file of the corresponding functional module, and then the warning items can be repaired. In this way, each processing object can only receive the statistical information of the corresponding functional module, which helps to improve the security of the detection result data.
[0042] It should be noted that, unless otherwise specified, in the specific implementation of this application, related data such as code files, warning-related information of warning items, user information, etc., when the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0043] The technical solution of the present application can be used in an electronic device, which can be a terminal, a server, or other devices for data processing, such as the above-mentioned data processing device, which is not limited in the present application. Optional. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services, middleware services, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.
[0044] Based on the above description, the present application embodiment proposes a data processing method. Figure 2 , Figure 2 1 is a flow chart of a data processing method provided in an embodiment of the present application. The method can be executed by the electronic device mentioned above. The method can include the following steps.
[0045] S201. Obtain the target code file of the target project under the target version.
[0046] Among them, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object. It is understandable that one target code file has a corresponding functional module, and one functional module may have one or more target code files. The target version may be the version of the target project that currently needs to detect the warning item. It is understandable that each version of the target project is associated with a corresponding version number to distinguish different versions, and the larger the version number value, the newer the version.
[0047] The target code file may be a code file that needs to be detected. There may be one or more target code files for the target project under the target version, which is not limited here. It is understandable that the embodiment of the present application may obtain all or part of the code files of the target project under the target version as the target code files, which is not limited here. Among them, the functional module to which the target code file belongs may be referred to as the target functional module. For example, the project may include functional module 1, functional module 2, functional module 3, and functional module 4. If it is necessary to detect warning items for the code files of functional module 1 and functional module 2, the code files under functional module 1 and functional module 2 may be obtained as the target code files. In a possible implementation, when storing the various code files of the target project, the code files of different functional modules may be classified and stored. For example, under the project directory of the target project, a folder for each functional module is constructed, and the folder corresponding to each functional module stores the code file of the corresponding functional module. For example, under the directory of the target project, there is a folder 1 for storing the code file corresponding to functional module 1, a folder 2 for storing the code file corresponding to functional module 2, a folder 3 for storing the code file corresponding to functional module 3, and a folder 4 for storing the code file corresponding to functional module 4, thereby realizing the classified storage of the code files of each functional module under the target project. Further, optionally, under each functional module, each code file can be divided more finely, that is, under a functional module, at least one subfolder can be included, each subfolder corresponds to a sub-functional module, and each subfile can store the code file for realizing the function of the corresponding sub-functional module. Similarly, it can be deduced by analogy, and then at least one corresponding subfolder can be constructed under the subfolder to realize a more detailed division of the functional modules.
[0048] S202: parse the target code file to obtain a target warning item corresponding to each target code file.
[0049] The target warning item may be a warning existing in the target code file. The target warning item may be a warning generated after the target code file is compiled. It is understandable that the number of target warning items corresponding to each target code file may be zero, or one or more, which is not limited here.
[0050] The target warning item corresponds to K dimensions of warning-related information, where K is a positive integer. The K dimensions of warning-related information include one or more of the following: the type of the warning item, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, and the description information of the warning item. Among them, the type of the warning item can be the type to which the warning item belongs. For example, the type of the warning item can be: lexical or preprocessing problems, semantic problems, deprecation problems, format string problems, memory problems, core basic problems, etc. The type of the warning item can be generated by a preset warning item type mapping relationship, and each warning item has a corresponding type. The address information of the target code file where the warning item is located can be the storage path of the target code file where the warning item is located in the target project, such as the address information can be: / xx1 / xx2 / module name / code file name. The location information of the warning item in the target code file is used to indicate which row and column the warning item appears in the target code file. The description information of the warning item is used to indicate the specific content of the warning, such as the warning description information can describe why the warning item is generated. It can be understood that the resolved target warning items and the warning association information corresponding to each warning item can be called a detection result.
[0051] In one scenario, the target warning items corresponding to each target code file are parsed, and a corresponding attribute list file can be generated according to each target code file, and the warning items corresponding to each target code file and the warning association information of K dimensions corresponding to the warning items are determined according to the attribute list file. Among them, the attribute list file can also be called a Plist file, and the corresponding attribute list file can be generated by a static scanning tool, such as the static scanning tool can be: Clang Static Analyzer, OCLint, infer, etc., which are not limited here. The attribute list file can record the type of warning items existing in the corresponding code file, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, the description information of the warning item, etc., which are not limited here, so that the warning association information of K dimensions corresponding to the target warning items in the corresponding target code file can be determined according to the information recorded in the attribute list file.
[0052] S203: Obtain the historical code files of the target project in the historical version, and extract historical warning items from the historical code files.
[0053] Among them, the historical version can be the version of the target project developed before the target version, that is, the version number of the historical version is less than the version number of the target version. The historical code file is the code file under the target project of the historical version. The number of historical code files can be one or more, and there is no limit here. The historical warning item is the warning existing in the historical code file. It can be understood that the number of target warning items corresponding to each historical code file can be zero, or one or more, and there is no limit here.
[0054] The historical warning items correspond to K dimensions of warning-related information. The K dimensions of warning-related information corresponding to the historical warning items can refer to the K dimensions of warning-related information corresponding to the target warning items in step S202, that is, they can also include one or more of the following: the type of warning item, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, and the description information of the warning item.
[0055] Among them, obtaining the historical warning items of the historical version target project can be to generate a corresponding attribute list file according to each historical code file, and determine the warning items corresponding to each historical code file and the warning association information of K dimensions corresponding to each warning item according to the attribute list file. In one scenario, before parsing the target code file to obtain the target warning item corresponding to each target code file, the code file of the historical version of the target project can be parsed, and the detection results of the corresponding historical version of the code file (that is, the warning items corresponding to each code file, and the warning association information of K dimensions corresponding to each warning item) can be associated with the version number of the project and stored in the storage area. When it is necessary to obtain the historical warning items and warning association information of the historical version, the version number of the historical version is determined, such as determining the version number of the latest version of at least one version that has been parsed in the past as the version number of the above-mentioned historical version, and obtaining the detection results of the historical version from the storage area according to the version number.
[0056] S204: Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning items.
[0057] Among them, the target statistical list includes statistical information for each functional module. The statistical information can be generated according to the above-mentioned warning association information. For example, the statistical information may include the type of warning item of the target warning item corresponding to each module, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, and the description information of the warning item. The statistical information may also include the number of target warning items corresponding to each functional module of the target version (or the number of target warning items corresponding to all functional modules that need to be detected), the number of types of target warning items of each type under each functional module, etc., which are not limited here.
[0058] The target statistical list may be a statistical list generated based on statistical information. The target statistical list includes statistical information for each functional module, and statistical information with the same meaning may be displayed as a column of data. For example, the first column in the statistical list may be used to indicate each functional module, the second column may be used to indicate the file name of the code file to which the target warning item under the corresponding functional module belongs, the third column may be used to indicate the address information of the target code file where each warning item is located, the fourth column may be used to indicate the type of warning item, the fifth column may be used to indicate the number of target warning items corresponding to each module, and so on, without limitation here.
[0059] In a possible implementation, the statistical information may also include warning comparison information, which is used to indicate the difference between the warning items of the historical version and the current version. The process of determining the target statistical list may include the following steps: ① Determine the warning comparison information according to the warning association information of the K dimensions corresponding to the target warning item and the warning association information of the K dimensions corresponding to the historical warning item. Among them, the warning comparison information includes one or more of the following: the repaired historical warning item information and the newly added warning item information. The repaired historical warning item information is used to indicate the warning association information of the reduced warning items under the functional module corresponding to the target version compared with the historical version, and the newly added warning item information is used to indicate the warning association information of the increased warning items under the functional module corresponding to the target version compared with the historical version. It can be understood that the repaired historical warning item information may also include the number of historical warning items that have been repaired, and the newly added warning item information may also include the number of newly added warning items that have been counted, which is not limited here. ② Generate a target statistical list according to the warning association information of the K dimensions corresponding to the target warning item and the warning comparison information. That is, the statistical information to be counted is determined according to the warning association information and warning comparison information of K dimensions corresponding to the target warning item, and then a target statistical list is generated according to each statistical information, which will not be elaborated here.
[0060] S205 . According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0061] Among them, the statistical information in the target statistical list is classified according to the functional modules, so the statistical information corresponding to each functional module can be quickly determined from the first list, and then the statistical information of each functional module can be sent to the processing object of the corresponding functional module. In this way, each processing object can only see the detection results of the corresponding functional module. If the processing objects corresponding to each functional module are different, the detection results of the corresponding functional module can be protected from being known by other processing objects, reducing the possibility of data leakage and improving the security of the detection results of each functional module.
[0062] In a possible implementation, the processing object corresponding to the functional module can be determined by obtaining an object mapping table. The object mapping table is used to indicate the corresponding relationship between each functional module and the processing object in the target project. For example, for functional module 1, the person who performs relevant processing on functional module 1 is Zhang San, then the object mapping table can record the object ID corresponding to Zhang San or the device ID of the client corresponding to Zhang San, which is not limited here. Then, step S205 can specifically include the following steps: ① Obtain the object mapping table. Among them, the object mapping table can be stored in the corresponding storage area and can be obtained according to the storage address of the object mapping table. It can be understood that the object mapping table can be maintained regularly to ensure that the object mapping table is the latest mapping table. ② Determine the processing object corresponding to the functional module corresponding to each target code file according to the object mapping table, and send the statistical information of each functional module in the target statistical list to the processing object corresponding to the functional module. Among them, the processing object corresponding to the functional module to which each target code file belongs is determined according to the object mapping table, and the processing object corresponding to the functional module can be determined for each corresponding relationship in the object mapping table.
[0063] The present application provides a data processing scheme, which can obtain the target code file of the target project under the target version, each target code file corresponds to each functional module, thereby selecting the target code file corresponding to the functional module that needs to detect the warning item, and flexibly realizing the code detection of the target project; then, according to the target code file, the target warning item corresponding to each target code file is parsed, and the historical warning items corresponding to the historical code files of the target project under the historical version are obtained, and then, according to the warning association information of the K dimensions corresponding to the target warning item and the warning association information of the K dimensions corresponding to the historical warning item, a target statistical list is generated, thereby detecting the difference between the detection results of the historical version and the target version; then, the statistical information of each functional module in the target statistical list is sent to the processing object corresponding to the functional module, so that the processing object corresponding to each functional module can perform subsequent processing based on the detection result of the corresponding functional module, which is convenient for the division of tasks in multi-person collaborative projects. Thus, the warning item detection of the code file of any functional module in the target project can be realized by dividing the functional modules of the target project, which helps to improve the efficiency of the detection of the warning items of the target project.
[0064] See also Figure 3 , Figure 3 1 is a flow chart of a data processing method provided in an embodiment of the present application, which is applied to the above-mentioned electronic device. The data processing method may include the following steps.
[0065] S301. Obtain the target code file of the target project under the target version.
[0066] In a possible implementation, as described above, all or part of the code files of the target project under the target version are obtained as the target code files, and the instructions of which functional modules need to be obtained can be determined by the code acquisition instruction. If the target project includes M functional modules, M is a positive integer, then step S301 may specifically include the following steps: ① Obtain code processing instructions, the code processing instructions are used to indicate the acquisition of code files corresponding to N target functional modules, N is a positive integer, and N is less than or equal to M. Among them, N is less than or equal to M, which means that the code processing instruction can be used to obtain code files corresponding to some or all functional modules of the target project. The target functional module is the functional module indicated by the code processing instruction that needs to be analyzed and processed. ② According to the code processing instruction, determine the target folder corresponding to each target functional module. Among them, the target folder is used to store the code file corresponding to the target functional module. Determining the target folder may also be determining the address information of the target folder. For example, if the folder name of the folder of the target functional module is: Folder 1, then under the target project, the address information of the folder corresponding to the target functional module is: / xx1 / Folder 1, and the code file corresponding to the functional module is stored under the path of " / xx1 / Folder 1". ③ Use the code file under the target folder as the target code file. For example, N target functional modules include functional module 1, and the address information of the folder corresponding to functional module 1 is: / xx1 / Folder 1, and the path of / xx1 / Folder 1 includes code files file1, file2, and file3, then file1, file2, and file3 can be used as target code files.
[0067] In a possible implementation, the code processing instruction may be generated in multiple ways.
[0068] For example, a function module input operation is detected, and code processing instructions are generated according to the N target function modules indicated by the function module input operation. Among them, the function module input operation is used to input the module information of the N target function modules, such as the module information can be the folder name of the folder corresponding to the target function module, or the address information of the folder corresponding to the target function module. In a possible scenario, the module input operation can be performed based on a target page, and the target page is used to input the relevant information of the data to be processed, such as the target function module to be processed (or the folder address of the function module to be processed) can be input based on the target page, and the above-mentioned object mapping table can also be input based on the target page, which is not limited here. Furthermore, when a confirmation operation based on the input information is detected (such as clicking a control for indicating confirmation input), a code processing instruction is generated according to the input target function module to indicate the problem of the code file in the detection target function module.
[0069] For another example, the importance of each functional module is determined, N target functional modules are determined according to the importance of each functional module, and code processing instructions are generated according to the N target functional modules. Among them, the importance of the module is used to indicate the importance of the function of the module in the project, and the importance of the module can be divided into multiple levels, such as medium, high, low and other different levels. If some functions are the core functions of the project, or the key functions to maintain the operation of the project, the importance of the functional modules of these functions is determined to be high, otherwise it is determined to be medium or low. According to the importance of each functional module, N target functional modules are determined, and the functional modules with a preset importance can be determined as target functional modules. The preset importance can be the importance preset by the user, such as the above-mentioned target page can be used by the user to determine which functional modules with the importance to be processed, or the corresponding preset importance can be determined according to the size of the project, and the size of the project can be determined according to the number of code files included in the project. For example, if the project is relatively large (the number of code files included in the project is greater than the number threshold), the functional module with the highest importance can be determined as the target functional module for detection, thereby reducing the amount of data detected.
[0070] S302: parse the target code file to obtain a target warning item corresponding to each target code file.
[0071] In a possible implementation, the present application may also preset the types of warning items that need to be detected, and then when parsing the target warning items corresponding to each target code file based on at least one target code file, only at least one warning item corresponding to the preset type may be parsed, thereby enabling more targeted detection of warning items in the code files.
[0072] S303: Obtain the historical code files of the target project under the historical version, and extract historical warning items from the historical code files.
[0073] The relevant description of step S303 can refer to step S203 and will not be repeated here.
[0074] S304: Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning items.
[0075] In a possible implementation manner, the target statistics list may be embodied in at least one manner.
[0076] For example, see Figure 4 , Figure 4: is a schematic diagram of the effect of a target statistical list provided by an embodiment of the present application. The target statistical list can be used to simply display the location of the target warning items of each functional module, so that the processing object can quickly locate the location of the warning item for repair. The target statistical list can include the module name of the functional module (such as Figure 4 ), whether it is a new warning item compared to the historical version (such as Figure 4 ), the file name of the code file to which the warning item belongs (such as Figure 4 ), the location information of the warning item (such as Figure 4 404 in ), the address information of the target code file where the warning item is located (such as Figure 4 ), description information of the warning item (such as Figure 4 Optionally, in the target statistics list, the information of the warning items newly added compared to the historical version can be displayed by special marking, such as marking by different colors, different fonts, underlining, etc., so that the newly added warning items can be highlighted, which is helpful for the processing object to be more vigilant about the newly added warning items.
[0077] For example, see Figure 5 , Figure 5 This is a schematic diagram of the effect of a target statistical list provided by an embodiment of the present application. The target statistical list can be used to simply display the overall situation of the target warning items of each functional module, so that the processing object can quickly understand the current warning distribution of each code file. The target statistical list includes the name of each functional module (such as Figure 5 ), the file name of the code file included in the functional module (such as Figure 5 ), the number of warning items included in each code file (as shown in 502 in Figure 5 503 in ), the number of new warning items (such as Figure 5 504 in ), the number of warning items that have been repaired (such as Figure 5 505 in ), the corresponding processing object (such as Figure 5 Optionally, in the target statistical list, the number of newly added warning items and the number of repaired warning items can be displayed by different marks, such as marking the number of newly added warning items with one color and the number of repaired warning items with another color.
[0078] For example, see Figure 6 , Figure 6 : is a schematic diagram of the effect of a target statistical list provided by an embodiment of the present application. The target statistical list can be used to indicate the overall situation of warning items classified by warning type under each functional module. The target statistical list can include the module name of each functional module (such as Figure 6 ), each warning type under each functional module (such as Figure 6 602 in FIG. 602 shows a warning item type) and the number of warning items (such as Figure 6 603 in ), the number of new warning items (such as Figure 6 ) and the number of fixed warnings (as shown in 604 in Figure 6 605 in ), the corresponding processing object (such as Figure 6 606 in the example above) and so on. Optionally, in the target statistics list, the number of newly added warning items and the number of repaired warning items can be displayed using different tags.
[0079] S305 . According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0080] In a possible implementation, the statistical information of each functional module in the target statistical list of each display mode can be sent to the corresponding processing object, so that the processing object can view the information of each warning item from multiple aspects to facilitate the repair of the warning item.
[0081] S306 , sorting the target warning items corresponding to each functional module from high to low according to the risk level, to obtain a warning item risk sequence for each functional module.
[0082] Among them, as mentioned above, the target warning item is associated with a corresponding risk level. The risk level can be determined based on the probability that the problem indicated by the warning item will affect the application in subsequent applications, and the size of the impact that the problem indicated by the warning item can cause in the subsequent application process of the project. The risk level is the level generated after risk assessment of various warning items. The risk level can be expressed as multiple levels such as large, medium, and small, or as a corresponding risk coefficient, which is not limited here. The risk coefficient can determine the corresponding risk value based on the probability that the above-mentioned warning item affects the application and the size of the impact of the warning item on the application in subsequent applications, and then determine the risk coefficient of the corresponding warning item based on each risk value. The warning item risk sequence can include target warning items and each target warning item is arranged from large to small according to the risk level. If the risk level is the same, the target warning items with the same risk level can be randomly arranged, which is not limited here.
[0083] S307: Generate a warning repair strategy according to the warning item risk sequence of each functional module.
[0084] Among them, the warning repair strategy indicates the repair order of the target warning items. The repair order of each warning item can be based on the above-mentioned warning item risk sequence. The earlier the warning item risk sequence is, the earlier the repair order is. For example, the warning item risk sequence is: warning item 1, warning item 2, warning item 3, warning item 4, warning item 5, then the generated warning repair strategy can be used to indicate that the repair order of each target warning item is: warning item 1, warning item 2, warning item 3, warning item 4, warning item 5. In a possible implementation, the warning repair strategy can also include the location information of the target warning item, thereby allowing the processing object to quickly locate the location of the warning item, which helps to quickly repair the warning item.
[0085] S308: Send the warning repair strategy corresponding to each functional module to the corresponding processing object.
[0086] Among them, the warning repair strategy corresponding to each functional module is sent to the processing object corresponding to the functional module, and the object mapping table can be obtained, and then the processing object corresponding to each functional module is determined according to the object mapping table, and the warning repair strategy is sent to the processing object corresponding to the functional module. It can be understood that the timing of sending the warning repair strategy to the corresponding processing object can be to send it to the corresponding processing object at the same time as step S305, or to send it to the corresponding processing object before or after step S305, which is not limited here.
[0087] The present application provides a data processing scheme, which can obtain at least one target code file corresponding to the target version of the target project, each target code file belongs to a corresponding functional module, thereby selecting at least one target code file corresponding to the functional module that needs to detect the warning item, thereby improving the efficiency of code detection of the target project; then, according to at least one target code file, the target warning item corresponding to each target code file is parsed, and the historical warning item corresponding to at least one historical code file of the historical version of the target project is obtained, and then according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item, a target statistical list is generated, thereby detecting the difference between the detection results of the historical version and the target version; then, the statistical information of each functional module in the target statistical list is sent to the processing object corresponding to the functional module, so that the processing object corresponding to each functional module can perform subsequent processing based on the detection result of the corresponding functional module, which is convenient for the division of tasks in multi-person collaborative projects. Thus, the warning item detection of the code file of any functional module in the target project can be realized by dividing the functional modules of the target project, which helps to improve the efficiency of detecting the warning items of the target project.
[0088] See also Figure 7 , Figure 7is a structural diagram of a data processing device provided in an embodiment of the present application. Optionally, the data processing device may be provided in the above-mentioned electronic device. Figure 7 As shown, the data processing device described in this embodiment may include:
[0089] An acquisition unit 701 is used to acquire a target code file of a target project under a target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object;
[0090] The processing unit 702 is used to parse the target warning item corresponding to each target code file according to the target code file, and the target warning item corresponds to warning association information of K dimensions; K is a positive integer;
[0091] The acquisition unit 701 is further used to acquire the historical code files of the target project under the historical version, and extract historical warning items from the historical code files, wherein the historical warning items correspond to warning association information of K dimensions;
[0092] The processing unit 702 is further configured to generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module;
[0093] The sending unit 703 is used to send the statistical information of each functional module in the target statistical list to the corresponding processing object according to the processing object corresponding to the functional module corresponding to each target code file.
[0094] In one implementation, the statistical information includes warning comparison information; the processing unit 702 is specifically configured to:
[0095] Determine warning comparison information according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item, wherein the warning comparison information includes one or more of the following: repaired historical warning item information and newly added warning item information;
[0096] A target statistical list is generated according to the warning association information of K dimensions corresponding to the target warning item and the warning comparison information.
[0097] In one implementation, the target project includes M functional modules, where M is a positive integer; the acquisition unit 701 is specifically configured to:
[0098] Obtain a code processing instruction, where the code processing instruction is used to instruct to obtain code files corresponding to N target function modules, where N is a positive integer and is less than or equal to M;
[0099] According to the code processing instruction, a target folder corresponding to each target function module is determined respectively; the target folder is used to store the code file corresponding to the target function module;
[0100] The code file in the target folder is used as at least one target code file.
[0101] In one implementation, the acquiring unit 701 is specifically configured to:
[0102] A function module input operation is detected, and code processing instructions are generated according to the N target function modules indicated by the function module input operation; the function module input operation is used to input module information of the N target function modules;
[0103] Alternatively, the importance of each functional module is determined, N target functional modules are determined according to the importance of each functional module, and code processing instructions are generated according to the N target functional modules.
[0104] In one implementation, the processing unit 702 is specifically configured to:
[0105] Obtain an object mapping table; the object mapping table is used to indicate the correspondence between each functional module and the processing object in the target project;
[0106] The processing object corresponding to the functional module corresponding to each target code file is determined according to the object mapping table, and the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0107] In one implementation, the target warning item is associated with a corresponding risk level; the processing unit 702 is further configured to:
[0108] Sort the target warning items corresponding to each functional module from high to low according to the risk level to obtain a warning item risk sequence for each functional module;
[0109] Generating a warning repair strategy according to the warning item risk sequence of each functional module, wherein the warning repair strategy indicates a repair order for the target warning item;
[0110] The warning repair strategy corresponding to each functional module is sent to the corresponding processing object.
[0111] In one implementation, the warning association information of the K dimensions includes one or more of the following: the type of warning item, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, and the description information of the warning item.
[0112] See also Figure 8 , Figure 8 801 and 802. The electronic device described in this embodiment includes: a processor 801 and a memory 802. Optionally, the electronic device may also include a network interface 803 or a power supply function module. The processor 801, the memory 802 and the network interface 803 may exchange data.
[0113] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0114] The network interface 803 may include an input device and / or an output device, for example, the input device may be a control panel, a microphone, a receiver, etc., and the output device may be a display screen, a transmitter, etc., which are not listed here. For example, in an embodiment of the application, the network interface may include a receiver and a transmitter.
[0115] The memory 802 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 801. A portion of the memory 802 may also include a non-volatile random access memory. When the processor 801 calls the program instructions, it is used to execute:
[0116] Obtaining the target code file of the target project under the target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object;
[0117] Parsing the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer;
[0118] Obtaining a historical code file of the target project under a historical version, and extracting historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions;
[0119] Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module;
[0120] According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0121] In one implementation, the statistical information includes warning comparison information; the processor 801 is specifically configured to:
[0122] Determine warning comparison information according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item, wherein the warning comparison information includes one or more of the following: repaired historical warning item information and newly added warning item information;
[0123] A target statistical list is generated according to the warning association information of K dimensions corresponding to the target warning item and the warning comparison information.
[0124] In one implementation, the target project includes M functional modules, where M is a positive integer; the processor 801 is specifically configured to:
[0125] Obtain a code processing instruction, where the code processing instruction is used to instruct to obtain code files corresponding to N target function modules, where N is a positive integer and is less than or equal to M;
[0126] According to the code processing instruction, a target folder corresponding to each target function module is determined respectively; the target folder is used to store the code file corresponding to the target function module;
[0127] The code file in the target folder is used as at least one target code file.
[0128] In one implementation, the processor 801 is specifically configured to:
[0129] A function module input operation is detected, and code processing instructions are generated according to the N target function modules indicated by the function module input operation; the function module input operation is used to input module information of the N target function modules;
[0130] Alternatively, the importance of each functional module is determined, N target functional modules are determined according to the importance of each functional module, and code processing instructions are generated according to the N target functional modules.
[0131] In one implementation, the processor 801 is specifically configured to:
[0132] Obtain an object mapping table; the object mapping table is used to indicate the correspondence between each functional module and the processing object in the target project;
[0133] The processing object corresponding to the functional module corresponding to each target code file is determined according to the object mapping table, and the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
[0134] In one implementation, the target warning item is associated with a corresponding risk level; the processor 801 is further configured to:
[0135] Sort the target warning items corresponding to each functional module from high to low according to the risk level to obtain a warning item risk sequence for each functional module;
[0136] Generating a warning repair strategy according to the warning item risk sequence of each functional module, wherein the warning repair strategy indicates a repair order for the target warning item;
[0137] The warning repair strategy corresponding to each functional module is sent to the corresponding processing object.
[0138] In one implementation, the warning association information of the K dimensions includes one or more of the following: the type of warning item, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, and the description information of the warning item.
[0139] Optionally, when the program instructions are executed by the processor, other steps of the method in the above embodiment may also be implemented, which will not be repeated here.
[0140] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the above method, such as executing the method executed by the above electronic device, which is not repeated here.
[0141] Optionally, the storage medium involved in the present application, such as computer-readable storage medium, may be non-volatile or volatile.
[0142] Optionally, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of blockchain nodes, etc. Among them, the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain may include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0143] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and functional modules involved are not necessarily required by the present application.
[0144] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0145] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the steps performed in the embodiments of the above methods. For example, the computer device can be a terminal, or can be a server.
[0146] The above is a detailed introduction to a data processing method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data processing method, characterized in that: The method comprises: A function module input operation is detected, and a code processing instruction is generated according to the N target function modules indicated by the function module input operation, or the importance of each function module is determined, and N target function modules are determined according to the importance of each function module, and a code processing instruction is generated according to the N target function modules; the function module input operation is used to input module information of the N target function modules; the target project includes M function modules, M is a positive integer; the code processing instruction is used to instruct to obtain code files corresponding to the N target function modules, N is a positive integer, and N is less than or equal to M; According to the code processing instruction, a target folder corresponding to each target functional module is determined respectively; the target folder is used to store the code file corresponding to the target functional module, and the code file under the target folder is used as the target code file of the target project under the target version; each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object; Parsing the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer; Obtaining a historical code file of the target project under a historical version, and extracting historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions; Determine warning comparison information according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item, wherein the warning comparison information includes one or more of the following: repaired historical warning item information and newly added warning item information; Generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning comparison information; the target statistical list includes statistical information for each functional module; the statistical information includes warning comparison information; According to the processing object corresponding to the functional module corresponding to each target code file, the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
2. The method according to claim 1, characterized in that: The step of sending the statistical information of each functional module in the target statistical list to the corresponding processing object according to the processing object corresponding to the functional module corresponding to each target code file includes: Obtain an object mapping table; the object mapping table is used to indicate the correspondence between each functional module and the processing object in the target project; The processing object corresponding to the functional module corresponding to each target code file is determined according to the object mapping table, and the statistical information of each functional module in the target statistical list is sent to the corresponding processing object.
3. The method according to claim 1, characterized in that: The target warning item is associated with a corresponding risk level; the method further includes: Sort the target warning items corresponding to each functional module from high to low according to the risk level to obtain a warning item risk sequence for each functional module; Generating a warning repair strategy according to the warning item risk sequence of each functional module, wherein the warning repair strategy indicates a repair order for the target warning item; The warning repair strategy corresponding to each functional module is sent to the corresponding processing object.
4. The method according to claim 1, characterized in that: The warning association information of the K dimensions includes one or more of the following: the type of warning item, the address information of the target code file where the warning item is located, the functional module to which the target code file where the warning item is located belongs, the location information of the warning item in the target code file, and the description information of the warning item.
5. A data processing device, characterized in that: The device is used to implement the method according to any one of claims 1 to 4, and the device comprises: An acquisition unit, used for acquiring a target code file of a target project under a target version, each target code file corresponds to each functional module, and each functional module is associated with a corresponding processing object; A processing unit, configured to parse the target warning item corresponding to each target code file according to the target code file, wherein the target warning item corresponds to warning association information of K dimensions; K is a positive integer; The acquisition unit is further used to acquire a historical code file of the target project under a historical version, and extract historical warning items from the historical code file, wherein the historical warning items correspond to warning association information of K dimensions; The processing unit is further used to generate a target statistical list according to the warning association information of K dimensions corresponding to the target warning item and the warning association information of K dimensions corresponding to the historical warning item; the target statistical list includes statistical information for each functional module; The sending unit is used to send the statistical information of each functional module in the target statistical list to the corresponding processing object according to the processing object corresponding to the functional module corresponding to each target code file.
6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 4.
