SDK (Software Development Kit) function access detection method and device, equipment and storage medium
By automatically obtaining and parsing SDK log files, identifying and detecting log statements and operation data, the problems of low efficiency and poor accuracy of SDK function access testing are solved, and efficient and accurate functional access detection is achieved.
Patent Information
- Application Number
- CN202411138361.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, the SDK function access testing is inefficient and poorly accurate, which is mainly due to the need to manually obtain and analyze log files, resulting in limited testing efficiency and accuracy.
By automatically obtaining SDK log files, parsing log files to obtain functional interface parameters, identifying objective functions and log statements, and filtering and detecting target operation data based on preset keywords, performing integrity and compliance detection, and generating functional access detection to generate functional access detection based on preset keywords. Report.
It improves the efficiency and accuracy of SDK functional access testing, ensures the reliability and accuracy of test results, and reduces the necessity of manual intervention.
Smart Images

Figure CN119226145A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, device and storage medium for detecting access to an SDK function. Background Art
[0002] SDK refers to Software Development Kit, also known as development kit or development toolkit. SDK is usually a collection of one or more software development tools to help developers create, test and deploy software applications. When releasing a game, the game development team is mostly required to access the SDK of the game distribution team. After the access is completed, the distribution team will check whether the SDK access is normal to ensure that the SDK can work normally in the application.
[0003] In the related technology, SDK logs are obtained manually, and logs are viewed and analyzed according to the SDK access documents provided by the developer. For example, after obtaining the SDK logs, the code in the logs is statically analyzed by code analysis tools to find the function call relationship of the target function, and then the function call relationship is analyzed to determine whether the target function is successfully called. This test method affects the efficiency and accuracy of function access testing. Summary of the invention
[0004] The embodiments of the present application provide an SDK function access detection method, apparatus, device and storage medium, which solve the problems of low efficiency and poor test accuracy of SDK function access testing, improve the efficiency of function access testing by automatically obtaining SDK log files and automatically identifying whether there are target log statements corresponding to the target function in the SDK log files, determine the required target operation data according to preset keywords, and detect the target operation data to ensure the accuracy of function access testing.
[0005] In a first aspect, an embodiment of the present application provides an SDK function access detection method, including:
[0006] Acquire SDK log files in real time, perform log parsing on the SDK log files, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface;
[0007] Determine a target function according to the functional interface identifier, determine a target identification range according to the position of the target function in the SDK log file, perform log statement identification within the target identification range, and obtain a log statement to be detected;
[0008] Determine whether the log statement to be detected matches a preset log statement, and if the log statement to be detected matches the preset log statement, perform target data screening on the operation data of the functional interface based on a preset keyword to obtain target operation data containing the preset keyword;
[0009] Integrity detection and compliance detection are respectively performed on the target operation data, and a function access detection report is generated based on the integrity detection results and the compliance detection results.
[0010] Optionally, determining the target recognition range according to the position of the target function in the SDK log file includes:
[0011] Determine the function entry position and function exit position of the target function according to the position of the target function in the SDK log file;
[0012] The initial character at the function entry position and the end character at the function exit position are located respectively, a first target recognition range is determined according to the initial character, and a second target recognition range is determined according to the end character.
[0013] Optionally, performing log statement recognition within the target recognition range to obtain the log statement to be detected includes:
[0014] Perform log statement recognition within the first target recognition range to obtain an execution start log statement, and perform log statement recognition within the second target recognition range to obtain an execution end log statement;
[0015] Correspondingly, the determining whether the log statement to be detected matches a preset log statement includes:
[0016] It is determined whether the statement content of the execution start log statement is the same as the statement content of the preset start statement, and whether the statement content of the execution end log statement is the same as the statement content of the preset end statement.
[0017] Optionally, the performing integrity detection and compliance detection on the target operation data respectively includes:
[0018] Classify the target operation data according to preset keywords in the target operation data to obtain multiple classification data;
[0019] Detecting whether the data volume of each classified data satisfies a corresponding preset data volume threshold, and if the preset data volume threshold is met, generating integrity identifiers corresponding to each classified data according to the detection time sequence, and performing integrity detection based on each integrity identifier; and
[0020] The data types of the classified data are determined, compliance detection rules for the classified data are determined according to the data types of the classified data, and compliance detection is performed on the corresponding classified data based on the compliance detection rules.
[0021] Optionally, the performing integrity detection based on each integrity identifier includes:
[0022] The target operation data is subjected to integrity check according to the continuity of the integrity identifiers and the total number of the integrity identifiers.
[0023] Optionally, the determining the data type of each classified data and determining the compliance detection rule of each classified data according to the data type of each classified data includes:
[0024] In the case where the classified data is text data, determining that the compliance detection rule of the classified data is a data length detection rule;
[0025] In the case where the classification data is numerical data, determining that the compliance detection rule of the classification data is a data range detection rule;
[0026] In the case that the classified data is character data, the compliance detection rule of the classified data is determined to be a data security detection rule.
[0027] Optionally, the generating a function access test report based on the integrity test result and the compliance test result includes:
[0028] Determine whether the integrity test result is a pass, and if the test is not passed, determine the classification data of the incompleteness mark according to the integrity test result;
[0029] A functional access test report is generated according to the classification data and the compliance test result.
[0030] In a second aspect, an embodiment of the present application provides an SDK function access detection device, including:
[0031] A log parsing module is used to obtain SDK log files in real time, perform log parsing on the SDK log files, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface;
[0032] A target data determination module, used to determine a target function according to the functional interface identifier, and determine a target identification range according to the position of the target function in the SDK log file;
[0033] A log statement identification module to be detected, used to identify log statements within the target identification range to obtain log statements to be detected;
[0034] A log statement matching module is used to determine whether the log statement to be detected matches a preset log statement;
[0035] A target data screening module, configured to screen the operation data of the functional interface based on a preset keyword to obtain target operation data containing the preset keyword when the log statement to be detected matches the preset log statement;
[0036] A data detection module, used to perform integrity detection and compliance detection on the target operation data respectively;
[0037] Test report generation module: used to generate a functional access test report based on the integrity test results and compliance test results.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the SDK function access detection method described in the first aspect.
[0039] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the SDK function access detection method as described in the first aspect.
[0040] The embodiment of the present application obtains the SDK log file in real time, performs log parsing on the SDK log file, obtains the function interface parameters, and the function interface parameters include the function interface identifier and the function interface operation data; determines the target function according to the function interface identifier, determines the target identification range according to the position of the target function in the SDK log file, performs log statement identification within the target identification range, and obtains the log statement to be detected; determines whether the log statement to be detected matches the preset log statement, and when the log statement to be detected matches the preset log statement, performs target data screening on the function interface operation data based on the preset keywords, and obtains the target operation data containing the preset keywords; performs integrity detection and compliance detection on the target operation data respectively, and generates a function access detection report based on the integrity detection results and the compliance detection results. The efficiency of the function access test can be improved by automatically obtaining the SDK log file and automatically identifying whether there is a target log statement corresponding to the target function in the SDK log file, and the accuracy of the function access test can be guaranteed by determining the required target operation data and detecting the target operation data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1This is a flow chart of an SDK function access detection method provided in an embodiment of the present application;
[0042] Figure 2 is a flow chart of a method for determining a target recognition range provided by an embodiment of the present application;
[0043] Figure 3 is a flow chart of a method for detecting target operation data provided by an embodiment of the present application;
[0044] Figure 4 It is a structural diagram of an SDK function access detection device provided in an embodiment of the present application;
[0045] Figure 5 It is a structural diagram of an SDK function access detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0048] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0049] The following, in conjunction with the accompanying drawings, describes in detail the SDK function access detection method, device, equipment and medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0050] The SDK function access detection method provided in the embodiment of the present application can be applied to the scenario where the software development team accesses the SDK of the software distribution team, and the distribution team tests whether the SDK access is normal. For example, after the game development team accesses the SDK of the game distribution team, the game distribution team detects whether the SDK access is normal. Based on the above application scenarios, it can be understood that the execution subject of the present application is a terminal device with an SDK access detection function, such as a mobile phone, a tablet computer, a laptop computer, etc.
[0051] Figure 1 is a flow chart of an SDK function access detection method provided in an embodiment of the present application, such as Figure 1 As shown, including:
[0052] Step S101: Acquire SDK log files in real time, perform log parsing on the SDK log files, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface.
[0053] Among them, the SDK log file refers to the collection and tracking of relevant data on user behavior, system performance and application errors by embedding specific code into the application or its components during the software development process. The recording of the SDK log file can be achieved through a single function that lasts throughout the entire process. The function interface parameters can represent the function implementation data of accessing the function interface, and may include request parameters, request address, return result, timestamp, key, and hash algorithm. Optionally, in an embodiment of the present application, the function interface parameters include a function interface identifier and the operation data of the function interface. The function interface identifier is used to indicate the function that the interface can specifically implement, such as a login function, a payment function, etc. The operation data of the function interface is used to indicate the specific operation behavior implemented by accessing the function interface. Exemplarily, if the function interface is a login function interface, the user can generate operation data such as input user name, login password, identity information, etc. through the login function interface. In one embodiment, the SDK log file is obtained in real time, and the obtained SDK log file is aggregated and parsed, that is, the data generated by the same function interface is aggregated and processed to obtain the function interface identifier of each function interface and the operation data of the function interface.
[0054] Step S102: determining a target function according to the functional interface identifier, determining a target identification range according to the position of the target function in the SDK log file, and performing log statement identification within the target identification range to obtain a log statement to be detected.
[0055] Among them, the target function is a function with a function call function. The target identification range is an identification range for target parameter identification, and the identification range can be represented by the line number in the SDK log file, such as the 10th line of the SDK log file. The log statement refers to an identification statement that can identify the start and end of the function call. The log statement to be detected is a statement to be detected to determine whether it can represent a function call. In one embodiment, it is determined whether there is a function containing the function interface identifier in the SDK log file based on the function interface identifier. If so, the function is determined to be the target function, and the target function is located by searching for the target function in the SDK log file, that is, the position of the target function in the SDK log file is determined, such as line 10-line 15, then the target identification range is determined to be lines 10 to 15, and all log statements within the target identification range are identified to obtain the log statement to be detected.
[0056] Step S103, determining whether the log statement to be detected matches the preset log statement. If the log statement to be detected matches the preset log statement, target data screening is performed on the operation data of the functional interface based on preset keywords to obtain target operation data containing the preset keywords.
[0057] The preset keyword is a value used to identify a specific data item of each record in a file. Optionally, the preset keyword can be used to represent the required data in the functional interface. For example, if the required data corresponding to the payment function is the payment amount and the payment password, the keywords "payment amount" and "payment password" can be pre-set before the SDK access detection is performed on the payment function interface. The target operation data is used to represent the operation data corresponding to the preset keyword, such as the input data 10,000 yuan associated with the "payment amount". In one embodiment, the log statement to be detected is compared to see if they are the same as the preset log statement. If they are the same, the log statement to be detected matches the preset log statement, and the operation data containing the preset keyword is screened in the SDK log, and the operation data is determined as the target operation data.
[0058] Step S104: perform integrity detection and compliance detection on the target operation data respectively, and generate a function access detection report based on the integrity detection results and the compliance detection results.
[0059] Integrity testing is to ensure the accuracy and reliability of data, to prevent the existence of data in the database that does not comply with semantic regulations and the process of invalid operations or erroneous information caused by the input and output of erroneous information. Compliance testing refers to the compliance check of data activities to ensure that they comply with relevant laws, regulations, standards and industry rules. In one embodiment, the target operation data is checked for integrity and compliance conditions, and a functional access test report is generated based on the integrity test results and the compliance test results. Among them, the functional access test report may include specific incomplete data and non-compliant data, as well as prompt information on the reasons for the incompleteness and non-compliance of the data.
[0060] In the above, by acquiring the SDK log file in real time, parsing the SDK log file, obtaining the function interface parameters, which include the function interface identifier and the function interface operation data; determining the target function according to the function interface identifier, determining the target identification range according to the position of the target function in the SDK log file, identifying the log statement within the target identification range, and obtaining the log statement to be detected; judging whether the log statement to be detected matches the preset log statement, and in the case that the log statement to be detected matches the preset log statement, filtering the function interface operation data based on the preset keywords, and obtaining the target operation data containing the preset keywords; performing integrity detection and compliance detection on the target operation data, respectively, and generating a function access detection report based on the integrity detection results and the compliance detection results. The efficiency of the function access test can be improved by automatically acquiring the SDK log file and automatically identifying whether there is a target log statement corresponding to the target function in the SDK log file, and the accuracy of the function access test can be guaranteed by determining the required target operation data and detecting the target operation data.
[0061] Figure 2 is a flow chart of a method for determining a target recognition range provided by an embodiment of the present application, such as Figure 2 As shown, including:
[0062] Step S201: Determine the function entry position and function exit position of the target function according to the position of the target function in the SDK log file.
[0063] In one embodiment, the function entry position refers to the part that starts to execute when the program is executed. It is a specific function or method in the program and the starting point of the program. Function exit position. The function exit position refers to the position where the function returns the call result or call value after execution. The entry position and exit position of the target function are determined according to the position of the target function in the SDK log file, that is, the first line and the last line of the calling function. Exemplarily, if the position of the target function in the SDK log file is between lines 10 and 15, the 10th line of the SDK log file is determined to be the function entry position of the target function, and the 15th line is determined to be the function exit position of the target function.
[0064] Step S202, respectively locate the initial character at the function entry position and the end character at the function exit position, determine a first target recognition range according to the initial character, and determine a second target recognition range according to the end character.
[0065] The first target recognition range is a range for identifying the start call identifier of a function, and the second target recognition range is a range for identifying the end call identifier of a function. In one embodiment, the initial character of the function entry position is located, such as the initial character of the function call on line 10 of the SDK log file, and the end character of the function exit position, such as the end character of the return call value on line 15 of the SDK log file. The initial character of the function call on line 10 to the end position of line 10 is determined as the first target recognition range, and the initial position of line 15 to the end character of the return call value on line 15 is determined as the second target recognition range.
[0066] In the above, the function entry position and function exit position of the target function are determined according to the position of the target function in the SDK log file; the initial character of the function entry position and the end character of the function exit position are located respectively, the first target recognition range is determined according to the initial character, and the second target recognition range is determined according to the end character. The first target recognition range and the second target recognition range can be accurately determined based on the position of the target function in the SDK log file, and the recognition efficiency of the log statement can be improved by narrowing the target recognition range while ensuring the recognition accuracy.
[0067] In one embodiment, performing log statement recognition within the target recognition range to obtain the log statement to be detected includes:
[0068] Perform log statement recognition within the first target recognition range to obtain an execution start log statement, and perform log statement recognition within the second target recognition range to obtain an execution end log statement;
[0069] Correspondingly, the determining whether the log statement to be detected matches a preset log statement includes:
[0070] It is determined whether the statement content of the execution start log statement is the same as the statement content of the preset start statement, and whether the statement content of the execution end log statement is the same as the statement content of the preset end statement.
[0071] The content of the preset start statement is an identification statement for indicating the start of a function call, such as a log statement containing the keyword def, and the content of the preset end statement is an identification statement for indicating the end of a function call, such as a log statement containing the keyword return, etc. Log statement recognition is performed within the first target recognition range to obtain an execution start log statement, and the keyword information in the execution start log statement is compared with the keyword information in the content of the preset start statement, and the keyword information in the execution end log statement is compared with the keyword information in the content of the preset end statement. If they are the same, it can be determined that the function call made through the function interface is successful.
[0072] In the above, by performing log statement recognition within the first target recognition range, an execution start log statement is obtained, and by performing log statement recognition within the second target recognition range, an execution end log statement is obtained; it is determined whether the statement content of the execution start log statement is the same as the statement content of the preset start statement, and whether the statement content of the execution end log statement is the same as the statement content of the preset end statement. By further detecting the execution start log statement and the execution end log statement, it is possible to determine whether the corresponding function is successfully called, thereby improving the accuracy of the SDK function access test.
[0073] Figure 3 is a flow chart of a method for detecting target operation data provided by an embodiment of the present application, such as Figure 3 As shown, including:
[0074] Step S301: classify the target operation data according to preset keywords in the target operation data to obtain a plurality of classified data.
[0075] In one embodiment, since the detection rules for different types of operation data are different, the target operation data is classified according to the preset keywords in the target operation data, and the data containing the same preset keywords in the target operation data are divided into the same category, such as all data containing "payment amount" in the target operation data are determined as one category of data, and all data containing "payment password" are determined as one category of data.
[0076] Step S302: Check whether the data volume of each classified data meets the corresponding preset data volume threshold. If the preset data volume threshold is met, generate integrity identifiers corresponding to each classified data according to the detection time sequence, and perform integrity detection based on each integrity identifier.
[0077] In one embodiment, the corresponding data volume threshold is determined in advance according to different types of data. For example, the data volume threshold of the classified data containing the "payment password" may be 12. If there are multiple data containing the "payment password" in the classified data, the data volume threshold may be automatically adjusted. After obtaining each classified data, the data volume of each classified data is counted, and the data volume of each type of data is compared with the corresponding data volume threshold. When it is greater than or equal to the corresponding preset data volume threshold, an integrity identifier corresponding to the classified data is generated. The integrity identifier may be an alphabetic identifier or a digital identifier, such as A, B, or C. Correspondingly, when it is less than the corresponding preset data volume threshold, an incompleteness identifier corresponding to the classified identifier is generated. The incompleteness identifier is used to indicate that the data is incomplete and cannot pass the functional access test. It can be represented by a symbol, such as , or no identification is generated. After the detection is completed, the classified data and the corresponding identification are sorted according to the detection order. If the sorting results are the first classified data, the second classified data, the third classified data and the fourth classified data, the corresponding integrity identifications are "A", "B", "C" and "D" respectively. If the data volume of the first classified data meets the data volume threshold, the integrity identification "A" is generated. If the data volume of the second classified data does not meet the data volume threshold, the integrity identification "B" is not generated. The data volumes of the third classified data and the fourth classified data both meet the corresponding data volume thresholds, and the integrity identifications "C" and "D" are generated respectively.
[0078] Step S303: determine the data type of each classified data, determine the compliance detection rule of each classified data according to the data type of each classified data, and perform compliance detection on the corresponding classified data based on each compliance detection rule.
[0079] In one embodiment, the data type of the classified data may include string type, integer type, array type, etc. Different compliance detection rules are used for different types of data, such as different detection standards for the data format of different types of data. The compliance detection rules corresponding to each classified data can be determined based on the mapping relationship between the preset data type and the compliance detection rule, and the compliance detection of the corresponding classified data is performed based on each compliance detection rule. Exemplarily, if the classified data is data containing "payment password", the corresponding compliance detection rule is determined to be data format detection according to the preset mapping relationship to detect whether the payment password contains multiple types of characters.
[0080] In the above, the target operation data is classified and processed according to preset keywords in the target operation data to obtain multiple classified data; whether the data volume of each classified data meets the corresponding preset data volume threshold is detected, and when the preset data volume threshold is met, the integrity identifier corresponding to each classified data is generated according to the detection time sequence, and integrity detection is performed based on each integrity identifier; the data type of each classified data is determined, and the compliance detection rules of each classified data are determined according to the data type of each classified data, and compliance detection is performed on the corresponding classified data based on each compliance detection rule. The target operation data can be classified and processed, and different compliance detection rules are used for different types of data, so that the detection process conforms to the actual business data, and the accuracy of compliance detection is also improved.
[0081] In one embodiment, the performing integrity detection based on each integrity identifier includes:
[0082] The target operation data is subjected to integrity check according to the continuity of the integrity identifiers and the total number of the integrity identifiers.
[0083] Exemplarily, if the sorting results are first-classified data, second-classified data, third-classified data, and fourth-classified data, the corresponding integrity identifiers are "A", "B", "C", and "D", respectively, where the data volume of the first-classified data meets the data volume threshold, and the integrity identifier "A" is generated; the data volume of the second-classified data does not meet the data volume threshold, and the integrity identifier "B" is not generated. The data volumes of the third-classified data and the fourth-classified data both meet the corresponding data volume thresholds, and integrity identifiers "C" and "D" are generated, respectively. The generated detection results are "A", "C", and "D". Based on the total number of integrity identifiers, it can be determined that the target operation data is incomplete, and based on the continuity of the integrity identifiers in the detection results, it can be determined that the integrity identifier "B" is missing, and the classified data corresponding to the integrity identifier "B" is incomplete.
[0084] As described above, by performing integrity detection on the target operation data based on the continuity of each integrity identifier and the total number of each integrity identifier, incomplete classification data can be quickly located.
[0085] In one embodiment, the determining the data type of each classified data and determining the compliance detection rule of each classified data according to the data type of each classified data includes:
[0086] In the case where the classified data is text data, determining that the compliance detection rule of the classified data is a data length detection rule;
[0087] In the case where the classification data is numerical data, determining that the compliance detection rule of the classification data is a data range detection rule;
[0088] In the case that the classified data is character data, the compliance detection rule of the classified data is determined to be a data security detection rule.
[0089] Exemplarily, if the classified data is text data, such as a user name, the length of the user name is detected to determine whether the length of the user name exceeds the preset text length. If the text length meets the preset text length, the length test passes. Or the user name is checked for duplicates, that is, the user name is compared with the historical user name data stored in the data, and whether the user name is repeated is determined based on the comparison result. If the classified data is numerical data, such as user age, the user age data is compared with the preset age range to determine whether the user age is within the preset age range. If it is within the preset age range, the data range test is passed. If the classified data is character data, such as a user password, the user password is detected to determine whether it is desensitized. If it is desensitized, it is determined that the data security test has passed. As described above, different compliance detection rules are used for different types of data, so that the detection process conforms to the actual business data, and also improves the accuracy of compliance detection.
[0090] In one embodiment, the generating of the function access detection report based on the integrity detection result and the compliance detection result includes:
[0091] Determine whether the integrity test result is a pass, and if the test is not passed, determine the classification data of the incompleteness mark according to the integrity test result;
[0092] A functional access test report is generated according to the classification data and the compliance test result.
[0093] Exemplarily, after the integrity test is completed, determine whether there is classified data that has not passed the test based on the integrity test result. If there is classified data that has not passed the test, determine the classified data with an incomplete mark, and package the classified data with an incomplete mark to generate a first data packet to be debugged and save the first data packet to be debugged, and generate an access link for the first data packet to be debugged. Determine whether there is classified data that has not passed the test based on the compliance test result. If there is classified data that has not passed the test, package the classified data to generate a second data packet to be debugged and save the second data packet to be debugged, and generate an access link for the second data packet to be debugged. Generate a functional access test report based on the integrity test result, the compliance test result, the access link of the first data packet to be debugged, and the access link of the second data packet to be debugged.
[0094] In the above, it is determined whether the integrity test result is passed. If it is not passed, the classification data of the incompleteness mark is determined according to the integrity test result, and a function access test report is generated according to the classification data and the compliance test result. It is convenient to debug or feedback the interface data of the SDK function access failure, thereby improving the user experience.
[0095] Figure 4 is a structural diagram of an SDK function access detection device provided in an embodiment of the present application, such as Figure 4 As shown, including:
[0096] The log parsing module 41 is used to obtain the SDK log file in real time, perform log parsing on the SDK log file, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface;
[0097] A target data determination module 42, configured to determine a target function according to the functional interface identifier, and determine a target identification range according to the location of the target function in the SDK log file;
[0098] A log statement identification module 43 to be detected is used to identify log statements within the target identification range to obtain log statements to be detected;
[0099] A log statement matching module 44 is used to determine whether the log statement to be detected matches a preset log statement;
[0100] A target data screening module 45 is used to screen the operation data of the functional interface based on a preset keyword to obtain target operation data containing the preset keyword when the log statement to be detected matches the preset log statement;
[0101] A data detection module 46, used to perform integrity detection and compliance detection on the target operation data;
[0102] The test report generating module 47 is used to generate a function access test report based on the integrity test result and the compliance test result.
[0103] The embodiment of the present application obtains the SDK log file in real time, performs log parsing on the SDK log file, obtains the function interface parameters, and the function interface parameters include the function interface identifier and the function interface operation data; determines the target function according to the function interface identifier, determines the target identification range according to the position of the target function in the SDK log file, performs log statement identification within the target identification range, and obtains the log statement to be detected; determines whether the log statement to be detected matches the preset log statement, and when the log statement to be detected matches the preset log statement, performs target data screening on the function interface operation data based on the preset keywords, and obtains the target operation data containing the preset keywords; performs integrity detection and compliance detection on the target operation data respectively, and generates a function access detection report based on the integrity detection results and the compliance detection results. The efficiency of the function access test can be improved by automatically obtaining the SDK log file and automatically identifying whether there is a target log statement corresponding to the target function in the SDK log file, and the accuracy of the function access test can be guaranteed by determining the required target operation data and detecting the target operation data.
[0104] In a possible embodiment, the target data determination module 42 is used to:
[0105] Determine the function entry position and function exit position of the target function according to the position of the target function in the SDK log file;
[0106] The initial character at the function entry position and the end character at the function exit position are located respectively, a first target recognition range is determined according to the initial character, and a second target recognition range is determined according to the end character.
[0107] In a possible embodiment, the to-be-detected log statement identification module 43 is used to:
[0108] Perform log statement recognition within the first target recognition range to obtain an execution start log statement, and perform log statement recognition within the second target recognition range to obtain an execution end log statement;
[0109] The log statement matching module 44 is used to determine whether the statement content of the execution start log statement is the same as the statement content of the preset start statement, and whether the statement content of the execution end log statement is the same as the statement content of the preset end statement.
[0110] In a possible embodiment, the data detection module 46 is used to:
[0111] Classify the target operation data according to preset keywords in the target operation data to obtain multiple classification data;
[0112] Detecting whether the data volume of each classified data satisfies a corresponding preset data volume threshold, and if the preset data volume threshold is met, generating integrity identifiers corresponding to each classified data according to the detection time sequence, and performing integrity detection based on each integrity identifier; and
[0113] The data types of the classified data are determined, compliance detection rules for the classified data are determined according to the data types of the classified data, and compliance detection is performed on the corresponding classified data based on the compliance detection rules.
[0114] In a possible embodiment, the data detection module 46 is used to:
[0115] The target operation data is subjected to integrity check according to the continuity of the integrity identifiers and the total number of the integrity identifiers.
[0116] In a possible embodiment, the data detection module 46 is further used for:
[0117] In the case where the classified data is text data, determining that the compliance detection rule of the classified data is a data length detection rule;
[0118] In the case where the classification data is numerical data, determining that the compliance detection rule of the classification data is a data range detection rule;
[0119] In the case that the classified data is character data, the compliance detection rule of the classified data is determined to be a data security detection rule.
[0120] In a possible embodiment, the test report generating module 47 is further used for:
[0121] Determine whether the integrity test result is a pass, and if the test is not passed, determine the classification data of the incompleteness mark according to the integrity test result;
[0122] A functional access test report is generated according to the classification data and the compliance test result.
[0123] An embodiment of the present application also provides an electronic device, and the SDK function access detection device can integrate an SDK function access detection apparatus provided in an embodiment of the present application. Figure 5 Schematic diagram of the structure of an SDK function access detection device provided in an embodiment of the present application. Figure 5The SDK function access detection device includes: an input device 53, an output device 54, a memory 52 and one or more processors 51; the memory 52 is used to store one or more programs; when one or more programs are executed by one or more processors 51, the one or more processors 51 implement the SDK function access detection method provided in the above embodiment. The input device 53, the output device 54, the memory 52 and the processor 51 can be connected by a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0124] The memory 52, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the SDK function access detection method provided in any embodiment of the present application. The memory 52 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; the data storage area may store data created according to the use of the device, etc. In addition, the memory 52 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 52 may further include a memory remotely arranged relative to the processor 51, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0125] The input device 53 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 54 may include a display device such as a display screen.
[0126] The processor 51 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 52, that is, implements the above-mentioned SDK function access detection method.
[0127] The SDK function access detection apparatus, device and computer provided above can be used to execute the SDK function access detection method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0128] The embodiment of the present application further provides a storage medium storing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute the SDK function access detection method provided in the above embodiment. The SDK function access detection method includes:
[0129] Acquire SDK log files in real time, perform log parsing on the SDK log files, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface;
[0130] Determine a target function according to the functional interface identifier, determine a target identification range according to the position of the target function in the SDK log file, perform log statement identification within the target identification range, and obtain a log statement to be detected;
[0131] Determine whether the log statement to be detected matches a preset log statement, and if the log statement to be detected matches the preset log statement, perform target data screening on the operation data of the functional interface based on a preset keyword to obtain target operation data containing the preset keyword;
[0132] Integrity detection and compliance detection are respectively performed on the target operation data, and a function access detection report is generated based on the integrity detection results and the compliance detection results.
[0133] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0134] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the SDK function access detection method described above, can also execute related operations in the SDK function access detection method provided in any embodiment of the present application.
[0135] The SDK function access detection apparatus, device and storage medium provided in the above embodiments can execute the SDK function access detection method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the SDK function access detection method provided in any embodiment of the present application.
[0136] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method for detecting SDK function access, characterized in that: include: Acquire SDK log files in real time, perform log parsing on the SDK log files, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface; Determine a target function according to the functional interface identifier, determine a target identification range according to the position of the target function in the SDK log file, perform log statement identification within the target identification range, and obtain a log statement to be detected; Determine whether the log statement to be detected matches a preset log statement, and if the log statement to be detected matches the preset log statement, perform target data screening on the operation data of the functional interface based on a preset keyword to obtain target operation data containing the preset keyword; Integrity detection and compliance detection are respectively performed on the target operation data, and a function access detection report is generated based on the integrity detection results and the compliance detection results.
2. The SDK function access test method according to claim 1, characterized in that: Determining the target recognition range according to the position of the target function in the SDK log file includes: Determine the function entry position and function exit position of the target function according to the position of the target function in the SDK log file; The initial character at the function entry position and the end character at the function exit position are located respectively, a first target recognition range is determined according to the initial character, and a second target recognition range is determined according to the end character.
3. The SDK function access test method according to claim 2, characterized in that: The performing log statement recognition within the target recognition range to obtain the log statement to be detected includes: Perform log statement recognition within the first target recognition range to obtain an execution start log statement, and perform log statement recognition within the second target recognition range to obtain an execution end log statement; Correspondingly, the determining whether the log statement to be detected matches a preset log statement includes: It is determined whether the statement content of the execution start log statement is the same as the statement content of the preset start statement, and whether the statement content of the execution end log statement is the same as the statement content of the preset end statement.
4. The SDK function access test method according to claim 1, characterized in that: The performing integrity detection and compliance detection on the target operation data respectively includes: Classify the target operation data according to preset keywords in the target operation data to obtain a plurality of classified data; Detecting whether the data volume of each classified data satisfies a corresponding preset data volume threshold, and if the preset data volume threshold is met, generating integrity identifiers corresponding to each classified data according to the detection time sequence, and performing integrity detection based on each integrity identifier; and The data types of the classified data are determined, compliance detection rules for the classified data are determined according to the data types of the classified data, and compliance detection is performed on the corresponding classified data based on the compliance detection rules.
5. The SDK function access test method according to claim 4, characterized in that: The integrity detection based on each integrity identifier includes: The target operation data is subjected to integrity check according to the continuity of the integrity identifiers and the total number of the integrity identifiers.
6. The SDK function access test method according to claim 4, characterized in that: The determining the data type of each classified data and determining the compliance detection rule of each classified data according to the data type of each classified data includes: In the case where the classified data is text data, determining that the compliance detection rule of the classified data is a data length detection rule; In the case where the classification data is numerical data, determining that the compliance detection rule of the classification data is a data range detection rule; In the case that the classified data is character data, the compliance detection rule of the classified data is determined to be a data security detection rule.
7. The SDK function access test method according to claim 4, characterized in that: The generating of the function access test report based on the integrity test result and the compliance test result includes: Determine whether the integrity test result is a pass, and if the test is not passed, determine the classification data of the incompleteness mark according to the integrity test result; A functional access test report is generated according to the classification data and the compliance test result.
8. A SDK function access detection device, characterized in that: include: A log parsing module is used to obtain SDK log files in real time, perform log parsing on the SDK log files, and obtain function interface parameters, wherein the function interface parameters include a function interface identifier and operation data of the function interface; A target data determination module, used to determine a target function according to the functional interface identifier, and determine a target identification range according to the position of the target function in the SDK log file; A log statement identification module to be detected, used to identify log statements within the target identification range to obtain log statements to be detected; A log statement matching module is used to determine whether the log statement to be detected matches a preset log statement; A target data screening module, configured to screen the operation data of the functional interface based on a preset keyword to obtain target operation data containing the preset keyword when the log statement to be detected matches the preset log statement; A data detection module, used to perform integrity detection and compliance detection on the target operation data respectively; The test report generation module is used to generate a functional access test report based on the integrity test results and the compliance test results.
9. An electronic device, comprising: one or more processors; A storage device, used to store one or more programs, when the one or more programs are executed by the one or more processors, so that the one or more processors implement the SDK function access detection method as described in any one of claims 1-7.
10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the SDK function access detection method according to any one of claims 1 to 7 when executed by a computer processor.
