Data detection method and apparatus, electronic device, storage medium, and program product
Patent Information
- Application Number
- CN202510537389.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2026-10-27
AI Technical Summary
[0017]第四方面,本公开实施例还提供了一种包含计算机可执行指令的存储介质,该计算机可执行指令在由计算机处理器执行时用于执行如本公开实施例中任一所述的数据检测方法。
Smart Images

Figure CN122985600A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer processing technology, and in particular to a data detection method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] With the rapid development of the internet, various resource packages are widely deployed in various information exchange scenarios to enrich the ways information is exchanged. To ensure the stability of resource packages, they usually need to be tested before being released to the production environment.
[0003] In related technologies, resource package testing typically relies on testers using their accumulated testing experience to write test cases specifically tailored to the resource package, and then testing each package one by one according to the established test cases. However, because test case generation depends on the tester's personal ability and experience, coupled with the limitations of manual testing, it consumes a significant amount of manpower and time. Moreover, in practical applications, different resource packages often require different test cases, meaning that test cases are often difficult to reuse, resulting in poor testing effectiveness and unstable test results. Summary of the Invention
[0004] This disclosure provides a data detection method, apparatus, electronic device, storage medium, and program product to achieve faster and more comprehensive detection of potential problems in resource packages, thereby improving the efficiency and accuracy of data detection.
[0005] In a first aspect, embodiments of this disclosure provide a data detection method, the method comprising:
[0006] In response to a data detection request, a resource package to be tested is obtained, wherein the resource package includes a script file; the script file is program data used to describe the processing logic for at least one first resource;
[0007] The program data in the script file is analyzed to obtain a first detection result corresponding to the script file, and the script file is executed to obtain script execution data. A second detection result corresponding to the script file is determined based on the script execution data.
[0008] Data detection results corresponding to the resource package are generated based on the first detection result and the second detection result.
[0009] Secondly, embodiments of this disclosure also provide a data detection device, the device comprising:
[0010] The detection request module is used to respond to a data detection request and obtain a resource package to be tested, wherein the resource package includes a script file; the script file is program data used to describe the processing logic of at least one first resource;
[0011] The script detection module is used to analyze the program data in the script file to obtain a first detection result corresponding to the script file, and to execute the script file to obtain script execution data, and to determine a second detection result corresponding to the script file based on the script execution data.
[0012] The result generation module is used to generate data detection results corresponding to the resource package based on the first detection result and the second detection result.
[0013] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0014] One or more processors;
[0015] Storage device for storing one or more programs.
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the data detection method as described in any of the embodiments of this disclosure.
[0017] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the data detection method as described in any of the embodiments of this disclosure.
[0018] Fifthly, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the data detection method as described in any of the embodiments of this disclosure.
[0019] The technical solution of this disclosure, in response to a data detection request, obtains a resource package to be tested. This allows for automatic acquisition of the resource package based on the received data detection request, and execution of the testing process. Since the resource package includes a script file containing program data describing the processing logic for at least one first resource, the expected data processing operations can be performed through the resource package, enriching its content. Subsequently, by analyzing the program data in the script file, a first detection result corresponding to the script file is obtained, enabling the detection of potential defects or non-compliance with coding standards in the script file without running the program data. Then, by executing the script file, script execution data is obtained, and a second detection result corresponding to the script file is determined based on the script execution data, enabling the detection of potential problems during program execution. Combining static and dynamic detection dimensions achieves accurate detection of the script file. Finally, by generating a data detection result corresponding to the resource package based on the first and second detection results, the technical problems of low detection efficiency and unstable detection results in related technologies' resource package detection methods are solved. This achieves faster and more comprehensive detection of potential problems in the resource package, improving the efficiency and accuracy of data detection. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart illustrating a data detection method provided in an embodiment of this disclosure;
[0022] Figure 2 A flowchart illustrating another data detection method provided in this embodiment of the disclosure;
[0023] Figure 3 A flowchart illustrating another data detection method provided in this embodiment of the disclosure;
[0024] Figure 4 An example diagram of an interface for displaying resource processing data is provided in an embodiment of this disclosure;
[0025] Figure 5 This is a schematic diagram of the file structure of a scenario configuration file provided in an embodiment of the present disclosure;
[0026] Figure 6 An example diagram of an interface for displaying data detection results provided in an embodiment of this disclosure;
[0027] Figure 7 This is a schematic diagram of the structure of a data detection device provided in an embodiment of the present disclosure;
[0028] Figure 8 This is a schematic diagram of the structure of an electronic device for implementing an embodiment of the present disclosure. Detailed Implementation
[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0034] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0035] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0036] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0037] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0039] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0040] Figure 1 This is a flowchart illustrating a data detection method provided in an embodiment of this disclosure. This embodiment is applicable to scenarios involving data detection. The method can be executed by a data detection device, which can be implemented in software and / or hardware, optionally through an electronic device such as a mobile terminal, PC, or server. Figure 1 As shown, the method in this embodiment may specifically include:
[0041] S110. In response to a data detection request, obtain a resource package to be tested, wherein the resource package includes a script file; the script file is program data used to describe the processing logic of at least one first resource.
[0042] In this context, a data detection request can be understood as a request to detect a resource package to be tested. In this embodiment, there are various ways to obtain a data detection request, which are not specifically limited here. For example, a first interface can be displayed, which includes a command input box; after receiving one or more commands for detecting the resource package to be tested through the command input box, a data detection request for the resource package to be tested can be generated. Alternatively, a second interface can be displayed, which may include the resource package to be tested and a data detection control; after receiving a control trigger operation applied to the data detection control, a data detection request for the resource package to be tested can be generated. The information carried in the data detection request may include the resource package identifier of the resource package to be tested. The resource package identifier can be used to partition different resource packages.
[0043] In this embodiment, the resource package to be tested can be understood as a resource package that needs to be tested. A resource package can be understood as a folder or compressed file that contains multiple resource files. The number of resource packages to be tested can be one, two, or more. The resource package includes reusable data for performing the expected operation. For example, the resource package can be a resource package (effects prop package) for performing special effects processing operations, or it can be a packaged application file. Specifically, the resource package for performing special effects processing operations can be used for standardized storage and distribution of data for performing special effects processing operations. In this embodiment, the resource package can contain program data, resources (such as models, materials, and textures, etc., one or more), and deployment metadata (such as version numbers, etc.) required for its operation. That is, the resource package can run independently to provide specific services. It is understood that the code required for its operation contained in the resource package is the program data in the script files within the resource package. In this embodiment, the resource package to be tested can be deployed on a target platform for testing. The target platform can be configured according to actual needs, and is not specifically limited here. Taking a cloud platform as an example, the resource package to be tested can be uploaded to the cloud platform. Upon receiving an instruction to test the resource package, it can be deployed in a pre-built resource package testing environment on the cloud platform for testing. Specifically, after the resource package is deployed in the pre-built testing environment, functional testing can be performed on it. Furthermore, the resource package can be decompressed to obtain the resource files it contains, allowing for testing of these files.
[0044] In this embodiment, there are several ways to obtain the resource package to be tested. For example, at least one pre-set candidate resource package can be displayed; in response to a resource package selection operation for the candidate resource package, the selected resource package is determined and used as the resource package to be tested. Alternatively, in response to a control trigger operation acting on a pre-set resource package upload control, the uploaded resource package can be obtained as the resource package to be tested. Or, the resource package can be read from a pre-set resource package storage path and used as the resource package to be tested. The pre-set resource package storage path can be understood as a pre-set storage path for storing the resource package to be tested. Optionally, the pre-set resource package storage path may include a relative storage path and / or an absolute storage path.
[0045] In this embodiment of the disclosure, the resource package may include one or more script files. The script file may be program data describing the processing logic for at least one first resource. That is, the script file may be program data describing the logic for processing at least one first resource. In this embodiment of the disclosure, the script files in the resource package may include script files corresponding to shaders. The script file corresponding to a shader may be program data describing the image processing logic for resources requiring image processing. In this embodiment of the disclosure, a first resource can be understood as a resource required to achieve the intended function of the resource package. For example, a first resource may include at least one of a 3D model, image, sequence frame, audio, material, and scene data. The 3D model may include a 3D network model and / or a 3D point cloud model. Scene data may include at least one of a scene camera, scene lights, scene shadows, etc. It should be noted that the first resources corresponding to different script files may be the same or different.
[0046] In this embodiment, the program data may include function data. The function data may include at least one of function identifiers, function call data, function count, and function execution time. The function identifier can be used to distinguish different functions in the program data. The function identifier can be obtained by naming the functions based on a preset naming convention. The preset naming convention can be any one of camelCase, underscore, or PascalCase. In this embodiment, using a preset naming convention not only maintains code clarity in the program data but also improves the readability and maintainability of the functions. The function count can be understood as the total number of functions defined in the script file. In this embodiment, the number of functions defined in the program data of a script file can be one, two, or more. Function execution time can be the time spent by a function from the start of execution to the end. In this embodiment, function execution time can reflect the computer resources (e.g., CPU time) consumed and the execution efficiency during function execution. Optionally, the function call data may include the number of function calls and / or function dependency data. Function call counts can be understood as the total number of times each function defined in the program data is called during program execution. These function call counts can be used to measure the code efficiency and performance optimization of the program data. Function dependency data can be used to represent the dependencies between functions in the program data.
[0047] Specifically, after receiving a data detection request, the request can be parsed to obtain the resource package to be tested based on the parsing result. In this embodiment, there are several ways to obtain the resource package to be tested based on the parsing result. For example, if the parsing result is a resource package identifier, obtaining the resource package to be tested based on the parsing result includes: determining the resource package corresponding to the resource package identifier from a preset resource package storage space based on the resource package identifier, i.e., obtaining the resource package to be tested; wherein the preset resource package storage space pre-stores the resource package to be tested. Alternatively, if the parsing result is a resource package identifier, obtaining the resource package to be tested based on the parsing result includes: determining the resource package storage path corresponding to the resource package identifier based on the correspondence between the resource package identifier and the resource package storage path. Then, the resource package to be tested can be obtained based on the resource package storage path. Or, if the parsing result is a resource package storage path, the resource package to be tested can be obtained based on the resource package storage path.
[0048] S120. Analyze the program data in the script file to obtain a first detection result corresponding to the script file.
[0049] The first detection result can be obtained by analyzing the program data in the script file. In this embodiment, the first detection result may include execution complexity. Execution complexity, or program complexity, can serve as an indicator of program data design and implementation to measure its quality. In this embodiment, the execution complexity may include time complexity and / or arithmetic complexity. Time complexity represents the amount of computation required to execute the program data. Arithmetic complexity can be understood as the number of operations required to complete arithmetic operations during the execution of the program data, reflecting the arithmetic workload of the program data. In this embodiment, the purpose of analyzing the program data in the script file is to detect potential problems in the program data without executing the script file, thereby improving the code quality of the program data and reducing runtime errors.
[0050] In this embodiment of the disclosure, the analysis performed on the program data may include at least one of the following: syntax analysis, semantic analysis, security analysis, performance analysis, code style analysis, and program complexity analysis. In this embodiment, the purpose of syntax analysis is to detect whether the program data conforms to the syntax rules of the programming language. The purpose of semantic analysis is to detect the logical rationality of the program data. The purpose of security analysis is to detect potential security vulnerabilities in the program data. The purpose of performance analysis is to detect functions in the program data that may cause performance problems. The purpose of code style analysis is to detect whether the program data conforms to the established coding standards. The purpose of program complexity analysis is to determine the time complexity and / or arithmetic complexity of the program data.
[0051] Specifically, after analyzing the program data in the script file, the function identifiers, function call data, number of functions, and function execution time can be determined. Therefore, the analysis results of the script file can be obtained based on the function identifiers, function call data, number of functions, and function execution time. Furthermore, a first detection result corresponding to the script file can be determined based on the analysis results.
[0052] During the development phase of a resource package, technical personnel often add logging functions to the program data of script files within the resource package to debug the program by calling the logging functions and obtaining log information. Therefore, to improve the standardization and security of the program data in the script files of the resource package, this embodiment analyzes the program data in the script files. Specifically, it determines whether the target functions in the program data include program statements that call logging functions; wherein, the target function can be understood as a function in the program data that is to be checked for the existence of statements calling logging functions. In this embodiment, the number of target functions can be one, two, or more.
[0053] In this embodiment, when the program data in the script file needs to call the program data corresponding to the shader, i.e., for scenarios where the resource package depends on shader processing, complex shaders often contain a large number of computational instructions and complex logic, resulting in a large computational load on the graphics processing unit (GPU) during execution, which in turn leads to prolonged rendering time and decreased frame rate. Furthermore, frequent texture data and intermediate result read / write operations increase memory bandwidth usage. Therefore, in this embodiment, the program data in the script file is analyzed, including: analyzing the program data corresponding to the shader to optimize shader performance and improve graphics display processing efficiency. Optionally, analyzing the program data corresponding to the shader may include: analyzing the program data corresponding to the shader by calling a preset performance analysis tool. The preset performance analysis tool can be understood as a pre-set analysis tool for analyzing the program data corresponding to the shader.
[0054] In this embodiment of the disclosure, the analysis of the program data corresponding to the shader may specifically include: performing at least one of the following analyses on the program data corresponding to the shader: instruction count analysis, data dependency analysis, texture sampling frequency analysis, and program branch structure complexity analysis. Instruction count analysis can effectively determine the total number of instructions executed in the program data corresponding to the shader, thereby assessing computational complexity. Data dependency analysis can identify the dependencies between variables in the program data corresponding to the shader, thereby optimizing memory access patterns. Texture sampling frequency analysis can assess the frequency of texture sampling in the shader, avoiding performance bottlenecks caused by oversampling. Program branch structure complexity analysis can assess the complexity of branch statements in the program data corresponding to the shader, thereby avoiding branch divergence that could reduce the processing efficiency of the graphics processing unit.
[0055] S130. Execute the script file to obtain script execution data, and determine the second detection result corresponding to the script file based on the script execution data.
[0056] The script execution data can be understood as the data obtained after executing the script file. Optionally, the script execution data may include resource usage data during script execution and / or execution status data after script execution. Resource usage data may include at least one of the following during script execution: execution time, CPU utilization, memory usage, disk read / write volume, and network transmission volume. Execution status data can be used to determine whether the program data in the script file has been successfully executed. The second detection result can be understood as the detection result corresponding to the script file obtained based on the script execution data. In this embodiment of the disclosure, the purpose of executing the script file is to perform performance evaluation on the program data in the script file to improve the code quality of the program data.
[0057] In this embodiment of the disclosure, the script file is executed. After the script file is executed, script execution data, namely resource usage data and / or execution status data, can be obtained. After obtaining the script execution data, the script execution data can be determined as the detection result corresponding to the script file, namely, the second detection result. In this embodiment of the disclosure, the script execution data can be obtained from the script execution log after the script file is executed, wherein the script execution log records the execution information of the script file, namely, the script execution data.
[0058] S140. Generate a data detection result corresponding to the resource package based on the first detection result and the second detection result.
[0059] In this embodiment of the disclosure, by combining the first and second detection results of the script files in the resource package, the program data quality of the software package can be comprehensively evaluated, so as to discover potential problems in the resource package.
[0060] Specifically, after obtaining the first detection result and the second detection result, the first detection result and the second detection result can be integrated to obtain an integrated result. Thus, based on the integrated result, the data detection result corresponding to the resource package can be obtained. In this embodiment of the disclosure, in order to make the data test results of the resource package clear and intuitive, a structured table can be used to store the integrated result of the first detection result and the second detection result.
[0061] In this embodiment of the disclosure, at least one of the first detection result, the second detection result, and the data detection result may include at least one of the following: detection object information, abnormal state information, detection standard data, and resource package adjustment prompt data. The detection object information can be understood as information about the detection object in the resource package. It can be understood as the object to be detected in the resource package. Optionally, the detection object information may include a detection object identifier and / or an object storage location. The detection object identifier can be used to distinguish different detection objects in the resource package. For example, the detection object may be a function defined in the program data of a script file in the resource package. Then, the detection object identifier may include the function name. Furthermore, the object identifier may also include function input parameter list information and / or function return value information. Alternatively, the detection object identifier may be the function's serial number. The object storage location can be understood as the storage location of the detection object. Taking image data as an example, the object storage location is the storage location of the image data. The abnormal state information can be used to characterize the abnormal state of the detection object. Optionally, the abnormal state information may include an abnormality level. The abnormality level can be used to describe the severity of the abnormality of the detection object.
[0062] The detection standard data serves as a reference standard for determining whether the data detection results are abnormal. In this embodiment, the detection standard data may include minimum standard data and expected standard data. In this embodiment, the minimum standard data ensures that the detection results of the tested object meet basic testing requirements. The minimum standard data provides a guarantee for the basic testing requirements of the tested object's detection results. The expected standard data reflects the expected testing requirement level that the data detection results should achieve. The expected standard data clarifies the testing requirement indicators that the expected data detection results should achieve. The expected standard data can be set according to actual needs. The resource package adjustment prompt data can be understood as prompt data used to guide relevant technical personnel to adjust the resource package.
[0063] In this embodiment of the disclosure, to facilitate timely viewing of the data test results for the resource package by relevant technical personnel, after obtaining the data test results, a prompt message for viewing the data test results can be generated based on the data test results. Upon receiving a trigger operation for the prompt message, the data test results of the resource package are displayed. In this embodiment of the disclosure, generating the prompt message for viewing the data test results based on the data test results may include: generating the prompt message for viewing the data test results based on at least one of the following information in the data test results: detection object information, abnormal status information, detection standard data, and resource package adjustment prompt data.
[0064] In this embodiment of the disclosure, before or after responding to the data detection request, the method may further include: in response to an activation request for detection program data, recording the operations performed by the detection program data when detecting the resource package, to obtain a log file corresponding to the detection program data. The advantage of this approach is that if an anomaly occurs during the detection of the resource package, the root cause of the problem can be quickly traced back through the log file, thereby improving the efficiency and accuracy of anomaly detection.
[0065] The detection program data can be understood as program data used to detect the program data corresponding to the resource package. The enable request can be understood as a request to enable the detection program data. Specifically, the enable request for the detection program data can be obtained by displaying a third interface, wherein the third interface includes a program data enable control for enabling the detection program data; after receiving a control trigger operation applied to the program data enable control, an enable request for the detection program data can be generated.
[0066] Specifically, after receiving an enable request for the detection program data, the resource package can be detected, and the operations performed by the detection program data during the detection of the resource package can be recorded to obtain a log file corresponding to the detection program data. In this embodiment of the disclosure, recording the operations performed by the detection program data during the detection of the resource package includes: creating a blank log file, and writing the operation information performed by the detection program data during the detection of the resource package into the blank log file when the resource package is detected by running the detection program data, so as to obtain a log file corresponding to the detection program data.
[0067] In this embodiment, due to the diversity of resource package functions and their implementation methods, data anomalies may occur during large-scale batch processing of resource package analysis tasks, thereby interfering with the normal operation of the detection program data. To ensure the continuity of large-scale batch processing analysis tasks, avoid task interruption due to anomalies, and effectively retain the data that has been analyzed, this embodiment adopts a series of safeguards during the detection program data startup phase. Specifically, a static instance and a dedicated log file handle are created during the initialization of the detection program data. The static instance can be used to record and save anomaly logs during program execution. The log file handle can serve as a channel for writing log data. Based on this, when new log data needs to be recorded, a forced refresh operation can be triggered to write the log data to the file system immediately, thereby ensuring that the analyzed information can be stored in a timely and reliable manner, and thus obtaining a log file corresponding to the detection program data.
[0068] Based on this, in this embodiment of the disclosure, the static instance created after the detection program data is initialized corresponds to a static log processing function. Therefore, the class name of the class defining the log processing function can be provided to other program data to facilitate their calling of the detection program data. Furthermore, after obtaining the analysis results of the detection program data on the resource package's program data, the analysis results can be written to a specific file or standard output stream to share the analysis results with other applications.
[0069] The technical solution of this disclosure, in response to a data detection request, obtains a resource package to be tested. This allows for automatic acquisition of the resource package based on the received data detection request, and execution of the testing process. Since the resource package includes a script file containing program data describing the processing logic for at least one first resource, the expected data processing operations can be performed through the resource package, enriching its content. Subsequently, by analyzing the program data in the script file, a first detection result corresponding to the script file is obtained, enabling the detection of potential defects or non-compliance with coding standards in the script file without running the program data. Then, by executing the script file, script execution data is obtained, and a second detection result corresponding to the script file is determined based on the script execution data, enabling the detection of potential problems during program execution. Combining static and dynamic detection dimensions achieves accurate detection of the script file. Finally, by generating a data detection result corresponding to the resource package based on the first and second detection results, the technical problems of low detection efficiency and unstable detection results in related technologies' resource package detection methods are solved. This achieves faster and more comprehensive detection of potential problems in the resource package, improving the efficiency and accuracy of data detection.
[0070] Figure 2This is a flowchart illustrating another data detection method provided in this embodiment. The technical solution of this embodiment further optimizes the data testing method based on the above embodiments. Optionally, the resource package further includes a scene configuration file; the scene configuration file is used to describe the application scenario information of the resource package; after obtaining the resource package to be tested, the method further includes: parsing the scene configuration file in the resource package to obtain a first resource to be detected, detecting the first resource according to the resource detection logic corresponding to the first resource, and obtaining a third detection result; generating a data detection result corresponding to the resource package based on the first detection result and the second detection result includes: generating a data detection result corresponding to the resource package based on the first detection result, the second detection result, and the third detection result. For detailed implementation, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here. Figure 2 As shown, the method in this embodiment may specifically include:
[0071] S210. In response to a data detection request, obtain a resource package to be tested, wherein the resource package includes a script file and a scenario configuration file; the script file is program data used to describe the processing logic of at least one first resource; the scenario configuration file is used to describe the application scenario information of the resource package.
[0072] The scenario configuration file can be understood as a configuration file used to describe the application scenario information of the resource package. The file format of the scenario configuration file can be set according to actual needs, and is not specifically limited here. The application scenario information can be understood as the scenario information for applying the resource package.
[0073] S220. Analyze the program data in the script file to obtain a first detection result corresponding to the script file.
[0074] S230. Execute the script file to obtain script execution data, and determine the second detection result corresponding to the script file based on the script execution data.
[0075] S240. Parse the scene configuration file in the resource package to obtain the first resource to be detected, and detect the first resource according to the resource detection logic corresponding to the first resource to obtain the third detection result.
[0076] The first resource to be detected can be understood as the first resource that needs to be detected. The number of first resources to be detected can be one, two, or more. When there are multiple first resources to be detected, their resource types can be the same or different. For example, the first resources to be detected may include image A and video A; or, they may include audio A and 3D model A. The resource detection logic can be understood as predefined logic used to detect the first resource. The resource detection logic corresponding to different types of first resources can be the same or different. The third detection result can be understood as the detection result obtained after detecting the first resource using the resource detection logic corresponding to the first resource.
[0077] Specifically, the scene configuration file in the resource package is parsed to obtain a parsing result. Based on this parsing result, a first resource to be detected can be determined. After determining the first resource to be detected, the resource detection logic corresponding to it can be determined. The first resource can then be detected according to the resource detection logic, thereby obtaining the detection result for the first resource, i.e., the third detection result.
[0078] In this embodiment, parsing the scene configuration file in the resource package to obtain the first resource to be detected may include: parsing the scene configuration file to obtain scene structure data; and querying the scene structure data according to a preset query path to determine the first resource to be detected from multiple scene objects. In this embodiment, multiple scene objects obtained from the analysis of the scene configuration file are organized using scene structure data, and the target resource is directly located through a preset query path without traversing the entire set of scene objects, thereby improving the query efficiency of the first resource.
[0079] The scene structure data is used to record various scene objects and their dependencies. In this embodiment, the scene structure data can organize multiple scene objects through a preset structure. For example, the scene structure data can organize multiple scene objects through a tree structure to achieve hierarchical combination management. Scene objects can be understood as objects in a resource package, such as script files in different programming languages, different types of first resources, and scene object dependencies. The preset query path can be understood as a pre-set path used to query the first resource to be detected from the multiple scene objects.
[0080] Specifically, the scene configuration file is parsed to construct scene structure data based on the parsing results. After obtaining the scene structure data, a preset query path can be determined. A query can then be performed within the scene structure data according to the preset query path. Based on the query results, the scene object corresponding to the preset query path can be determined from among multiple scene objects. Finally, the first resource to be detected is determined based on the scene object corresponding to the preset query path.
[0081] In this embodiment, the third detection result includes a first identifier of the detected first resource. The first identifier can be understood as the identifier of the first resource presented in the resource package. The step of detecting the first resource according to the resource detection logic corresponding to the first resource to obtain the third detection result may include: detecting the first resource according to the resource detection logic corresponding to the first resource to obtain a resource detection result; determining a second identifier corresponding to the first resource in the resource detection logic; determining a first identifier corresponding to the first resource based on the second identifier; and generating a third detection result corresponding to the first resource based on the resource detection result and the first identifier. In this embodiment, the inclusion of the first identifier of the detected first resource in the third detection result facilitates the quick identification of the specific first resource in the resource package by those skilled in the art based on the first identifier.
[0082] The resource detection result can be understood as the resource detection result obtained by detecting the first resource according to the resource detection logic corresponding to the first resource. In this embodiment, the resource detection logic includes a second identifier corresponding to the first resource. The second identifier can be understood as the identifier defined for the first resource in the resource detection logic. In this embodiment, the first identifier and the second identifier of the first resource may be different. In this embodiment, the second identifier of the first resource conforms to the program data syntax specification set for the script file of the resource package. That is, the second identifier is named according to the program data syntax specification set for the script file of the resource package.
[0083] Specifically, the first resource is detected according to the resource detection logic corresponding to the first resource to obtain a resource detection result. After obtaining the resource detection result, a second identifier corresponding to the first resource in the resource detection logic can be determined. Then, based on the correspondence between the first identifier and the second identifier, a first identifier corresponding to the first resource can be determined. After determining the first identifier corresponding to the first resource, a third detection result corresponding to the first resource can be generated based on the resource detection result of the first resource and the first identifier. In this embodiment, the correspondence between the first identifier and the second identifier, that is, the relationship between the identifier presented by the first resource in the resource package and the identifier defined in the resource detection logic, can be a one-to-one correspondence. In this embodiment, generating a third detection result corresponding to the first resource based on the resource detection result of the first resource and the first identifier specifically includes combining the resource detection result of the first resource and the first identifier to obtain a combined result. The combined result can then be determined as the third detection result corresponding to the first resource.
[0084] S250. Generate a data detection result corresponding to the resource package based on the first detection result, the second detection result, and the third detection result.
[0085] Specifically, the first detection result, the second detection result, and the third detection result are integrated and processed to obtain a data detection result corresponding to the resource package based on the result of the integration processing. In this embodiment of the disclosure, at least one of the first detection result, the second detection result, the third detection result, and the data detection result may include at least one of the following: detection object information, abnormal status information, detection standard data, and resource package adjustment prompt data.
[0086] The technical solution of this disclosure embodiment parses the scene configuration file in the resource package to obtain a first resource to be detected, detects the first resource according to the resource detection logic corresponding to the first resource, and obtains a third detection result; then generates a data detection result corresponding to the resource package based on the first detection result, the second detection result and the third detection result, thereby realizing the function of detecting the first resource by parsing the scene configuration file.
[0087] Figure 3This is a flowchart illustrating another data detection method provided in this embodiment. Based on the above embodiments, this embodiment further refines the method of obtaining script execution data by executing the script file, and determining a second detection result corresponding to the script file based on the script execution data. Optionally, the script execution data includes resource processing data; the step of executing the script file to obtain script execution data and determining a second detection result corresponding to the script file based on the script execution data includes: executing the script file to process a second resource through the script file, obtaining resource processing data, and determining a second detection result corresponding to the script file based on the resource processing data. For detailed implementation, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here. Figure 3 As shown, the method in this embodiment may specifically include:
[0088] S310. In response to a data detection request, obtain a resource package to be tested, wherein the resource package includes a script file; the script execution data includes resource processing data.
[0089] The script file is program data used to describe the processing logic for at least one first resource.
[0090] S320. Analyze the program data in the script file to obtain a first detection result corresponding to the script file.
[0091] S330. Execute the script file to process the second resource through the script file, obtain resource processing data, and determine the second detection result corresponding to the script file based on the resource processing data.
[0092] The second resource can be understood as a resource processed using a script file within a resource package. The second resource may include at least one of images, videos, and audio. Resource processing data can be understood as the processing data obtained after processing the second resource using the script file. In this embodiment, the resource processing data may include the resource processing result of the second resource and the resource data consumed during the processing of the second resource. In this embodiment, the purpose of executing the script file to process the second resource and obtain resource processing data is to perform functional verification on the script file, checking whether the processing logic in the script file meets the expected functional requirements and performance standards.
[0093] Specifically, a second resource is acquired. After acquiring the second resource, the script file can be executed. The script file can then be used to process the second resource, yielding a processing result, i.e., resource processing data. After obtaining the resource processing data, a second detection result corresponding to the script file can be determined based on this data.
[0094] In this embodiment, there are multiple ways to obtain the second resource, which are not specifically limited here. For example, a fourth interface is displayed, wherein the fourth interface includes at least one candidate resource; in response to a resource selection operation for the candidate resource, the selected resource, i.e., the second resource, is determined. Alternatively, a fifth interface is displayed, wherein the fifth interface includes a resource shooting control; after receiving a control trigger operation applied to the resource shooting control, a target object can be photographed to obtain the second resource. Or, a resource acquisition request can be sent to a server storing the second resource to receive the resource corresponding to the resource acquisition request, i.e., the second resource, issued by the server.
[0095] In this embodiment of the disclosure, the second resource can be processed through the script file. Specifically, after obtaining the second resource, its storage path can be determined. The storage path of the second resource is passed as an actual parameter to the formal parameter of the resource processing function in the script file used to process the second resource. After the parameter is passed, the resource processing function is executed to read and process the second resource.
[0096] In this embodiment of the disclosure, determining the second detection result corresponding to the script file based on the resource processing data includes: after obtaining the resource processing data of the second resource, determining the minimum standard data for processing the second resource through the script file; comparing the minimum standard data and the resource processing data to obtain a comparison result; and determining the second detection result corresponding to the script file based on the comparison result. It is understood that if the comparison between the minimum standard data and the resource processing data is consistent, it can be determined that the resource processing function in the script file that processes the second resource has passed the functional verification test; if the comparison between the minimum standard data and the resource processing data is inconsistent, it can be determined that the resource processing function in the script file that processes the second resource has failed the functional verification test.
[0097] In this embodiment of the disclosure, after obtaining the resource processing data, the process may further include: displaying the resource processing data. Specifically, after obtaining the resource processing result of the second resource and the resource data consumed when processing the second resource in the resource processing data, the resource processing result of the second resource and the resource data consumed when processing the second resource can be displayed. In this embodiment of the disclosure, there are various ways to display the resource processing result of the second resource and the resource data consumed when processing the second resource, and no specific limitation is made here.
[0098] As an optional implementation of this disclosure, a side-by-side display method can be used to display the resource processing result of the second resource and the resource data consumed when processing the second resource, including: displaying a target interface, wherein the target interface includes a first area and a second area. The first area is used to display the resource processing result of the second resource, and the second area is used to display the resource data consumed when processing the second resource. The resource processing result is displayed in the first area, and the resource data consumed when processing the second resource is displayed in the second area.
[0099] In this embodiment, the first and second regions can be arranged in various ways on the target interface. For example, a left-right layout or a top-bottom layout. In the left-right layout, the first and second regions can be located on the left and right sides of the target interface, respectively. For example, the first region can be located on the left side of the target interface, and the second region can be located on the right side; or, the first region can be located on the right side of the target interface, and the second region can be located on the left side. In the top-bottom layout, the first region can be located at the top, and the second region can be located at the bottom; or, the first region can be located at the bottom, and the second region can be located at the top. Based on this, the size of the first and second regions on the target interface can be preset according to actual needs, or it can be automatically adjusted according to the actual display content. Based on the above embodiments, when there are multiple resource data consumed when processing the second resource, the multiple resource data consumed when processing the second resource can be displayed in the second region according to a preset data arrangement.
[0100] As another optional implementation of this disclosure, an overlay display method can be used to display the resource processing result of the second resource and the resource data consumed when processing the second resource. This includes: first, displaying the resource processing result of the second resource on the target interface. Then, displaying the resource data consumed when processing the second resource at a preset position on the interface displaying the resource processing result, thereby achieving an overlay display effect of the resource processing result of the second resource and the resource data consumed when processing the second resource. The preset position can be set according to actual needs and is not specifically limited here. For example, it can be above the interface displaying the resource processing result (see...). Figure 4 (Data A, Data B, and Data C). In this embodiment of the disclosure, before displaying the resource data consumed when the second resource is processed, the method further includes: adjusting the display effect of the resource data consumed when the second resource is processed (e.g., adjusting the transparency) to improve the aesthetics of the interface.
[0101] S340. Generate a data detection result corresponding to the resource package based on the first detection result and the second detection result.
[0102] The technical solution of this disclosure embodiment achieves functional detection of the second script file by executing the script file to process the second resource, obtaining resource processing data, and determining the second detection result corresponding to the script file based on the resource processing data.
[0103] As an optional embodiment of this disclosure, this disclosure provides a data detection method. Taking the resource package to be tested as an example of a resource package used for special effects processing, the steps for data detection and processing of the resource package used for special effects processing include:
[0104] Step 1: After receiving a data detection request for the resource package to be tested, the script files and scene configuration files in the resource package used for special effects processing can be identified. The script files describe the program data for the processing logic of at least one first resource, and the scene configuration files describe the application scenario information of the resource package.
[0105] The script file is in YAML (Yin't Markup Language) format. The scene configuration file is in YAML format, and its file structure is as follows. Figure 5As shown. In this embodiment of the disclosure, the file format of the script file and the file format of the scene configuration file are the same. Based on this, the same file parsing technology or different file parsing technologies can be used for parsing the script file and the scene configuration file.
[0106] Step 2: Analyze the program data in the script file to obtain a first detection result corresponding to the script file; execute the script file to obtain script execution data, determine a second detection result corresponding to the script file based on the script execution data; parse the scene configuration file in the resource package to obtain a first resource to be detected, and detect the first resource according to the resource detection logic corresponding to the first resource to obtain a third detection result.
[0107] In this embodiment of the disclosure, parsing the scene configuration file in the resource package used for special effects processing to obtain the first resource to be detected includes: converting the scene configuration file in a preset format (e.g., YAML format) into an object defined in a desired programming language (e.g., Python), and assigning multiple scene objects in the scene configuration file to the object defined in the desired programming language. The dependencies between scene objects in the scene configuration file can be obtained through the object defined in the desired programming language. Therefore, a behavior (entities) tree corresponding to the scene configuration file can be established based on the dependencies between the scene objects. The first resource to be detected is obtained by traversing the child nodes corresponding to the component nodes in the behavior tree.
[0108] Step 3: Integrate the first detection result, the second detection result, and the third detection result to generate data detection results corresponding to the resource package used for special effects processing, and display the data detection results.
[0109] For example, the data detection results corresponding to the resource package used for special effects processing can be displayed in tabular form. Figure 6 As shown, the fields in the table format may include detection object information, abnormal status information, minimum standard data, expected standard data, and resource package adjustment prompt data. The detection object information includes the detection object identifier and / or object storage location.
[0110] Furthermore, to visually present the information of detected objects that did not meet the minimum standard data in the data detection results in the table, this information can be highlighted using a first preset display style. The first preset display style may include a first preset font color and / or a first preset font effect. Similarly, to visually present the information of detected objects that did not meet the expected standard data in the data detection results in the table, this information can be highlighted using a second preset display style. This preset display style may include a second preset font color and / or a second preset font effect. It should be noted that the first preset display style and the second preset display style are different. This processing allows for quick differentiation of which detected objects did not meet the minimum or expected standard through different display styles (such as color and / or font style), without needing to view the specific information one by one.
[0111] The technical solution of this disclosure addresses the technical problems of low detection efficiency and unstable detection results in resource package detection methods used for special effects processing in related technologies. It enables faster and more comprehensive detection of potential problems in resource packages used for special effects processing, thereby improving the efficiency and accuracy of data detection.
[0112] Figure 7 This is a schematic diagram of the structure of a data detection device provided in an embodiment of this disclosure, as shown below. Figure 7 As shown, the device includes: a detection request module 410, a script detection module 420, and a result generation module 430. The detection request module 410 is used to obtain a resource package to be tested in response to a data detection request, wherein the resource package includes a script file; the script file is program data describing the processing logic of at least one first resource; the script detection module 420 is used to analyze the program data in the script file to obtain a first detection result corresponding to the script file, and to execute the script file to obtain script execution data, and determine a second detection result corresponding to the script file based on the script execution data; the result generation module 430 is used to generate a data detection result corresponding to the resource package based on the first detection result and the second detection result.
[0113] The technical solution of this embodiment involves a detection request module 410 responding to a data detection request to obtain a resource package to be tested. This allows for automatic acquisition of the resource package based on the received data detection request, and execution of the testing process. Since the resource package includes a script file containing program data describing the processing logic for at least one first resource, the expected data processing operations can be performed through the resource package, enriching its content. Subsequently, the script detection module 420 analyzes the program data in the script file to obtain a first detection result corresponding to the script file. This enables the detection of potential defects or non-compliance with coding standards in the script file without running the program data. Then, by executing the script file, script execution data is obtained. Based on the script execution data, a second detection result corresponding to the script file is determined to detect potential problems during program execution. Combining static and dynamic detection, accurate detection of the script file is achieved. Finally, the result generation module 430 generates data detection results corresponding to the resource package based on the first and second detection results. This solves the technical problems of low detection efficiency and unstable detection results in resource package detection methods in related technologies, and achieves faster and more comprehensive detection of potential problems in the resource package, improving the efficiency and accuracy of data detection.
[0114] Based on any optional technical solution in the embodiments of this disclosure, optionally, the resource package further includes a scenario configuration file; the scenario configuration file is used to describe the application scenario information of the resource package; after obtaining the resource package to be tested, the data detection device further includes a scenario configuration file detection module. The scenario configuration file detection module includes a scenario configuration file parsing unit and a scenario configuration file detection unit; wherein, the scenario configuration file parsing unit is used to parse the scenario configuration file in the resource package to obtain a first resource to be detected; the scenario configuration file detection unit is used to detect the first resource according to the resource detection logic corresponding to the first resource to obtain a third detection result. The result generation module 430 is used to generate a data detection result corresponding to the resource package based on the first detection result, the second detection result, and the third detection result.
[0115] Based on any optional technical solution of the embodiments of this disclosure, optionally, a scene configuration file parsing unit is used to parse the scene configuration file to obtain scene structure data, wherein the scene structure data is used to record multiple scene objects and their dependencies; and to query the scene structure data according to a preset query path to determine the first resource to be detected from the multiple scene objects.
[0116] Based on any optional technical solution of the embodiments of this disclosure, optionally, the third detection result includes a first identifier of the detected first resource; the first identifier is the identifier of the first resource presented in the resource package; the scene configuration file detection unit is used to detect the first resource according to the resource detection logic corresponding to the first resource to obtain a resource detection result; determine a second identifier corresponding to the first resource in the resource detection logic, determine a first identifier corresponding to the first resource according to the second identifier corresponding to the first resource; and generate a third detection result corresponding to the first resource according to the resource detection result of the first resource and the first identifier.
[0117] Based on any optional technical solution of the embodiments of this disclosure, optionally, the script execution data includes resource processing data; the script detection module 420 is used to execute the script file to process the second resource through the script file, obtain resource processing data, and determine the second detection result corresponding to the script file based on the resource processing data.
[0118] Optionally, based on any of the optional technical solutions in the embodiments of this disclosure, the data detection device further includes a resource processing data display module. The resource processing data display module is used to display the resource processing data after it has been obtained.
[0119] Optionally, based on any optional technical solution of the embodiments of this disclosure, the data detection module further includes a log file acquisition module. The log file acquisition module is used to record the operations performed by the detection program data when detecting the resource package, in response to an enable request for detection program data, before or after responding to the data detection request, so as to obtain a log file corresponding to the detection program data.
[0120] Based on any optional technical solution of the embodiments of this disclosure, optionally, the program data includes function data; the function data includes at least one of function identifier, function call data, number of functions, and function execution time; the function call data includes the number of function calls and / or function dependency data.
[0121] Based on any optional technical solution of the embodiments of this disclosure, the first detection result may optionally include execution complexity; the execution complexity includes time complexity and / or arithmetic complexity.
[0122] Based on any optional technical solution of the embodiments of this disclosure, optionally, at least one of the first detection result, the second detection result, and the data detection result includes at least one of the following: detection object information, abnormal status information, detection standard data, and resource package adjustment prompt data; the detection standard data includes minimum standard data and expected standard data; the detection object information includes detection object identifier and / or object storage location.
[0123] The data detection device provided in this disclosure can execute the data detection method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the data detection method.
[0124] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0125] The following is for reference. Figure 8 This illustration shows a structural diagram of an electronic device (e.g., a terminal device or a server) 800 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0126] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the electronic device 800. The processing device 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0127] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, magnetic tapes, hard disks, etc.; and communication devices 809. Communication device 809 allows electronic device 800 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An electronic device 800 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0128] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by a processing device 801, it performs the functions defined in the methods of embodiments of this disclosure.
[0129] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0130] The electronic device provided in this disclosure and the data detection method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this disclosure can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0131] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the data detection method provided in the above embodiments.
[0132] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0133] According to one or more embodiments of this disclosure, [Example 1] provides a data detection method, comprising: in response to a data detection request, acquiring a resource package to be tested, wherein the resource package includes a script file; the script file is program data for describing processing logic for at least one first resource; analyzing the program data in the script file to obtain a first detection result corresponding to the script file; and executing the script file to obtain script execution data, and determining a second detection result corresponding to the script file based on the script execution data.
[0134] Data detection results corresponding to the resource package are generated based on the first detection result and the second detection result.
[0135] According to one or more embodiments of this disclosure, [Example 2] provides the method of Example 1, further comprising: optionally, the resource package further comprising a scenario configuration file; the scenario configuration file being used to describe application scenario information of the resource package; after obtaining the resource package to be tested, further comprising: parsing the scenario configuration file in the resource package to obtain a first resource to be tested, and testing the first resource according to the resource detection logic corresponding to the first resource to obtain a third detection result; the step of generating a data detection result corresponding to the resource package based on the first detection result and the second detection result comprises: generating a data detection result corresponding to the resource package based on the first detection result, the second detection result and the third detection result.
[0136] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 1, which further includes: optionally, parsing the scene configuration file in the resource package to obtain the first resource to be detected includes: parsing the scene configuration file to obtain scene structure data, wherein the scene structure data is used to record multiple scene objects and their dependencies; querying the scene structure data according to a preset query path to determine the first resource to be detected from the multiple scene objects.
[0137] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 1, further comprising: optionally, the third detection result includes a first identifier of the detected first resource; the first identifier is an identifier of the first resource presented in the resource package; the step of detecting the first resource according to the resource detection logic corresponding to the first resource to obtain the third detection result includes: detecting the first resource according to the resource detection logic corresponding to the first resource to obtain a resource detection result; determining a second identifier corresponding to the first resource in the resource detection logic, determining a first identifier corresponding to the first resource according to the second identifier corresponding to the first resource; and generating a third detection result corresponding to the first resource according to the resource detection result of the first resource and the first identifier.
[0138] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, which further includes: optionally, the script execution data includes resource processing data; the step of executing the script file to obtain script execution data and determining a second detection result corresponding to the script file based on the script execution data includes: executing the script file to process a second resource through the script file to obtain resource processing data, and determining a second detection result corresponding to the script file based on the resource processing data.
[0139] According to one or more embodiments of this disclosure, Example Six provides the method of Example One, which further includes: optionally, after obtaining the resource processing data, displaying the resource processing data.
[0140] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 1, which further includes: optionally, before or after responding to the data detection request, recording the operations performed by the detection program data when detecting the resource package in response to an enable request for detection program data, so as to obtain a log file corresponding to the detection program data.
[0141] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 1, which further includes: optionally, the program data includes function data; the function data includes at least one of function identifier, function call data, function quantity, and function execution time; the function call data includes function call count and / or function dependency data.
[0142] According to one or more embodiments of this disclosure, Example 9 provides the method of Example 1, which further includes: optionally, the first detection result includes execution complexity; the execution complexity includes time complexity and / or arithmetic complexity.
[0143] According to one or more embodiments of this disclosure, Example 10 provides the method of Example 1, which further includes: Optionally, at least one of the first detection result, the second detection result, and the data detection result includes at least one of detection object information, abnormal status information, detection standard data, and resource package adjustment prompt data; the detection standard data includes minimum standard data and expected standard data; the detection object information includes detection object identifier and / or object storage location.
[0144] According to one or more embodiments of this disclosure, Example 11 provides a data detection apparatus, comprising: a detection request module, configured to, in response to a data detection request, acquire a resource package to be tested, wherein the resource package includes a script file; the script file is program data describing processing logic for at least one first resource; a script detection module, configured to analyze the program data in the script file to obtain a first detection result corresponding to the script file, and execute the script file to obtain script execution data, and determine a second detection result corresponding to the script file based on the script execution data; and a result generation module, configured to generate a data detection result corresponding to the resource package based on the first detection result and the second detection result.
[0145] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0146] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0147] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the one or more programs, the electronic device causes the following actions: in response to a data detection request, it acquires a resource package to be tested, wherein the resource package includes a script file; the script file is program data describing processing logic for at least one first resource; it analyzes the program data in the script file to obtain a first detection result corresponding to the script file; and it executes the script file to obtain script execution data, determines a second detection result corresponding to the script file based on the script execution data; and generates a data detection result corresponding to the resource package based on the first detection result and the second detection result.
[0148] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0150] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the units are not necessarily limiting in certain circumstances; for example, a result generation module can also be described as "a module for generating data detection results corresponding to the resource package".
[0151] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0152] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0153] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0154] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0155] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A data detection method, characterized in that, include: In response to a data detection request, a resource package to be tested is obtained, wherein the resource package includes a script file; the script file is program data used to describe the processing logic for at least one first resource; The program data in the script file is analyzed to obtain a first detection result corresponding to the script file, and the script file is executed to obtain script execution data. A second detection result corresponding to the script file is determined based on the script execution data. Data detection results corresponding to the resource package are generated based on the first detection result and the second detection result.
2. The data detection method according to claim 1, characterized in that, The resource package also includes scene configuration files; The scenario configuration file is used to describe the application scenario information of the resource package; after obtaining the resource package to be tested, it also includes: The scenario configuration file in the resource package is parsed to obtain the first resource to be detected. The first resource is then detected according to the resource detection logic corresponding to the first resource to obtain the third detection result. The step of generating data detection results corresponding to the resource package based on the first detection result and the second detection result includes: Data detection results corresponding to the resource package are generated based on the first detection result, the second detection result, and the third detection result.
3. The data detection method according to claim 2, characterized in that, The step of parsing the scene configuration file in the resource package to obtain the first resource to be detected includes: The scene configuration file is parsed to obtain scene structure data, wherein the scene structure data is used to record various scene objects and their dependencies. The scene structure data is queried according to a preset query path to determine the first resource to be detected from multiple scene objects.
4. The data detection method according to claim 2, characterized in that, The third detection result includes the first identifier of the detected first resource; the first identifier is the identifier of the first resource presented in the resource package; The step of detecting the first resource according to the resource detection logic corresponding to the first resource to obtain a third detection result includes: The first resource is detected according to the resource detection logic corresponding to the first resource, and the resource detection result is obtained; Determine the second identifier corresponding to the first resource in the resource detection logic, and determine the first identifier corresponding to the first resource based on the second identifier corresponding to the first resource; A third detection result corresponding to the first resource is generated based on the resource detection result of the first resource and the first identifier.
5. The data detection method according to claim 1, characterized in that, The script execution data includes resource processing data; executing the script file to obtain script execution data, and determining the second detection result corresponding to the script file based on the script execution data, includes: The script file is executed to process the second resource, obtain resource processing data, and determine the second detection result corresponding to the script file based on the resource processing data.
6. The data detection method according to claim 5, characterized in that, After obtaining the resource processing data, the following is also included: Display the resource processing data.
7. The data detection method according to claim 1, characterized in that, The response, whether before or after the data detection request, also includes: In response to an enable request for detection program data, the operations performed by the detection program data when detecting the resource package are recorded to obtain a log file corresponding to the detection program data.
8. The data detection method according to claim 1, characterized in that, The program data includes function data; the function data includes at least one of function identifier, function call data, number of functions, and function execution time; the function call data includes the number of function calls and / or function dependency data.
9. The data detection method according to claim 1, characterized in that, The first detection result includes execution complexity; the execution complexity includes time complexity and / or arithmetic complexity.
10. The data detection method according to claim 1, characterized in that, The first detection result, the second detection result, and at least one of the data detection results include at least one of the following: detection object information, abnormal status information, detection standard data, and resource package adjustment prompt data; the detection standard data includes minimum standard data and expected standard data; the detection object information includes the detection object identifier and / or object storage location.
11. A data detection device, characterized in that, include: The detection request module is used to respond to a data detection request and obtain a resource package to be tested, wherein the resource package includes a script file; the script file is program data used to describe the processing logic of at least one first resource; The script detection module is used to analyze the program data in the script file to obtain a first detection result corresponding to the script file, and to execute the script file to obtain script execution data, and to determine a second detection result corresponding to the script file based on the script execution data. The result generation module is used to generate data detection results corresponding to the resource package based on the first detection result and the second detection result.
12. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the data detection method as described in any one of claims 1-10.
13. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the data detection method as described in any one of claims 1-10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data detection method as described in any one of claims 1-10.