Code log-based data processing method and device, equipment and storage medium
By acquiring and deleting log information from code files, the problem of low data read/write efficiency caused by excessive log information during code execution is solved, thus improving the efficiency of log information processing.
Patent Information
- Application Number
- CN202511210688.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-12-19
AI Technical Summary
The large amount of log information generated during code execution leads to decreased data read/write efficiency and impacts system performance.
By obtaining log information from a set of code files, determining the total amount of data, deleting some preset log codes, and generating a new set of code files, the amount of log information is reduced, and data read and write efficiency is improved.
The amount of log information was reduced, data read and write efficiency was improved, and system performance was optimized.
Smart Images

Figure CN121166519A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a data processing method, apparatus, device and storage medium based on code logs. Background Technology
[0002] When an exception occurs during code execution, developers locate the problem by analyzing the code's log information.
[0003] During code execution, log information is generated by adding logging code within the code. The amount of log information output by the code is enormous. Data processing of this massive amount of log information (such as storing, retrieving, and displaying log information) involves frequent data read and write operations. When the amount of log information reaches a certain level, the data read and write efficiency decreases.
[0004] Therefore, improving the processing efficiency of code log information has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a data processing method, apparatus, device, and storage medium based on code logs to solve the technical problem of low processing efficiency of code log information.
[0006] Firstly, this application provides a data processing method based on code logs, including:
[0007] A set of code files is obtained, and the log information output by each code file in the set of code files is obtained; wherein, multiple preset log codes are inserted into the code files, and the preset log codes are used to output log information; the log information represents the running status of the code files;
[0008] Determine the total amount of log information in all code files. If the total amount of data meets a preset condition, delete at least one preset log code from at least one code file to obtain a new set of code files.
[0009] Obtain the new log information output by each code file in the new set of code files.
[0010] Secondly, this application provides a data processing apparatus based on code logs, comprising:
[0011] The first acquisition module is used to acquire a set of code files and to acquire the log information output by each code file in the set of code files; wherein, multiple preset log codes are inserted into the code files, and the preset log codes are used to output log information; the log information represents the running status of the code files;
[0012] The deletion module is used to determine the total amount of log information in all code files. If the total amount of data meets a preset condition, at least one preset log code is deleted from at least one code file to obtain a new set of code files.
[0013] The second acquisition module is used to acquire the new log information output by each code file in the new code file set.
[0014] Thirdly, this application provides a data processing device based on code logs, including: a processor, and a memory communicatively connected to the processor;
[0015] The memory stores computer-executed instructions;
[0016] The processor executes computer execution instructions stored in the memory to implement the first aspect and / or possible implementations of the first aspect.
[0017] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or possible embodiments of the first aspect.
[0018] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or possible implementations of the first aspect.
[0019] The data processing method, apparatus, device, and storage medium based on code logs provided in this application acquire a set of code files and the log information output by each code file in the set. Multiple preset log codes are inserted into each code file to output log information. The log information represents the execution status of the code files. Log information output by all code files in the set can be obtained for subsequent data analysis, thereby controlling the number of log messages output by all code files in the set. By determining the total amount of log information in all code files, if the total amount meets a preset condition, at least one preset log code is deleted from at least one code file, resulting in a new set of code files. Based on the total amount of log information in all code files, the number of preset log codes inserted in all code files in the set can be reduced, thus reducing the number of log messages output by all code files in the set. By acquiring the new log information output by each code file in the new set, multiple log messages with reduced log message counts can be obtained, thereby reducing the amount of log messages that need to be read and written, and improving the data read / write efficiency of log information. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 A flowchart illustrating the data processing method based on code logs provided in this application embodiment. Figure 1 ;
[0022] Figure 2 A flowchart illustrating the data processing method based on code logs provided in this application embodiment. Figure 2 ;
[0023] Figure 3 A flowchart illustrating the insertion of preset log code into a preset code block, provided in this application embodiment. Figure 1 ;
[0024] Figure 4 A flowchart illustrating the insertion of preset log code into a preset code block, provided in this application embodiment. Figure 2 ;
[0025] Figure 5 A flowchart illustrating the data processing method based on code logs provided in this application embodiment. Figure 3 ;
[0026] Figure 6 A schematic diagram of the structure of the data processing device based on code logs provided in the embodiments of this application;
[0027] Figure 7 This is a schematic diagram of the structure of a data processing device based on code logs provided in an embodiment of this application.
[0028] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0030] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.
[0031] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0032] It should be noted that the data processing method, apparatus, device and storage medium based on code logs provided in this application can be used in the field of big data technology, or in any technical field other than big data technology. The application field of the data processing method, apparatus, device and storage medium based on code logs in this application is not limited.
[0033] The specific application scenarios of this application include the output of large amounts of code log information by software platforms such as finance, e-commerce, and social networking. The application involves data processing of the log information output by the software platform (such as storing, reading, and displaying the log information) in order to locate problems in the operation of the software platform.
[0034] Trading platforms process millions of orders daily, with each decision requiring microsecond-level processing. They log crucial information such as order status, risk verification, and market data responses, resulting in a massive daily log volume exceeding trillions of bytes. Excessive log volume can significantly reduce disk read / write speeds, impacting the trading platform's operational efficiency.
[0035] Meanwhile, developers need to insert multiple logging codes into the code files corresponding to the bank's trading platform to output log information of the platform's operation at the corresponding insertion locations. The log formats output by the logging codes inserted by different developers are usually inconsistent, making the process of inserting logging codes cumbersome and prone to inserting incorrect logging codes, which affects the development efficiency of the bank's trading platform and the quality of log information.
[0036] The data processing method, apparatus, device, and storage medium based on code logs provided in this application are intended to solve the above-mentioned technical problems of the prior art.
[0037] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0038] Figure 1 A flowchart illustrating the data processing method based on code logs provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the method includes:
[0039] S101. Obtain a set of code files and obtain the log information output by each code file in the set of code files; wherein, multiple preset log codes are inserted into the code files, and the preset log codes are used to output log information; the log information represents the running status of the code files.
[0040] The executing entity of this application can be a code management server, which can deploy and run code files and record log information of the code file execution. For example, the storage unit of the code management server deploys a collection of code files, the caching unit caches the log information output by each code file in the collection, and the display unit displays the log information output by each code file in the collection in real time. The code management server retrieves the collection of code files from the storage unit and the log information output by each code file in the collection from the caching unit. Multiple preset log codes are inserted into the code files; these preset log codes are used to output log information; the log information characterizes the execution status of the code files.
[0041] A collection of code files can be a collection of code files for a software project, such as a trading platform software project. If the trading platform software project is developed using Java (a widely used object-oriented programming language), then the collection of code files includes multiple Java files. When run, these code files can be used for online trading, implementing the functionality of online trading.
[0042] Preset logging code can be code that outputs runtime information for a code file. When the code file is run, executing the preset logging code within it will output log information during the code file's execution. For example, preset logging code could be output code written in Java; executing this output code will output log information during the code file's execution. The log information characterizes the code file's execution status. Log information can be output as strings, including parameter information used during the code file's execution, and the results of parameter data processing, etc.
[0043] The log information output by each code file in the acquired code file set can include multiple log messages. For example, it is possible to retrieve multiple log messages output by each code file in the code file set within a preset time period. For instance, it is possible to retrieve all log messages output by each code file in the code file set within two minutes.
[0044] Preset log codes can be inserted in multiple locations within a code file. For example, if the code file collection includes multiple Java files, and if each Java file contains code blocks defining methods and code blocks defining variables, the preset log code can be inserted before or after the code blocks defining methods, or before or after the code blocks defining variables.
[0045] The code file set obtained in this step can be used to modify the code content of any code file in the code file set. The log information output by each code file in the code file set can be used to perform data analysis on the log information output by all code files in the code file set, thereby controlling the number of log information outputs.
[0046] S102. Determine the total amount of log information in all code files. If the total amount of data meets the preset conditions, delete at least one preset log code from at least one code file to obtain a new set of code files.
[0047] For example, after obtaining the log information of all code files, the total amount of log information of all code files can be counted, and it can be determined whether the total amount of data meets the preset conditions. If the total amount of data meets the preset conditions, at least one preset log code can be deleted from at least one code file to obtain a new set of code files.
[0048] If the log information is output as strings, the total data volume can be the total number of characters in all retrieved log information, such as the sum of the string lengths of all log information. The total data volume can be compared with a preset threshold to determine whether it meets a preset condition, thereby determining whether to delete at least one preset log code from at least one code file. For example, if the total data volume is greater than the preset threshold, at least one preset log code is deleted from at least one code file, resulting in a new set of code files; if the total data volume is less than or equal to the preset threshold, there is no need to delete at least one preset log code from at least one code file, and the code file set remains unchanged. The preset threshold can be determined based on the disk input / output rate of the code management server.
[0049] For example, if you want to obtain all the log information output by each code file in the code file set within two minutes, and if the disk input / output rate of the code management server is 100 megabits per second when the code management server is not running code files, then the maximum total amount of data that the code management server can process within two minutes is equal to 12,000 megabits, so you can set the preset quantity threshold to 12,000 megabits.
[0050] The total data volume can also be the total number of bytes of all the log information obtained. The output rate of the log information can be determined based on the total data volume and the time when all the log information was obtained. The total data volume can be determined to meet the preset conditions by judging the speed of the log information output rate.
[0051] For example, one could retrieve all log information output by each code file in a set of code files within a 60-second period, save all log information to a temporarily created file, call the programming language's interface to obtain the file size in bytes, using the temporarily created file as the interface parameter, and receive the file size in bytes as the total data volume. The log output rate per second is determined based on the ratio of the total data volume to the 60-second period. If the rate per second deviates significantly from the standard disk data processing rate (the standard value specified at the factory) of the device or apparatus running the set of code files—for example, if the rate per second is less than the standard disk data processing rate and the deviation is greater than 50% of the standard disk data processing rate—then the total data volume meets the preset condition; otherwise, the preset condition is not met.
[0052] If the total amount of data meets the preset conditions, the preset number of preset log codes to be deleted can be removed from at least one code file, or from multiple code files. The preset number can be a pre-set total; for example, if the preset number of preset log codes to be deleted is 10, then the preset total is 10.
[0053] In this step, by determining the total amount of log information in all code files, it is determined whether the total amount of data meets the preset conditions. If the preset conditions are met, at least one preset log code is deleted from at least one code file. When the total amount of log information is too large, a new set of code files can be obtained by deleting preset log codes, thereby reducing the total amount of output log information when running the new set of code files, and thus improving the data processing efficiency of log information.
[0054] S103. Obtain the new log information output by each code file in the new set of code files.
[0055] For example, after obtaining a new set of code files, the new log information output by each code file in the new set of code files can be obtained in real time or at regular intervals.
[0056] For example, after obtaining a new set of code files, the new set of code files can be rerun. Based on the log information output during the running of the new set of code files, new log information output by each code file in the new set can be obtained. Compared to the log information output by each code file in the code file set obtained by running the code file set, since at least one preset log code has been deleted from at least some of the code files in the code file set, the new set of code files reduces the log information output by the deleted preset log code. Therefore, the total amount of new log information is less in the same amount of time.
[0057] The code log-based data processing method provided in this application obtains a set of code files and the log information output by each code file in the set. Multiple preset log codes are inserted into each code file to output log information. The log information represents the execution status of the code file. The method obtains the log information output by all code files in the set, which is then used for subsequent data analysis to control the number of log messages output by all code files in the set. By determining the total amount of log information in all code files, if the total amount meets a preset condition, at least one preset log code is deleted from at least one code file, resulting in a new set of code files. Based on the total amount of log information in all code files, the number of preset log codes inserted into all code files in the set can be reduced, thereby reducing the number of log messages output by all code files in the set. By obtaining the new log information output by each code file in the new set of code files, multiple log messages with reduced numbers can be obtained, thus reducing the amount of log information that needs to be read and written, and improving the data read / write efficiency of log information.
[0058] In one specific embodiment, the code file includes multiple preset code blocks, which are used to implement preset functions. At least one preset code block in the code file contains preset log code, and at most one preset log code is inserted into each preset code block.
[0059] In step S102 above, at least one preset log code is deleted from at least one code file to obtain a new set of code files, including:
[0060] First, identify at least one code file from the set of code files as the target file.
[0061] Second, the target block is determined from multiple preset code blocks in the target file; among them, a preset log code is inserted into the target block.
[0062] Third, delete the preset log code in the target block to obtain a new set of code files.
[0063] Figure 2 A flowchart illustrating the data processing method based on code logs provided in this application embodiment. Figure 2 In this embodiment Figure 1 Based on the embodiments, S102 will be further explained, such as... Figure 2 As shown, the above method includes:
[0064] S201. Obtain a set of code files and obtain the log information output by each code file in the set of code files; wherein, multiple preset log codes are inserted into the code files, and the preset log codes are used to output log information; the log information represents the running status of the code files.
[0065] The execution process of S201 is the same as that of S101, and will not be described again here.
[0066] S202. Determine the total amount of log information in all code files. The code file includes multiple preset code blocks. The preset code blocks are used to implement preset functions. At least one preset code block in the code file contains a preset log code. At most one preset log code is inserted in a preset code block.
[0067] For example, after obtaining the total amount of log information from all code files, the total amount of log information from all code files can be determined. The execution process for determining the total amount of log information from all code files is the same as the execution process for determining the total amount of log information from all code files in S102, and will not be repeated here. The code files include multiple preset code blocks, which are used to implement preset functions. At least one preset code block in the code file contains preset log code, and each preset code block contains at most one preset log code.
[0068] For each code file, it can include at least one predefined code block. For example, if the code file is a Java file, the predefined code block can be a code block that defines a method. The code block that defines a method starts with "{" and ends with "}". Each predefined code block is used to implement a predefined function. For example, if the predefined code block is a code block that defines a method, it can implement the following function: take an addend parameter and an augend parameter as input, and return the sum of the addend parameter and the augend parameter.
[0069] This code file contains at least one pre-defined code block with pre-defined log code inserted within it, and each pre-defined code block can contain at most one pre-defined log code. For example, if the code file is a Java file, and if it contains a code block defining a method, with "{" as the method start symbol and "}" as the method end symbol, and if this code block contains a pre-defined log code that outputs the method's input parameters and return value, then the following code can be added: the start code is used to output the method's input parameters, and the following code is added before the method end symbol "}" to output the method's return value. The start and end codes together constitute this pre-defined log code.
[0070] S203. Determine at least one code file from the set of code files as the target file.
[0071] For example, at least one piece of code within a preset order range can be determined from the code file set as the target file based on a preset order of at least one code file in the code file set.
[0072] For example, based on the function implemented by each code file, at least one code file in the code file set can be sorted from most important to least important, resulting in a sorted list of at least one code file. One or more code files can then be selected as target files from this sorted list, in ascending order of functional importance.
[0073] In this step, the target file determined from the code file set can be used as the code file for deleting the preset log code in the future. This is used to initially determine the code file corresponding to the preset log code to be deleted, so as to further determine the position of the preset log code in the code file.
[0074] S204. Determine the target block from multiple preset code blocks in the target file; wherein a preset log code is inserted into the target block.
[0075] For example, after determining the target file, the target block can be selected from multiple preset code blocks within the target file. A preset log code is inserted into the target block.
[0076] For example, if the target file includes multiple code files, and each code file contains at least one preset code block with preset log code inserted, then the target file includes multiple preset code blocks with preset log code inserted. One or more preset code blocks can be randomly selected from these multiple preset code blocks as the target block. The target block can be at least one preset code block in one code file, or it can be multiple preset code blocks in multiple code files.
[0077] In this step, a target block is selected from multiple preset code blocks in the target file. This target block contains a preset log code. The position of the preset log code to be deleted within the code file is further determined within the target block, thus pinpointing its insertion location. This ensures the accurate identification and subsequent removal of the preset log code from the code file.
[0078] S205. Delete the preset log code in the target block to obtain a new set of code files.
[0079] For example, once a target block is identified, the preset log code in the target block can be deleted to obtain a new set of code files.
[0080] For example, if the target block includes a code block defining a method in a Java code file, and this code block has a start code appended after the method start symbol "{" to output the method's input parameters, and a stop code appended before the method end symbol "}" to output the method's return value, and these two codes together form the default log code, then deleting the start and stop codes will result in a new code block. The code file containing the new code block is the new code file. The collection of code files containing the new code file is the new collection of code files.
[0081] In this step, by deleting the preset log code in the target block, the log information output by the deleted preset log code can be reduced, thereby reducing the log information output by the code file set.
[0082] S206. Obtain the new log information output by each code file in the new set of code files.
[0083] The execution process of S206 is the same as that of S103, and will not be described again here.
[0084] In this embodiment, by identifying at least one code file as the target file from the code file set, the code file corresponding to the preset log code to be deleted is initially determined. From multiple preset code blocks in the target file, the target block is determined, further identifying the preset code block into which the preset log code to be deleted is inserted. Deleting the preset log code in the target block reduces the log information output by the deleted preset log code, thereby reducing the log information output by the code file set and improving the data processing efficiency of the log information.
[0085] In one specific embodiment, the above method further includes:
[0086] First, in response to the user's selection instruction for tag information, the file to be inserted is determined from each code file based on the tag information corresponding to each code file; wherein, the tag information represents the code file.
[0087] Second, at least one preset code block is selected from multiple preset code blocks in the file to be inserted as a candidate block.
[0088] Third, for each candidate block identified, insert a preset log code into the candidate block.
[0089] Figure 3 A flowchart illustrating the insertion of preset log code into a preset code block, provided in this application embodiment. Figure 1 In this embodiment Figure 2 Based on the embodiments, the execution steps for inserting preset log code into preset code blocks are further explained, such as... Figure 3 As shown, the process of inserting preset log code into a preset code block includes:
[0090] S301. In response to the user's selection instruction for the tag information, determine the file to be inserted from each code file based on the tag information corresponding to each code file; wherein, the tag information represents the code file.
[0091] For example, before running the collection of code files, the code management server can provide an interface to receive user selection instructions for tag information. If the user selection instructions for tag information are received, the server can determine the file to be inserted from each code file based on the tag information corresponding to each code file; wherein, the tag information represents the code file.
[0092] The tagging information includes at least one of first tagging information, second tagging information, and third tagging information. The first tagging information represents a code file that receives a client request and returns response data; the second tagging information represents a code file that processes preset business data; and the third tagging information represents a code file with preset reference parameters. The preset business can be a requirement business implemented by the code file, and the preset reference parameters can be parameters referenced by other code files, excluding code files with preset reference parameters. Tag information may also include other types of tag information; this application does not limit this. The three types of tag information provided in this application embodiment are only for illustrative purposes.
[0093] For example, if the collection of code files is a collection of Java code files, each Java code file can be tagged using annotations. If a Java code file is used to receive client requests and return response data, the annotation "@Controller" can be added to that Java code file; "@Controller" corresponds to the first tag. If a Java code file is used to process predefined business data, the annotation "@Servicer" can be added to that Java code file; "@Servicer" corresponds to the second tag. If a Java code file is used to define predefined reference parameters, the annotation "@Reference" can be added to that Java code file; "@Reference" is the third tag.
[0094] By using tag information, multiple code files in a code file collection can be classified according to the functions they perform. This allows for setting an option for at least one code file with the same tag information, enabling batch management of at least one code file with the same tag information, thereby improving data processing efficiency.
[0095] Checkboxes can be provided on the code management server's display interface for each of the three types of tag information. If a user checks a tag, it means that preset log code can be inserted into the code file containing the selected tag. If the user dechecks a tag, it means that the preset log code will not be inserted into the code file containing the corresponding tag, or the inserted preset log code will be deleted. The checkboxes are selected by default. After the user has selected all three types of tag information, they can send a selection command by clicking the command button provided by the code management server.
[0096] Each code file in the code file set can possess any one of the three types of tag information mentioned above; that is, each type of tag information corresponds to at least one code file. Therefore, the file to be inserted can be determined from among the code files based on the tag information corresponding to each code file. For example, it can be determined that all code files corresponding to one or more of the tag information are the files to be inserted. Specifically, for a set of Java code files, it can be determined that at least one code file with the annotation "@Controller" is the file to be inserted, at least one code file with the annotation "@Servicer" is the file to be inserted, a code file that references the reference parameter in a code file with the annotation "@Reference" is the file to be inserted, or any two or all three annotations can be used as the code files to be inserted.
[0097] In this step, by receiving the user's selection instruction for the tag information, the file to be inserted can be determined from each code file based on the tag information corresponding to each code file, realizing batch operation on code files, determining multiple files to be inserted at once, and the determined files to be inserted can be used to insert preset log code later, thereby improving the processing efficiency of the code file set.
[0098] S302. Determine at least one preset code block from the multiple preset code blocks of the file to be inserted as a candidate block.
[0099] For example, after determining the file to be inserted, at least one preset code block can be selected from multiple preset code blocks in the file to be inserted, as a candidate block. The candidate block is the preset code block where the user inserts preset log code.
[0100] Each code file to be inserted corresponds to at least one predefined code block. These predefined code blocks can be further obtained through sub-tag matching or method matching. For sub-tag matching, for example, if one of the code files to be inserted is a Java file, and if this file contains multiple predefined code blocks defining methods, a method tag can be set for each predefined code block to identify the multiple predefined code blocks corresponding to the code file. For instance, if the code file is annotated with "@Controller", the corresponding predefined code block is the predefined code block annotated with "@RequestMapping", where "@RequestMapping" is a method tag and represents a predefined code block that performs a network request.
[0101] For method-based matching, if the code file is annotated with "@Servicer", code blocks are found by matching the method start symbol "{" and the method end symbol "}". These found code blocks are identified as at least one predefined code block corresponding to this code file. If the code file is annotated with "@Reference", the reference parameters defined in the code file can be traversed. For any reference parameter, at least one code block referencing the reference parameter is identified by matching the parameter name of the reference parameter in other code files in the code file set. All code blocks corresponding to all reference parameters are identified as at least one predefined code block corresponding to this code file.
[0102] You can randomly select at least one preset code block from one code file in the file to be inserted as a candidate block, or you can randomly select multiple preset code blocks from multiple code files in the file to be inserted as candidate blocks.
[0103] Alternatively, based on the requirements of the software project, it can be determined whether preset code blocks need to be inserted with preset log code, thereby outputting log information and identifying the code blocks that need to be inserted with preset log code as candidate blocks. An interface could be provided that allows users to specify at least one preset code block from at least one code file in the file to be inserted as a candidate block, based on the requirements of the software project. This interface would provide the user with at least one preset code block from at least one code file in the file to be inserted and offer selection functionality for the preset code block.
[0104] In this step, at least one preset code block is selected as a candidate block from multiple preset code blocks in the file to be inserted, and one or more preset code blocks for inserting preset log code are further determined, so that the preset log code can be inserted into the preset code blocks in the code file in the future.
[0105] S303. For each candidate block identified, insert a preset log code into the candidate block.
[0106] For example, after the candidate blocks are determined, a preset log code is inserted into each candidate block.
[0107] In some specific implementations, a preset log code is inserted at a preset position in the candidate block; the log information output by the preset log code includes at least one of the following:
[0108] The tagging information of the code file to which the candidate block belongs, the input parameters of the candidate block, the output parameters of the candidate block, and the intermediate processing parameters of the candidate block.
[0109] For example, for each candidate block, if it's a code block defining a method in a Java code file, a start code can be added after the method's start symbol "{". This start code outputs the method's input parameters and the code block's marker information. An end code can be added before the method's end symbol "}". This end code outputs the method's return value. Intermediate code is added in the middle of the candidate block's method. This intermediate code outputs the method's intermediate processing parameters. The start code, intermediate code, and end code together constitute the preset logging code inserted into the candidate block. The log information output by the inserted preset logging code includes: the candidate block's code file marker information, such as Controller / Servicer / Reference, the candidate block's input parameters, output parameters, and intermediate processing parameters. The candidate block's code file marker information can be used by developers to locate code positions when analyzing problems, while the candidate block's input parameters, output parameters, and intermediate processing parameters can be used by developers to pinpoint the cause of problems.
[0110] It should be noted that for any non-candidate block in the code file set, if a preset log code is inserted into the non-candidate block, the preset log code inserted into the non-candidate block will be deleted.
[0111] In this step, preset log code is inserted into each of the identified candidate blocks to achieve precise insertion of preset log code, which is used to obtain the runtime information of the code file.
[0112] In this embodiment, by receiving a user's selection instruction for marker information, and based on the marker information corresponding to each code file, the file to be inserted is determined from the code files. This allows for batch operations on code files, determining multiple files to be inserted at once based on the marker information corresponding to each code file. By determining at least one preset code block as a candidate block from multiple preset code blocks in the file to be inserted, and inserting preset log code into each candidate block, preset log code is automatically inserted into the code files. This reduces the workload of developers. Furthermore, since the inserted preset code logs can be uniformly formatted, the log information output from the set of running code files is consistent, thereby reducing the impact of errors caused by developers manually entering log code and improving the efficiency of developers in locating problems.
[0113] In one specific implementation, the above method further includes:
[0114] First, determine the block to be inserted from at least one candidate block.
[0115] Second, for each block to be inserted, insert the preset log code into the block.
[0116] Figure 4 A flowchart illustrating the insertion of preset log code into a preset code block, provided in this application embodiment. Figure 2 In this embodiment Figure 2 and Figure 3 Based on the embodiments, the execution steps for inserting preset log code into preset code blocks are further explained, such as... Figure 4 As shown, the process of inserting preset log code into a preset code block includes:
[0117] S401. In response to the user's selection instruction for the tag information, determine the file to be inserted from each code file based on the tag information corresponding to each code file; wherein, the tag information represents the code file.
[0118] The execution process of S401 is the same as that of S301, and will not be described again here.
[0119] S402. Determine at least one preset code block from the multiple preset code blocks of the file to be inserted as a candidate block.
[0120] The execution process of S402 is the same as that of S302, and will not be described again here.
[0121] S403. Determine the block to be inserted from at least one candidate block.
[0122] For example, after identifying at least one candidate block, the block to be inserted can be determined from the at least one candidate block. The block to be inserted represents a code block into which preset log code needs to be inserted.
[0123] For example, after identifying at least one candidate block, a configuration file can be generated based on that candidate block. The configuration file includes multiple checkboxes, each corresponding to a candidate block. If a checkbox is selected, the corresponding candidate block is determined to be the block to be inserted; if the checkbox is not selected, the corresponding candidate block is determined not to be the block to be inserted. Checkboxes are selected by default.
[0124] In this step, the block to be inserted is determined from at least one candidate block for subsequent insertion of preset log code. Based on the candidate blocks, the insertion position of the preset code can be further flexibly controlled.
[0125] S404. For each block to be inserted, insert a preset log code into the block.
[0126] The process of inserting preset log code into the block to be inserted is the same as the process of inserting preset log code into the candidate block, and will not be described again here.
[0127] It should be noted that for any non-insertion block in any code file in the code file set, if a preset log code is inserted into that non-insertion block, then the preset log code inserted into that non-insertion block will be deleted.
[0128] In this embodiment of the application, based on the determination of candidate blocks, a block to be inserted is further determined from at least one candidate block, and a preset log code is inserted into each block to be inserted. This allows for more flexible control over the insertion position of the preset code, enabling fine-grained management of preset code blocks in the code file set, thereby fine-grained control over the addition and deletion of preset log code in the code blocks.
[0129] In one specific embodiment, S204 above includes the following sub-steps:
[0130] First, obtain the priority of each tag information; priority represents the importance of the tag information, and the tag information represents the code file.
[0131] Second, based on the priority of each marker information and the arrangement order of the preset code blocks in the code file, sort all the preset code blocks in all code files to obtain the sorting result.
[0132] Third, the preset code blocks that fall within the preset sorting range in the sorting results are identified as target blocks.
[0133] Figure 5 A flowchart illustrating the data processing method based on code logs provided in this application embodiment. Figure 3 In this embodiment Figure 2 Based on the embodiments, S204 above will be further explained, such as... Figure 5 As shown, the above method includes:
[0134] S501, obtain a set of code files and obtain the log information output by each code file in the set of code files; wherein, multiple preset log codes are inserted into the code files, and the preset log codes are used to output log information; the log information represents the running status of the code files.
[0135] The execution process of S501 is the same as that of S201, and will not be described again here.
[0136] S502. Determine the total amount of log information in all code files. The code file includes multiple preset code blocks. The preset code blocks are used to implement preset functions. At least one preset code block in the code file contains a preset log code. At most one preset log code is inserted in a preset code block.
[0137] The execution process of S502 is the same as that of S202, and will not be described again here.
[0138] S503. Determine at least one code file from the set of code files as the target file.
[0139] The execution process of S503 is the same as that of S203, and will not be described again here.
[0140] S504. Obtain the priority of each tag information; the priority represents the importance of the tag information, and the tag information represents the code file.
[0141] For example, after determining the target file, the priority of each tag information can be obtained. The priority represents the importance of the tag information, and the tag information represents the code file. The explanation of the tag information is as described in S301, and will not be repeated here.
[0142] For example, the priority of each tag information stored in the code management server's storage unit can be obtained. The priority of each tag information stored in the storage unit could be input by the user through an input box provided by the code management server before running the code file set. For instance, before running the code file set, when the code management server receives the user's selection instruction for tag information through an interface, it provides an input box for the user to input the weight of the tag information; the higher the weight, the more important the corresponding tag information. After the user inputs the weight of the tag information, the code management server saves the weight of the user-input tag information in the storage unit.
[0143] For example, if the code file collection is a collection of Java code files, the tagging information includes the first tagging information represented by the annotation "@Controller", the second tagging information represented by the annotation "@Servicer", and the third tagging information represented by the annotation "@Reference". Since the function of receiving client requests and returning response data has the greatest impact, followed by the function of processing preset business data, and the function of referencing preset reference parameters implemented by preset code blocks has the least impact, the weight of the first tagging information represented by the annotation "@Controller" can be set to be greater than the weight of the second tagging information represented by the annotation "@Servicer", and the weight of the second tagging information represented by the annotation "@Servicer" can be greater than the weight of the third tagging information represented by the annotation "@Reference". In other words, the priority of the first tagging information represented by the annotation "@Controller" is higher than the priority of the second tagging information represented by the annotation "@Servicer", and the priority of the second tagging information represented by the annotation "@Servicer" is higher than the priority of the third tagging information represented by the annotation "@Reference". If the user does not input the priority of each tag, the default priority order can be that the first tag represented by the annotation "@Controller" has a higher priority than the second tag represented by the annotation "@Servicer", and the second tag represented by the annotation "@Servicer" has a higher priority than the third tag represented by the annotation "@Reference".
[0144] The priority of each tag can also be determined based on the total number of code files corresponding to that tag. For example, the total number of code files corresponding to each tag can be counted; the larger the total number of code files corresponding to a tag, the higher the priority of that tag, and vice versa.
[0145] In this step, the priority of each marker information obtained can be used to sort the preset code blocks in the future, thereby deleting the preset log code inserted in the preset code blocks with lower priority.
[0146] S505. Sort all preset code blocks in all code files according to the priority of each marker information and the arrangement order of preset code blocks in the code file to obtain the sorting result.
[0147] For example, at least one preset code block in each code file can be initially sorted according to the priority of each tag information; based on the initial sorting, at least one preset code block in each code file can be sorted a second time according to the order of the preset code blocks in the code file, thereby sorting all preset code blocks in all code files and obtaining the sorting result.
[0148] For example, if the code file collection is a collection of Java code files, the tagging information includes the first tagging information represented by the annotation "@Controller", the second tagging information represented by the annotation "@Servicer", and the third tagging information represented by the annotation "@Reference". The first tagging information represented by the annotation "@Controller" has a higher priority than the second tagging information represented by the annotation "@Servicer", and the second tagging information represented by the annotation "@Servicer" has a higher priority than the third tagging information represented by the annotation "@Reference".
[0149] The priority of at least one predefined code block in at least one code file annotated with "@Controller" is determined to be higher than that in at least one code file annotated with "@Servicer". Similarly, the priority of at least one code file annotated with "@Servicer" is higher than that in at least one code file annotated with "@Reference". For each tag information corresponding to at least one code file and at least one predefined code block, the earlier the creation time of the corresponding code file, the higher the priority of that predefined code block.
[0150] For each preset code block in at least one preset code block corresponding to each code file, the arrangement order of the preset code blocks is determined according to their arrangement order in the code file, such as the order in which the preset code blocks are written in the code file. Specifically, the earlier the preset code block is written in the code file, the earlier its arrangement order is.
[0151] In this step, all preset code blocks in all code files are sorted according to the priority of each marker and the order of the preset code blocks in the code files, resulting in a sorting result. This sorting result can then be used to determine the target blocks of the preset log code that need to be deleted.
[0152] S506. Determine the preset code block within the preset sorting range in the sorting results as the target block. The target block contains a preset log code.
[0153] For example, after obtaining the sorting results, a preset code block within a preset sorting range can be identified as the target block. The target block contains a preset log code. The preset sorting range can be determined based on the number of preset log codes to be deleted each time.
[0154] For example, if each time 10 preset log codes are deleted, that is, each time the log information output by 10 preset log codes is reduced, then the preset sorting range can be determined as the last 10 preset code blocks as the target blocks.
[0155] In this step, by identifying the preset code blocks within the preset sorting range in the sorting results as target blocks, the lower-ranked preset code blocks can be identified from multiple preset code blocks as target code blocks. The identified target code blocks are used for subsequent deletion of preset log code, which achieves the goal of deleting some preset log code while ensuring that the log information output by the deleted preset log code is of low importance, thereby reducing the impact of deleting log code.
[0156] S507. Delete the preset log code in the target block to obtain a new set of code files.
[0157] The execution process of S507 is the same as that of S205, and will not be described again here.
[0158] S508. Obtain the new log information output by each code file in the new set of code files.
[0159] The execution process of S508 is the same as that of S206, and will not be described again here.
[0160] In this embodiment, the priority of each marker information is obtained, and this priority is used to sort the preset code blocks subsequently. Based on the priority of each marker information and the order of the preset code blocks in the code files, all preset code blocks in all code files are sorted. The sorting result is used to determine the target blocks of the preset log code to be deleted. Preset code blocks within a preset sorting range in the sorting result are identified as target blocks. This allows for the selection of lower-ranked preset code blocks from multiple preset code blocks as target blocks. The identified target blocks are used for subsequent deletion of preset log code, ensuring that the log information output by the deleted preset log code is of low importance while deleting some preset log code, thus reducing the impact of deleting log code.
[0161] In some embodiments of this application, the above method further includes:
[0162] First, based on the preset file reading cycle, obtain the required reading time for the preset file; the preset file represents a file with preset content other than code files.
[0163] For example, during the execution of the code file set, the required reading time for a preset file can be obtained according to a preset file reading cycle; the preset file represents a file with preset content other than the code file. The preset file reading cycle is a pre-set cycle for reading the preset file, the preset file includes a randomly generated string, and the preset file has a fixed size, such as 1024 megabytes. The electronic device or apparatus running the code file set can read this preset file.
[0164] For example, when running a set of code files, a preset file can be read from the disk of an electronic device or apparatus every 10 minutes, and the length of the preset file read is recorded as the length of time required to read the preset file.
[0165] In this step, the required reading time for the preset file can be used to determine whether the preset log code needs to be deleted.
[0166] Second, if the reading time exceeds the preset time threshold, at least one preset log code is deleted from at least one code file to obtain a new set of code files.
[0167] For example, after obtaining the read time length, it can be compared with a preset time threshold. If the read time length is greater than the preset time threshold, at least one preset log code is deleted from at least one code file, resulting in a new set of code files. The preset time threshold can be determined based on the read time length of preset files when the set of code files is not executed. If the read time length is less than or equal to the preset time threshold, there is no need to delete the preset log code.
[0168] For example, when the electronic device or apparatus running the code file set is not running the code file set, it can read a preset file and record the time required to read the preset file once as a preset time threshold. If the reading time is longer than the preset time threshold, it indicates that the data read / write efficiency of the electronic device or apparatus is reduced. Therefore, at least one preset log code in at least one code file can be deleted to obtain a new code file set. The process of deleting preset log codes is as described above in S102 regarding "deleting at least one preset log code from at least one code file to obtain a new code file set", and will not be repeated here.
[0169] In this step, by determining whether the reading time of the preset file is greater than the preset time threshold, if the reading time is greater than the preset time threshold, it indicates that the data read and write efficiency of the electronic device or apparatus running the code file set has decreased. Deleting at least one preset log code from at least one code file can reduce the amount of log information output, thereby improving the read and write efficiency of the electronic device or apparatus for log information data, and thus ensuring the running stability of the code file set.
[0170] In these implementations, the required reading time for a preset file is obtained, and this required reading time is used to determine whether preset log code needs to be deleted. If the required reading time exceeds a preset time threshold, at least one preset log code is deleted from at least one code file, resulting in a new set of code files. This allows for timely reduction of the amount of log information output when the data read / write efficiency of the electronic device or apparatus running the code file set decreases, thereby improving the read / write efficiency of the electronic device or apparatus for log information data and ensuring the operational stability of the code file set.
[0171] Figure 6 A schematic diagram of the structure of the data processing device based on code logs provided in the embodiments of this application is shown below. Figure 6 As shown, the data processing device 60 based on code logs provided in this embodiment includes:
[0172] The first acquisition module 601 is used to acquire a set of code files and to acquire the log information output by each code file in the set of code files; wherein, multiple preset log codes are inserted into the code files, and the preset log codes are used to output log information; the log information represents the running status of the code files;
[0173] The deletion module 602 is used to determine the total amount of log information in all code files. If the total amount of data meets the preset conditions, at least one preset log code is deleted from at least one code file to obtain a new set of code files.
[0174] The second acquisition module 603 is used to acquire the new log information output by each code file in the new code file set.
[0175] In one possible implementation, the code file includes multiple preset code blocks, which are used to implement preset functions. At least one preset code block in the code file contains preset log code, and each preset code block contains at most one preset log code. The deletion module 602 is further configured to:
[0176] Identify at least one code file from the set of code files as the object file;
[0177] The target block is determined from multiple pre-defined code blocks in the target file; a pre-defined log code is inserted into the target block.
[0178] The preset log code in the target block is deleted to obtain a new set of code files.
[0179] In one possible implementation, the code log-based data processing apparatus 60 further includes an insertion module for:
[0180] In response to the user's selection instruction for tagging information, the file to be inserted is determined from each code file based on the tagging information corresponding to each code file; wherein, the tagging information represents the code file;
[0181] At least one preset code block is selected from multiple preset code blocks in the file to be inserted, and designated as a candidate block.
[0182] For each candidate block identified, a preset log code is inserted into the candidate block.
[0183] In one possible implementation, the insertion module is further configured to:
[0184] Determine the block to be inserted from at least one candidate block;
[0185] For each block to be inserted, insert the preset log code into the block.
[0186] In one possible implementation, the deletion module 602 is further configured to:
[0187] Obtain the priority of each tag information; priority indicates the importance of the tag information, and the tag information represents the code file;
[0188] Based on the priority of each tag information and the arrangement order of the preset code blocks in the code file, sort all the preset code blocks in all code files to obtain the sorting result;
[0189] The preset code block that falls within the preset sorting range in the sorting results is identified as the target block.
[0190] In one possible implementation, a preset log code is inserted at a preset position in the candidate block; the log information output by the preset log code includes at least one of the following:
[0191] The tagging information of the code file to which the candidate block belongs, the input parameters of the candidate block, the output parameters of the candidate block, and the intermediate processing parameters of the candidate block.
[0192] In one possible implementation, the tagging information includes at least one of first tagging information, second tagging information, and third tagging information; the first tagging information represents a code file that receives a client request and returns response data; the second tagging information represents a code file that processes preset business data; and the third tagging information represents a code file with preset reference parameters.
[0193] In one possible implementation, the deletion module 602 is further configured to:
[0194] If the total amount of data exceeds the preset threshold, at least one preset log code will be deleted from at least one code file to obtain a new set of code files.
[0195] In one possible implementation, the code log-based data processing device 60 further includes a file reading module for:
[0196] Based on the preset file reading cycle, obtain the required reading time for the preset file; the preset file represents a file with preset content other than code files;
[0197] If the reading time exceeds the preset time threshold, at least one preset log code will be deleted from at least one code file to obtain a new set of code files.
[0198] The data processing device based on code logs provided in this embodiment can execute the methods provided in the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0199] Figure 7 This is a schematic diagram of the structure of a data processing device based on code logs, provided as an embodiment of this application. Figure 7 As shown, the code log-based data processing device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the code log-based data processing device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus.
[0200] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0201] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0202] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0203] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0204] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0205] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0206] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0207] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0208] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0209] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0210] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0211] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0212] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A code log-based data processing method, characterized by, The method comprises the following steps: acquiring a code file set and acquiring log information output by each code file in the code file set; wherein, a plurality of preset log codes are inserted into the code file, and the preset log code is used for outputting log information; the log information represents the running condition of the code file; determining the total data amount of the log information of all code files, and if the total data amount meets a preset condition, deleting at least one preset log code from at least one code file to obtain a new code file set; acquiring new log information output by each code file in the new code file set.
2. The method of claim 1, wherein, The code file comprises a plurality of preset code blocks, the preset code block is used for implementing a preset function, and at least one preset code block in the code file is inserted with a preset log code, and at most one preset log code is inserted into the preset code block; The method further comprises the following steps: in response to a selection instruction of the user on the mark information, determining a to-be-inserted file from each code file based on the mark information corresponding to each code file; wherein, the mark information represents the code file; determining at least one preset code block from a plurality of preset code blocks of the to-be-inserted file as a candidate block; for each determined candidate block, inserting a preset log code into the candidate block.
3. The method of claim 2, wherein, The method further comprises the following steps: determining a to-be-inserted block from the at least one candidate block; for each to-be-inserted block, inserting a preset log code into the to-be-inserted block. The method further comprises the following steps:
4. The method of claim 3, wherein, acquiring the priority of each mark information; the priority represents the importance of the mark information, and the mark information represents the code file; sorting all preset code blocks in all code files according to the priority of each mark information and the arrangement order of the preset code block in the code file to obtain a sorting result; determining the preset code block in the preset sorting range in the sorting result as the target block.
5. The method of claim 2, wherein, The preset log code is inserted into a preset position of the candidate block; the log information output by the preset log code comprises at least one of the following: the mark information of the code file to which the candidate block belongs, the input parameter of the candidate block, the output parameter of the candidate block, and the intermediate processing parameter of the candidate block. The mark information comprises at least one of the first mark information, the second mark information, and the third mark information; the first mark information represents a code file receiving a client request and returning response data; The second mark information represents a code file processing preset business data; 6. The method according to any one of claims 3-4, characterized in that, The third mark information represents a code file having a preset reference parameter. 7. The method according to any one of claims 3-5, characterized in that, 8. The method according to any one of claims 1-5, characterized in that, If the total amount of data meets a preset condition, at least one preset log code is deleted from at least one code file to obtain a new code file set. If the total amount of data is greater than a preset quantity threshold, at least one preset log code is deleted from at least one code file to obtain a new code file set.
9. The method according to any one of claims 1-5, characterized in that, The method further comprises: According to a preset file reading period, a reading time length required for a preset file is obtained; the preset file represents a file of preset content other than a code file; If the reading time length is greater than a preset time threshold, at least one preset log code is deleted from at least one code file to obtain a new code file set.
10. A code log-based data processing apparatus, characterized by comprising: Comprise: A first obtaining module is configured to obtain a code file set and log information output by each code file in the code file set; a plurality of preset log codes are inserted into the code file, and the preset log codes are used to output the log information; the log information represents a running condition of the code file; A deleting module is configured to determine a total amount of data of the log information of all code files, and if the total amount of data meets a preset condition, at least one preset log code is deleted from at least one code file to obtain a new code file set; A second obtaining module is configured to obtain new log information output by each code file in the new code file set.
11. A code log-based data processing device, characterized by comprising: Comprise: A processor and a memory connected with the processor in communication; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method according to any one of claims 1 to 9.
13. A computer program product, characterised in that, A computer program is executed by the processor to implement the method according to any one of claims 1 to 9.
Citation Information
Cited By
Method, device and equipment for improving code migration quality based on difference test
CN121764479A
Method, device and equipment for improving code migration quality based on differential testing
CN121764479B
