Error report detection method and device for geometric modeling engine, equipment and medium

By deploying parameter parsing error scripts in the geometric modeling engine, and using error detection functions to detect and output exception information, the problem of inefficient testing of error mechanisms and inconsistent processing standards is solved, efficient and intuitive error recognition and correction are achieved, and the accuracy and scalability of the test are improved.

CN120407392AActive Publication Date: 2025-08-01粤港澳大湾区(广东)国创中心
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510270621.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-08-01
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

The error reporting mechanism test of the existing geometric modeling engine is inefficient and unintuitive, the processing standards are not unified, and the scalability is poor, making it difficult to effectively identify and classify errors.

Method used

By deploying parameter parsing error scripts in the geometric modeling engine, using parameter parsing list classes and error detection functions, obtain error use cases, analyze model parameters, extract target error detection functions, detect and output parameter exception information and correction information.

Benefits of technology

It improves the fault tolerance of the error reporting mechanism, ensures the consistency and scalability of processing standards, enables users to efficiently and intuitively discover potential risks of parameter analysis, and improves the accuracy and efficiency of functional testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407392A_ABST
    Figure CN120407392A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an error detection method and device for a geometric modeling engine, equipment and a medium, and relates to the technical field of software detection.The method comprises the steps that an error case used for being executed in the geometric modeling engine is obtained; analyzing the wrong use case to obtain a model parameter corresponding to the wrong use case and a parameter number corresponding to the model parameter; extracting at least one target error detection function from the error detection functions according to the parameter quantity; and detecting the parameter abnormality of the model parameter through the target error detection function, and outputting parameter abnormality information and parameter correction information for the error case, thereby enhancing the fault-tolerant capability of an error reporting mechanism, enabling a user to efficiently and intuitively perceive the corresponding abnormality, and improving the user experience. Potential risks existing in parameter analysis can be found easily, consistency and expandability of processing standards can be guaranteed through an error detection function, and actual requirements of users can be met easily.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software detection, and in particular to an error detection method for a geometric modeling engine, an error detection device for a geometric modeling engine, an electronic device, and a computer-readable storage medium. Background Art

[0002] A geometric modeling engine (also known as a geometric kernel) is the core underlying support in industrial software. By providing key technical support for 3D modeling, it can precisely and efficiently process complex geometric elements and functions. Functional testing is a key step in improving the related functions of the geometric modeling engine. By using a test platform and test cases, it can be verified whether the related functions of the geometric kernel can work as expected, so as to discover whether there are defects and errors in the modeling function of the geometric kernel through corresponding tests, and ensure the accuracy of the model and the reliability of the function.

[0003] Among them, testing the error reporting mechanism of the geometric modeling engine is one of the core functions of the test platform. The error reporting mechanism ensures that errors can be detected and processed in a timely manner during the design and modeling process, and improves the corresponding functions. The geometric modeling engine test platform needs to be able to identify and classify various errors, establish an exception handling mechanism, and perform condition detection and exception throwing. However, during the process of testing the error reporting mechanism of the geometric modeling function related to the geometric modeling engine, there are problems such as low testing efficiency, lack of intuitiveness, inconsistent processing standards, and poor scalability of the error reporting mechanism. Summary of the Invention

[0004] Embodiments of the present invention provide an error detection method, device, equipment, and medium for a geometric modeling engine to solve or partially solve the problems of low testing efficiency, lack of intuitiveness, inconsistent processing standards, and poor scalability of the error reporting mechanism during the process of testing the error reporting mechanism of the geometric modeling function related to the geometric modeling engine.

[0005] Embodiments of the present invention disclose an error detection method for a geometric modeling engine, which is applied to the geometric modeling engine. A parameter parsing error script is deployed in the geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. The method includes:

[0006] Obtain an error case for execution in the geometric modeling engine;

[0007] Parse the error case to obtain the model parameters corresponding to the error case and the number of parameters corresponding to the model parameters;

[0008] Extract at least one target error detection function from the error detection functions according to the number of parameters;

[0009] The parameter anomalies existing in the model parameters are detected through the target error detection function, and parameter anomaly information and parameter correction information for the error use case are output.

[0010] An embodiment of the present invention also discloses an error reporting detection device for a geometric modeling engine, which is applied to the geometric modeling engine. A parameter parsing error script is deployed in the geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. The device includes:

[0011] A use case acquisition module, configured to acquire error use cases to be executed in the geometric modeling engine;

[0012] A parameter determination module, configured to parse the error use case to obtain the model parameters corresponding to the error use case and the number of parameters corresponding to the model parameters;

[0013] A function extraction module, configured to extract at least one target error detection function from the error detection functions according to the number of parameters;

[0014] A detection module, configured to detect the parameter anomalies existing in the model parameters through the target error detection function, and output parameter anomaly information and parameter correction information for the error use case.

[0015] An embodiment of the present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;

[0016] The memory is used to store a computer program; [[ID=A]] [[ID=B]]

[0017] When the processor is configured to execute the program stored in the memory, the method described in the embodiment of the present invention is implemented.

[0018] An embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored. When executed by one or more processors, the processors are caused to execute the method described in the embodiment of the present invention.

[0019] The embodiments of the present invention have the following advantages:

[0020] In an embodiment of the present invention, a user can deploy a corresponding parameter parsing error script in a geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. During the process of the user testing the geometric modeling function through the geometric modeling engine, the geometric modeling engine can obtain error use cases to be executed in the geometric modeling engine through the parameter parsing error script, parse the error use cases to obtain the model parameters corresponding to the error use cases and the number of parameters corresponding to the model parameters, and then extract at least one target error detection function from the error detection functions according to the number of parameters. If it is detected through the target error detection function that there are parameter anomalies in the model parameters, parameter anomaly information and parameter correction information for the error use cases are output. Thus, by constructing a corresponding parameter parsing error script, the error reporting mechanism of the geometric modeling engine is improved, the fault tolerance ability of the error reporting mechanism is enhanced, so that during the process of the user testing the geometric modeling function through the geometric modeling engine, the parameter parsing error script can detect corresponding error use cases, and when an anomaly is detected, output corresponding parameter anomaly information and parameter correction information, enabling the user to efficiently and intuitively perceive the corresponding anomaly, which is beneficial to discovering potential risks existing in parameter parsing, and the consistency and scalability of the processing standard can be ensured through the error detection function, which is beneficial to meeting the actual needs of the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flowchart of the steps of a method for error reporting detection for a geometric modeling engine provided in an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of an application scenario provided in an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of an application scenario provided in an embodiment of the present invention;

[0024] Figure 4 is a block diagram of the structure of an error reporting detection device for a geometric modeling engine provided in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] As an example, a geometric modeling engine (also known as a geometric kernel) is the core underlying support in industrial software. By providing key technical support for 3D modeling, it can precisely and efficiently process complex geometric elements and functions. Functional testing is a crucial step in improving the functions of the geometric modeling engine. Among them, by using a test platform and test cases, it is possible to verify whether the relevant functions of the kernel can work as expected, discover defects and errors in the modeling functions, and ensure the accuracy of the model and the reliability of the functions.

[0027] Among them, testing the error reporting mechanism of the geometric modeling engine is one of the core functions of the test platform. The error reporting mechanism ensures that errors can be detected and processed in a timely manner during the design and modeling processes, and improves the corresponding functions. The geometric modeling engine test platform needs to be able to identify and classify various errors, establish an exception handling mechanism, perform condition checks, and throw exceptions. However, there are the following deficiencies in the current testing process of the geometric modeling engine error reporting mechanism:

[0028] (1) Lack of error cases, and the testing of the error reporting mechanism is inefficient and not intuitive

[0029] Although different geometric modeling engine manufacturers currently have their own error reporting mechanisms, the testing and verification of the error reporting mechanisms are not perfect, resulting in the inefficiency and lack of intuitiveness of the error reporting mechanisms, which is not conducive to discovering potential risks in the parameter parsing of functional functions.

[0030] (2) The error handling standards are not unified, and the scalability of the error reporting mechanism is poor

[0031] Due to the large number of functional functions, diverse input parameter types, and a huge number of test cases, the error handling standards have not been unified, and the error reporting mechanism has not been used in a standardized manner. This has made it difficult for the parameter parsing error reporting mechanism to complete its testing and verification functions. When expanding new functional functions, the lack of a unified error standard will also make the detection of new functions complex, and the functions are difficult to verify, which is not conducive to subsequent function maintenance and updates.

[0032] In view of this, in the present invention, by constructing a corresponding parameter parsing error script, the modeling function of the geometric modeling engine is detected by the parameter parsing error script to determine whether there is an abnormality in the modeling function and ensure the stability of the modeling function. Specifically, the user can deploy the corresponding parameter parsing error script in the geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. During the process of the user testing the geometric modeling function through the geometric modeling engine, the geometric modeling engine can obtain the error cases to be executed in the geometric modeling engine through the parameter parsing error script, parse the error cases, obtain the model parameters corresponding to the error cases and the number of parameters corresponding to the model parameters, and then extract at least one target error detection function from the error detection functions according to the number of parameters. If the model parameters are detected to have parameter abnormalities through the target error detection function, the parameter abnormality information and parameter correction information for the error cases are output. Thus, by constructing the corresponding parameter parsing error script, the error reporting mechanism of the geometric modeling engine is improved, and the fault tolerance ability of the error reporting mechanism is enhanced. During the process of the user testing the geometric modeling function through the geometric modeling engine, the parameter parsing error script can detect the corresponding error cases, and when an abnormality is detected, output the corresponding parameter abnormality information and parameter correction information, enabling the user to efficiently and intuitively perceive the corresponding abnormality, which is beneficial to discovering the potential risks existing in parameter parsing, and the consistency and scalability of the processing standard can be ensured through the error detection function, which is beneficial to meeting the actual needs of the user.

[0033] Referring to Figure 1 , a flowchart of the steps of a method for error reporting detection for a geometric modeling engine provided in an embodiment of the present invention is shown. The method is applied to a geometric modeling engine, and a parameter parsing error script is deployed in the geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. Specifically, the following steps may be included:

[0034] Step 101, obtain error cases to be executed in the geometric modeling engine;

[0035] For a geometric modeling engine, it can be a software library or tool for creating, editing, and analyzing geometric models (such as cuboids, cylinders, spheres, etc.). For example, it can be used for the creation and editing of geometric bodies, Boolean operations (such as union, difference, and intersection, etc.), transformation of geometric bodies (such as translation, rotation, scaling, etc.), and calculation of geometric body attributes (such as volume, surface area, etc.).

[0036] Among them, in order to ensure that the geometric modeling engine can accurately and efficiently process complex geometric elements and functions, before formally performing geometric modeling, the user can first conduct functional tests on the relevant geometric modeling functions in the geometric modeling engine to verify whether the geometric modeling functions of the geometric modeling engine can work as expected, so as to discover defects and errors in the modeling functions, etc., and ensure the accuracy of the model objects constructed during the modeling process and the reliability of the functions.

[0037] In the embodiment of the present invention, in order to test the error reporting mechanism of the modeling function in the geometric modeling engine, a corresponding parameter parsing error script (hereinafter referred to as the script) can be constructed and deployed in the geometric modeling engine. By inputting corresponding error cases, the parameter parsing error script analyzes the parameter anomalies existing in the error cases to verify whether the modeling function in the geometric modeling engine can work as predicted.

[0038] It should be noted that for the parameter parsing error script, it can be a script used to serve the functional test of the geometric modeling engine for the modeling function. The user can define relevant contents such as an error record structure for recording error information, a parameter parsing list class, and an error prompt category in the script to implement the functional test of the geometric modeling engine.

[0039] Among them, in the parameter parsing error script, an error record structure PyErrorInfo for recording error information is defined, which includes the following error information:

[0040] (1) The error code prompt message m_ErrorCode provides a diagnostic conclusion for the parameter error type.

[0041] PY_ARGUMENT_NO_ERROR indicates that the parameter is normal.

[0042] PY_ARGUMENT_NUM_ERROR (parameter quantity anomaly) indicates that the parameter quantities are inconsistent. PY_ARGUMENT_TYPE_ERROR (parameter type anomaly) indicates that the parameter type is incorrect.

[0043] (2) The error position index m_ErrorIndex, of Int type, is used to indicate the index position where the error parameter exists, with a default value of -1, which changes with the parameter parsing and reading process.

[0044] (3) The correct parameter quantity m_CorrectNumber, of Int vector type, is used to display the correct parameter quantity of the function. Since the function may have overloaded cases, the Int vector type is used for storage.

[0045] (4) The correct parameter type m_correctType, an Int vector type, is used to prompt how to correct an incorrect parameter type to the correct one and is stored backward as the parameter parsing and reading process progresses.

[0046] In addition, in the parameter parsing error script, a parameter parsing list class and an error prompt category can also be defined. Denote the PyArgList class as the parameter parsing list class, which contains two member variables and several error checking function declarations.

[0047] The member variables include:

[0048] PyObject* m_PyObject, the object pointer of the entity model, used to point to the entity model object.

[0049] PyErrorInfo* m_ErrorInfo, the error code pointer, used to record relevant error information.

[0050] The function declarations include:

[0051] Size(): Obtain the number of parameters.

[0052] IsNull(): Determine whether the object pointer of the entity model is null.

[0053] ClearErrorInfo(): Reset the error code pointer.

[0054] GetDouble: Compare whether the corresponding parameter is of the NUMBER type (i.e., check whether the parameter is a numeric type) (double or int type). If the type is incorrect, the m_ErrorCode of the error code pointer m_ErrorInfo points to PY_ARGUMENT_TYPE_ERROR, m_ErrorIndex corresponds to the position of the incorrect parameter, and m_correctType corresponds to the correct parameter type. In addition, for error checking functions such as GetBoolean (i.e., check whether the parameter is a boolean type), GetLong (i.e., check whether the parameter is a long integer type), GetStr (i.e., check whether the parameter is a string type), GetPosition (i.e., check whether the parameter is a custom type), etc., they are similar, and corresponding parameter checking functions can be extended according to specific functional functions.

[0055] After completing the configuration of the parameter parsing error script, the user can also develop the doc.CheckPython function to check the Python parameter parsing situation of the command. Specifically, if it is correct, it returns 1, and if it is incorrect, it returns 0. The CheckPython function has the following three overloaded types:

[0056] (1) The parameter parsing is correct

[0057] doc.CheckPython(PY_ARGUMENT_NO_ERROR).

[0058] (2) Check the number of parameters

[0059] doc.CheckPython(PY_ARGUMENT_TYPE_ERROR, [PY_DATA_NUMBER], num).

[0060] The first parameter PY_ARGUMENT_TYPE_ERROR represents parameter error checking, the second parameter [PY_DATA_NUMBER] represents performing the parameter number judgment, and the third parameter num represents the number of parameters to be checked.

[0061] For example, to check if the number of parameters is 5:

[0062] doc.CheckPython(PY_ARGUMENT_TYPE_ERROR, [PY_DATA_NUMBER], 5).

[0063] (3) Check the parameter types

[0064] doc.CheckPython(PY_ARGUMENT_TYPE_ERROR, [PY_DATA_Type], index).

[0065] The first parameter PY_ARGUMENT_TYPE_ERROR represents parameter error checking, the second parameter PY_DATA_Type represents performing the corresponding type parameter type judgment, and the third parameter index represents the parameter position index to be checked. For example, to check if the third parameter (since the array index starts from 0, the index of the third parameter should be 2) is of the point coordinate type doc.CheckPython(PY_ARGUMENT_TYPE_ERROR, [PY_DATA_POINT], 2).

[0066] By handling the exceptions existing in the above parameter parsing process, different parameter exceptions can correspond to corresponding error codes, and a parameter parsing error reporting mechanism for the geometric modeling engine can be obtained. Based on this parameter parsing error reporting mechanism, through unified standards, standardized triggering conditions, clear error prompts, etc., it can provide efficient and stable technical support for the parameter parsing test and verification of the modeling function of the geometric modeling engine.

[0067] In addition, the error cases can be geometric modeling cases configured by the user. The error cases can be configured according to the actual exceptions to be reported during testing. For example, the error cases can be configured as cases with incorrect parameter numbers, or as cases with incorrect parameter types, or as cases with both incorrect parameter numbers and incorrect parameter types, etc., so as to verify the error reporting mechanism of the geometric modeling engine by executing the error cases and testing whether the geometric modeling engine will report errors for the corresponding exceptions. The present invention places no restrictions on this.

[0068] Step 102: Parse the error case to obtain the model parameters corresponding to the error case and the number of parameters corresponding to the model parameters.

[0069] In a specific implementation, after determining the error case, the error case can be imported into the geometric modeling engine for functional testing. The parameter parsing error script can parse the error case to obtain the model parameters corresponding to the error case and the number of parameters corresponding to the model parameters, so as to detect the model parameters, the number of parameters, etc., and identify the parameter exceptions corresponding to the error case.

[0070] Step 103: Extract at least one target error detection function from the error detection functions according to the number of parameters.

[0071] After determining the number of parameters, since different numbers of parameters can correspond to different error detection functions, at least one target error detection function can be extracted from the error detection functions according to the number of parameters, so as to extract targeted error detection functions to detect the error cases and improve the accuracy of functional testing. Among them, the error detection functions can include functions such as detecting whether the model parameters are of numerical type, detecting whether the model parameters are of boolean type, detecting whether the model parameters are of long integer type, detecting whether the model parameters are of string type, and detecting whether the model parameters are of custom type, etc. The present invention places no restrictions on this.

[0072] In some feasible implementation manners, the target error detection function extracted according to the number of parameters may at least include one of a numerical error detection function and a custom error detection function. Specifically, if the number of parameters is the first number, the numerical error detection function is extracted from the error detection functions; if the number of parameters is the second number, the numerical error detection function and the custom error detection function are extracted from the error detection functions. Further, the parameter exception information includes parameter number exception information, and the parameter correction information at least includes number correction information. If the number of parameters is not the first number or the second number, the parameter number exception information for the error case and the number correction information corresponding to the parameter number exception information are output. Thus, through the number of parameters corresponding to the model parameters, the error checking function can be accurately extracted, and the model parameters in the error case can be detected based on the extracted error checking function, which can effectively improve the accuracy of the functional test.

[0073] Optionally, for the first number and the second number, the two can be different values to distinguish that different numbers of model parameters need to be detected using different error checking functions to ensure the accuracy of the detection. For example, the first number can be 5, the second number can be 6, etc. That is, when the model parameters corresponding to the error case are 5, they can be detected through the numerical error detection function; when the model parameters corresponding to the error case are 6, they can be detected through the numerical error detection function and the custom error detection function, etc. The present invention is not limited thereto.

[0074] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that those skilled in the art can also set other error detection functions and corresponding parameter numbers according to actual needs under the guidance of the idea of the embodiments of the present invention. The present invention is not limited thereto.

[0075] Step 104, detecting the parameter exceptions existing in the model parameters through the target error detection function, and outputting the parameter exception information and the parameter correction information for the error case.

[0076] After determining the target error detection function, the model parameters in the error case can be detected by the extracted target error detection function to identify the parameter anomalies corresponding to the error case, and the parameter anomaly information and parameter correction information for the error case can be output. Thus, by constructing the corresponding parameter parsing error script, the error reporting mechanism of the geometric modeling engine can be improved, the fault tolerance of the error reporting mechanism can be enhanced, so that during the process of testing the geometric modeling function by the user through the geometric modeling engine, the parameter parsing error script can detect the corresponding error case, and when an anomaly is detected, output the corresponding parameter anomaly information and parameter correction information, enabling the user to efficiently and intuitively perceive the corresponding anomaly, which is beneficial to discovering the potential risks existing in parameter parsing, and the error detection function can ensure the consistency and scalability of the processing standard, which is beneficial to meeting the actual needs of the user.

[0077] In some feasible implementation manners, as in the above embodiment, the parameter parsing error script may include an error record structure. The parameter anomaly information includes at least one of parameter quantity anomaly information and parameter type anomaly information. The parameter correction information includes quantity correction information and type correction information. If the target error detection function detects that there is a parameter quantity anomaly in the model parameters, the error record structure outputs the parameter quantity anomaly information and quantity correction information for the error case; if the target error detection function detects that there is a parameter type anomaly in the model parameters, the error record structure outputs the parameter type anomaly information and type correction information for the error case; if the target error detection function detects that there is a parameter quantity anomaly and a parameter type anomaly in the model parameters, the error record structure outputs the parameter quantity anomaly information and parameter type anomaly information for the error case, as well as the quantity correction information and type correction information corresponding to the error case.

[0078] In a specific implementation, the parameter parsing error script further includes an error code pointer. The error record structure at least includes error code prompt information and correct parameter information. The correct parameter information at least includes standard quantity information. Then, during the process of identifying the parameter quantity anomaly, the first error code prompt information used to present the parameter quantity anomaly of the error case can be determined from the error code prompt information in the error record structure through the error code pointer, and the first error code prompt information is used as the parameter quantity anomaly information for the error case; the standard quantity information is used as the quantity correction information for the error case.

[0079] In addition, the correct parameter information further includes standard type information. During the recognition process of parameter type exceptions, the second error code hint information used to present the parameter type exception of the error case can be determined from the error code hint information in the error record structure through the error code pointer, and the second error code hint information is used as the parameter type exception information for the error case; the standard type information is used as the type correction information for the error case.

[0080] In addition, the error record structure may further include an error location index. Whether it is a parameter quantity exception or a parameter type exception, the target model parameter where the parameter quantity exception and / or parameter type exception occurs can be located through the error code pointer, the parameter position corresponding to the target model parameter can be determined, and then the parameter position is assigned to the error location index.

[0081] Through the above process, the parameter exceptions corresponding to the error cases can be accurately recorded through the error record structure in the parameter parsing error script, effectively verifying the modeling function and error reporting mechanism of the geometric modeling engine. While enhancing the fault tolerance of the error reporting mechanism, it is verified whether the geometric modeling engine can execute as expected by the user. At the same time, based on the parameter exception information, correction information, and position index, etc., the corresponding parameter exceptions can be presented efficiently and intuitively, which is conducive to the user discovering the potential risks existing in parameter parsing, and through the error detection function, the consistency and scalability of the processing standard can be ensured, which is conducive to meeting the actual needs of the user.

[0082] In some examples, when the parameter quantity is normal, if the parameter quantity is the first quantity, the parameter sequence corresponding to each model parameter is determined; according to the sorting order corresponding to the parameter sequence, it is judged whether each first model parameter after the nth model parameter in the model parameters is of a numerical type through the numerical error detection function; if there is at least one first model parameter that is not of a numerical type, the parameter type exception information and type correction information for the error case are output.

[0083] In other examples, when the parameter quantity is normal, if the parameter quantity is the second quantity, the parameter sequence corresponding to each model parameter is determined; according to the sorting order corresponding to the parameter sequence, it is judged whether the mth model parameter in the model parameters is of a custom type through the custom type detection function, and it is judged whether each second model parameter after the mth model parameter in the model parameters is of a numerical type through the numerical error detection function; if the mth model parameter is not of a custom type, and / or there is at least one second model parameter that is not of a numerical type, the parameter type exception information and type correction information for the error case are output.

[0084] For example, assume that the first quantity is 5 and n is 2. When the number of parameters is normal, if the number of model parameters corresponding to the error case is 5, then according to the sorting order of the model parameters in the error case, it is possible to determine whether the 3rd, 4th, and 5th model parameters in the model parameters are numerical types through the numerical error detection function. If at least one of the 3rd, 4th, and 5th model parameters is not a numerical type, then output the parameter type exception information and type correction information for the error case.

[0085] Assume that the second quantity is 6 and m is 3. When the number of parameters is normal, if the number of model parameters corresponding to the error case is 6, then according to the sorting order of the model parameters in the error case, it is possible to determine whether the 3rd model parameter is a coordinate type through the custom detection function, and determine whether the 4th, 5th, and 6th model parameters in the model parameters are numerical types through the numerical error detection function. If the 3rd model parameter is not a coordinate type, and / or at least one of the 4th, 5th, and 6th model parameters is not a numerical type, then output the parameter type exception information and type correction information for the error case, so as to effectively verify the modeling function and error reporting mechanism of the geometric modeling engine. While enhancing the fault tolerance of the error reporting mechanism, it is verified whether the geometric modeling engine can be executed according to the user's expectations. At the same time, based on the parameter exception information, correction information, and position index, etc., the corresponding parameter exceptions can be presented efficiently and intuitively, which is beneficial for users to discover the potential risks existing in parameter parsing, and the consistency and scalability of the processing standard can be ensured through the error detection function, which is beneficial to meet the actual needs of users.

[0086] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that those skilled in the art can also set according to actual needs under the guidance of the ideas of the embodiments of the present invention, and the present invention does not limit this.

[0087] In an embodiment of the present invention, a user can deploy a corresponding parameter parsing error script in a geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class includes at least an error detection function. During the process of the user testing the geometric modeling function through the geometric modeling engine, the geometric modeling engine can obtain, through the parameter parsing error script, error use cases to be executed in the geometric modeling engine, parse the error use cases to obtain model parameters corresponding to the error use cases and the number of parameters corresponding to the model parameters, and then extract at least one target error detection function from the error detection functions according to the number of parameters. If it is detected through the target error detection function that there are parameter anomalies in the model parameters, parameter anomaly information and parameter correction information for the error use cases are output. Thus, by constructing a corresponding parameter parsing error script, the error reporting mechanism of the geometric modeling engine is improved, the fault tolerance of the error reporting mechanism is enhanced, so that during the process of the user testing the geometric modeling function through the geometric modeling engine, the parameter parsing error script can detect corresponding error use cases, and in the case of detecting anomalies, output corresponding parameter anomaly information and parameter correction information, enabling the user to efficiently and intuitively perceive corresponding anomalies, which is conducive to discovering potential risks existing in parameter parsing, and through the error detection function, the consistency and scalability of processing standards can be ensured, which is conducive to meeting the actual needs of users.

[0088] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following provides an exemplary illustration through corresponding examples:

[0089] In one example, referring to Figure 2 , a schematic diagram of an application scenario provided in an embodiment of the present invention is shown, and an exemplary illustration is made using the parameter parsing error code for creating a cuboid model. Specifically:

[0090] (1) There are two overloading examples of the function for creating a cuboid model. One is to pass in the command name, shape name, length of the cuboid, width of the cuboid, and height of the cuboid, a total of 5 parameters; the other is to pass in the command name, shape name, point coordinates, length of the cuboid, width of the cuboid, and height of the cuboid, a total of 6 parameters.

[0091] First, it is necessary to judge the number of parameters. First, extract all the parameters and store them in an array. If the number of parameters is not 5 or 6, then errorInfo->m_ErrorCode = PY_ARGUMENT_NUM_ERROR; and the error code will prompt the correct parameter number information errorInfo->m_CorrectNumber.push_back(5); errorInfo->m_CorrectNumber.push_back(6).

[0092] (2) Use the GetStr function to determine whether the shape name of the second parameter is of string type.

[0093] (3) For overloaded cases, proceed as follows:

[0094] If the number of parameters is 5, use the GetDouble function to determine whether the 3rd, 4th, and 5th parameters are of NUMBER type. If they are not of NUMBER type (double or int type), then obtain

[0095] m_ErrorInfo->m_ErrorCode = PY_ARGUMENT_TYPE_ERROR;

[0096] m_ErrorInfo->m_ErrorIndex points to the position index of the error parameter.

[0097] m_ErrorInfo->m_correctType.push_back(PY_DATA_NUMBER); Obtain the correct parameter type.

[0098] If the number of parameters is 6, first use the GetPosition function to determine whether the 3rd parameter is of point coordinate type, and then use the GetDouble function to determine whether the 4th, 5th, and 6th parameters are of NUMBER type.

[0099] (4) If both the number of parameters and the parameter types are correct, the error code pointer should be the initial default value, i.e.,

[0100] m_ErrorInfo->m_ErrorCode = PY_ARGUMENT_NO_ERROR;

[0101] m_ErrorInfo->m_ErrorIndex = -1;

[0102] (5) The doc.CheckPython function can be used to check the Python parameter parsing of the command. Through specific use cases, it is possible to test and verify whether the functional function runs as expected.

[0103] In another example, referring to Figure 3 , a schematic diagram of the application scenario provided in the embodiment of the present invention is shown, and the use of the parameter parsing error code of the rotation model is used for exemplary illustration. Specifically:

[0104] The rotation operation rotates according to the rotation center, rotation axis, and rotation angle. Rotating multiple shapes simultaneously is supported. The shapes to be rotated can be solids, vertices, lines, or faces. Its input parameters are the command name, shape name, rotation center, rotation axis, and rotation angle. The shape name can be a single shape or multiple shapes.

[0105] First, it is necessary to judge the number of parameters. If the number of parameters is not 5, the error code pointer is

[0106] errorInfo->m_ErrorCode = PY_ARGUMENT_NUM_ERROR;

[0107] And the error code will prompt the correct number of parameter information errorInfo->m_CorrectNumber.push_back(5);

[0108] For the judgment of the second parameter, the shape name, if it is a single shape name, the GetStr function is used; if it is multiple shape names, the GetStrList function is used.

[0109] For the judgment of the third parameter, the rotation center coordinate point, the GetPosition function is used.

[0110] For the judgment of the fourth parameter, the rotation axis vector, the GetVector function is used.

[0111] For the judgment of the fifth parameter, the rotation angle value, the GetDouble function is used.

[0112] The doc.CheckPython function can be used to check the Python parameter parsing situation of the command. Through specific use cases, it is possible to test and verify whether the functional functions run as expected.

[0113] In the above process, by constructing the corresponding parameter parsing error script, the error reporting mechanism of the geometric modeling engine is improved, and the fault tolerance ability of the error reporting mechanism is enhanced. When the user is testing the geometric modeling function through the geometric modeling engine, the parameter parsing error script can detect the corresponding error use cases, and when an abnormality is detected, output the corresponding parameter abnormality information and parameter correction information, enabling the user to efficiently and intuitively perceive the corresponding abnormality, which is conducive to discovering the potential risks existing in parameter parsing, and through the error detection function, it is possible to ensure the consistency and scalability of the processing standard, which is conducive to meeting the actual needs of users.

[0114] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequences, because according to the embodiments of the present invention, certain steps can be carried out in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.

[0115] Referring to Figure 4 , a structural block diagram of an error detection device for a geometric modeling engine provided in an embodiment of the present invention is shown. It is applied to a geometric modeling engine, and a parameter parsing error script is deployed in the geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. Specifically, it may include the following modules:

[0116] A use case acquisition module 401, configured to acquire error use cases for execution in the geometric modeling engine;

[0117] A parameter determination module 402, configured to parse the error use cases to obtain the model parameters corresponding to the error use cases and the number of parameters corresponding to the model parameters;

[0118] A function extraction module 403, configured to extract at least one target error detection function from the error detection functions according to the number of parameters;

[0119] A detection module 404, configured to detect parameter anomalies existing in the model parameters through the target error detection function, and output parameter anomaly information and parameter correction information for the error use cases.

[0120] In some feasible implementation manners, the parameter parsing error script further includes an error record structure. The parameter anomaly information includes at least one of parameter number anomaly information and parameter type anomaly information. The parameter correction information includes number correction information and type correction information. Specifically, the detection module 404 is configured to:

[0121] If it is detected through the target error detection function that the model parameters have parameter number anomalies, output parameter number anomaly information and number correction information for the error use cases through the error record structure;

[0122] If it is detected through the target error detection function that the model parameters have parameter type anomalies, output parameter type anomaly information and type correction information for the error use cases through the error record structure;

[0123] If it is detected by the target error detection function that there are abnormal parameter quantities and abnormal parameter types in the model parameters, the error record structure outputs the abnormal parameter quantity information and abnormal parameter type information for the error case, as well as the quantity correction information and type correction information corresponding to the error case.

[0124] In some feasible implementation manners, the parameter parsing error script further includes an error code pointer, the error record structure at least includes error code prompt information and correct parameter information, the correct parameter information at least includes standard quantity information, and the detection module 404 is specifically configured to:

[0125] Determine, from the error code prompt information in the error record structure through the error code pointer, first error code prompt information for presenting the abnormal parameter quantity of the error case, and use the first error code prompt information as the abnormal parameter quantity information for the error case;

[0126] Use the standard quantity information as the quantity correction information for the error case.

[0127] In some feasible implementation manners, the correct parameter information further includes standard type information, and the detection module 404 is specifically configured to:

[0128] Determine, from the error code prompt information in the error record structure through the error code pointer, second error code prompt information for presenting the abnormal parameter type of the error case, and use the second error code prompt information as the abnormal parameter type information for the error case;

[0129] Use the standard type information as the type correction information for the error case.

[0130] In some feasible implementation manners, the error record structure further includes an error location index, and the device further includes:

[0131] A positioning module, configured to locate, through the error code pointer, target model parameters where parameter quantity anomalies and / or parameter type anomalies occur, and determine the parameter positions corresponding to the target model parameters;

[0132] An indexing module, configured to assign the parameter positions to the error location index.

[0133] In some feasible implementation manners, the target error detection function includes at least one of a numerical error detection function and a custom error detection function, and the function extraction module 403 is specifically configured to:

[0134] If the parameter quantity is a first quantity, extract a numerical error detection function from the error detection functions;

[0135] If the number of parameters is the second number, extract a numerical error detection function and a custom error detection function from the error detection function.

[0136] In some feasible implementation manners, the parameter exception information includes parameter quantity exception information, and the parameter correction information at least includes quantity correction information. The detection module 404 is specifically configured to:

[0137] If the number of parameters is not the first number or the second number, output parameter quantity exception information for the error use case and quantity correction information corresponding to the parameter quantity exception information.

[0138] In some feasible implementation manners, the parameter exception information includes parameter type exception information, and the parameter correction information at least includes type correction information. The detection module 404 is further specifically configured to:

[0139] If the number of parameters is the first number, determine parameter sequences corresponding to the respective model parameters;

[0140] According to the sorting order corresponding to the parameter sequence, use the numerical error detection function to determine whether each first model parameter after the nth model parameter among the model parameters is of a numerical type;

[0141] If there is at least one first model parameter that is not of a numerical type, output parameter type exception information and type correction information for the error use case.

[0142] In some feasible implementation manners, the parameter exception information includes parameter type exception information, and the parameter correction information at least includes type correction information. The detection module 404 is further specifically configured to:

[0143] If the number of parameters is the second number, determine parameter sequences corresponding to the respective model parameters;

[0144] According to the sorting order corresponding to the parameter sequence, use the custom detection function to determine whether the mth model parameter among the model parameters is of a custom type, and use the numerical error detection function to determine whether each second model parameter after the mth model parameter among the model parameters is of a numerical type; <##

[0145] If the mth model parameter is not of the custom type, and / or there is at least one second model parameter that is not of a numerical type, output parameter type exception information and type correction information for the error use case.

[0146] For the device embodiments, since they are basically similar to the method embodiments, they are described relatively simply. For the relevant parts, please refer to the corresponding descriptions in the method embodiments.

[0147] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements each process of the above-described method embodiment for error detection in the geometric modeling engine and can achieve the same technical effects. To avoid repetition, details are not described herein again.

[0148] An embodiment of the present invention further provides a computer-readable storage medium with a computer program stored thereon. When the computer program is executed by a processor, it implements each process of the above-described method embodiment for error detection in the geometric modeling engine and can achieve the same technical effects. To avoid repetition, details are not described herein again. Among them, the computer-readable storage medium includes, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.

[0149] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.

[0150] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, EEPROMs, Flash, and eMMC, etc.) containing computer-usable program codes.

[0151] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the processes and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate for implementing in the process Figure 1 each process or multiple processes and / or blocksFigure 1 means for the functions specified in one or more boxes.

[0152] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 or more boxes.

[0153] These computer program instructions may also be loaded onto a computer or other programmable data processing terminal device, such that a series of operational steps are performed on the computer or other programmable terminal device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 or more boxes.

[0154] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.

[0155] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.

[0156] The above has introduced in detail a method for error detection in a geometric modeling engine and a device for error detection in a geometric modeling engine provided by the present invention. In this article, specific examples are used to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. An error detection method for a geometric modeling engine, characterized in that, Applied to a geometric modeling engine, in which a parameter parsing error script is deployed. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class at least includes an error detection function. The method includes: Obtain an error case for execution in the geometric modeling engine; Parse the error case to obtain the model parameters corresponding to the error case and the number of parameters corresponding to the model parameters; Extract at least one target error detection function from the error detection functions according to the number of parameters; Detect parameter anomalies existing in the model parameters through the target error detection function, and output parameter anomaly information and parameter correction information for the error case.

2. The method according to claim 1, wherein The parameter parsing error script further includes an error record structure. The parameter anomaly information includes at least one of parameter number anomaly information and parameter type anomaly information. The parameter correction information includes number correction information and type correction information. Detecting parameter anomalies existing in the model parameters through the target error detection function and outputting parameter anomaly information and parameter correction information for the error case includes: If it is detected through the target error detection function that the model parameters have a parameter number anomaly, output parameter number anomaly information and number correction information for the error case through the error record structure; If it is detected through the target error detection function that the model parameters have a parameter type anomaly, output parameter type anomaly information and type correction information for the error case through the error record structure; If it is detected through the target error detection function that the model parameters have a parameter number anomaly and a parameter type anomaly, output parameter number anomaly information and parameter type anomaly information for the error case, as well as the number correction information and type correction information corresponding to the error case.

3. The method according to claim 2, characterized in that, The parameter parsing error script further includes an error code pointer. The error record structure at least includes error code prompt information and correct parameter information. The correct parameter information at least includes standard number information. Outputting parameter number anomaly information and number correction information for the error case through the error record structure includes: Determine, through the error code pointer, first error code prompt information for presenting the parameter number anomaly of the error case from the error code prompt information in the error record structure, and use the first error code prompt information as the parameter number anomaly information for the error case; Use the standard number information as the number correction information for the error case.

4. The method according to claim 3, wherein The correct parameter information further includes standard type information. Outputting parameter type anomaly information and type correction information for the error case through the error record structure includes: Determine, from the error code prompt information in the error record structure through the error code pointer, a second error code prompt information for presenting the parameter type exception of the error use case, and use the second error code prompt information as the parameter type exception information for the error use case; Use the standard type information as the type correction information for the error use case.

5. The method according to claim 3 or 4, characterized in that, The error record structure further includes an error location index, and the method further includes: Locate, through the error code pointer, the target model parameter where the parameter quantity exception and / or parameter type exception occurs, and determine the parameter position corresponding to the target model parameter; Assign the parameter position to the error location index.

6. The method according to claim 1, wherein The target error detection function includes at least one of a numerical error detection function and a custom error detection function. Extracting at least one target error detection function from the error detection functions according to the parameter quantity includes: If the parameter quantity is the first quantity, extract the numerical error detection function from the error detection functions; If the parameter quantity is the second quantity, extract the numerical error detection function and the custom error detection function from the error detection functions.

7. The method according to claim 6, characterized in that, The parameter exception information includes parameter quantity exception information, and the parameter correction information includes at least quantity correction information. Detecting the parameter exception existing in the model parameter through the target error detection function and outputting the parameter exception information and parameter correction information for the error use case includes: If the parameter quantity is not the first quantity or the second quantity, output the parameter quantity exception information for the error use case and the quantity correction information corresponding to the parameter quantity exception information.

8. The method according to claim 6, wherein The parameter exception information includes parameter type exception information, and the parameter correction information includes at least type correction information. Detecting the parameter exception existing in the model parameter through the target error detection function and outputting the parameter exception information and parameter correction information for the error use case further includes: If the parameter quantity is the first quantity, determine the parameter sequence corresponding to each of the model parameters; According to the sorting order corresponding to the parameter sequence, determine whether each first model parameter after the nth model parameter in the model parameters is of a numerical type through the numerical error detection function; If there is at least one first model parameter that is not of a numerical type, output the parameter type exception information and type correction information for the error use case.

9. The method according to claim 6, wherein The parameter exception information includes parameter type exception information, and the parameter correction information includes at least type correction information. Detecting the parameter exception existing in the model parameter through the target error detection function and outputting the parameter exception information and parameter correction information for the error use case further includes: If the parameter quantity is the second quantity, determine the parameter sequence corresponding to each of the model parameters; According to the sorting order corresponding to the parameter sequence, determine whether the m-th model parameter in the model parameters is of a custom type through the custom type detection function, and determine whether each second model parameter after the m-th model parameter in the model parameters is of a numerical type through the numerical error detection function; If the m-th model parameter is not of the custom type, and / or there is at least one second model parameter that is not of a numerical type, output parameter type exception information and type correction information for the error use case.

10. An error detection device for a geometric modeling engine, characterized in that, Applied to a geometric modeling engine, a parameter parsing error script is deployed in the geometric modeling engine. The parameter parsing error script includes a parameter parsing list class, and the parameter parsing list class includes at least an error detection function. The device includes: A use case acquisition module for acquiring error use cases to be executed in the geometric modeling engine; A parameter determination module for parsing the error use case to obtain the model parameters corresponding to the error use case and the number of parameters corresponding to the model parameters; A function extraction module for extracting at least one target error detection function from the error detection functions according to the number of parameters; A detection module for detecting parameter anomalies existing in the model parameters through the target error detection function and outputting parameter anomaly information and parameter correction information for the error use case.

11. An electronic device, characterized in that, Including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; When the processor is used to execute the program stored on the memory, it implements the method according to any one of claims 1-9.

12. A computer-readable storage medium, on which instructions are stored. When the instructions are executed by one or more processors, the processors are caused to execute the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Performance function implementation method, interpreter and computer readable storage medium

    CN113535139A

  • Parameter verification method and device

    CN116755671A

  • Method for guiding software defined satellite error correction based on large model knowledge graph

    CN118897688A

  • Error analysis method and system, electronic equipment and medium

    CN119201525A

  • Method and system for performing parametric testing of a functional programming interface

    US5495571A