Data verification method, device, storage medium and program product
By analyzing the target project files on the low-code platform and determining the verification results, the problem of low-efficiency verification of resource reference and input information in the low-code platform is solved, and efficient and real-time data verification is achieved, reducing maintenance costs.
Patent Information
- Application Number
- CN202510174530.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-02-18
AI Technical Summary
In the prior art, low-code platforms have problems such as low verification efficiency, poor real-time performance, difficulty in maintaining and lack of flexibility in the legality verification of resource reference and input information.
By obtaining the target project file and analyzing it based on the configuration information of the low-code platform, the syntax object and its attribute information are obtained, the files to be checked are determined, and the target verification results are determined based on the attribute information of the grammatical object, the files to be checked and the syntax object rule information are found to verify the target project file.
It improves verification efficiency, realizes real-time detection of resource references and input information, reduces maintenance costs, and enhances the flexibility and scalability of data verification.
Smart Images

Figure CN119645423B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data verification, and more specifically, to a data verification method, device, storage medium, and program product. Background Art
[0002] In the modern software development process, low-code platforms have received extensive attention because they can reduce the development difficulty and improve the development efficiency. Low-code platforms allow developers to quickly build application programs through visual interfaces and drag-and-drop methods. However, low-code platforms also face some technical challenges, one of which is how to establish accurate and legal reference relationships between low-code resources and how to effectively verify the legality of resource input information.
[0003] The prior art usually adopts the method of traditional parsing of engineering structures to handle resource reference and input information legality verification. Specifically, developers manually write verification code to maintain the reference relationships between resources, so as to achieve resource reference and input information legality verification.
[0004] However, this processing method depends on the verification code manually written by developers, and each parsing and checking consumes a large amount of time and computing resources, resulting in problems such as low verification efficiency, poor real-time performance, difficult maintenance, and lack of flexibility. Summary of the Invention
[0005] The purpose of the present application is to provide a data verification method, device, storage medium, and program product for the deficiencies in the above prior art, so as to solve the problems of low verification efficiency, poor real-time performance, difficult maintenance, and lack of flexibility in the prior art.
[0006] To achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a data verification method, and the method includes:
[0008] Obtain a target engineering file;
[0009] Based on the configuration information of the low-code platform, parse the target engineering file to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object, where the attribute information includes: the value of the syntax object and the file to which the syntax object belongs in the target engineering file;
[0010] Determine at least one file to be checked in the target engineering file;
[0011] Determine the target verification result of each of the to-be-verified files according to the attribute information of each syntax object, each of the to-be-verified files, and the syntax object rule information of the low-code platform. The target verification result includes: multiple verification records. The syntax object rule information is used to indicate the correct usage rules of each syntax object provided by the low-code platform and the correct reference relationship between syntax objects. Each verification record includes: an abnormal syntax object, the error type of the abnormal syntax object, and the file to which the abnormal syntax object belongs.
[0012] In a second aspect, another embodiment of the present application provides a data verification device, which includes:
[0013] An acquisition module, configured to acquire a target engineering file;
[0014] An analysis module, configured to analyze the target engineering file based on the configuration information of the low-code platform to obtain a plurality of syntax objects corresponding to the target engineering file and the attribute information of each syntax object. The attribute information includes: the value of the syntax object and the file to which the syntax object belongs in the target engineering file;
[0015] A determination module, configured to determine at least one to-be-verified file in the target engineering file;
[0016] A verification module, configured to determine the target verification result of each of the to-be-verified files according to the attribute information of each syntax object, each of the to-be-verified files, and the syntax object rule information of the low-code platform. The target verification result includes: multiple verification records. The syntax object rule information is used to indicate the correct usage rules of each syntax object provided by the low-code platform, and each verification record includes: an abnormal syntax object, the error type of the abnormal syntax object, and the file to which the abnormal syntax object belongs.
[0017] In a third aspect, another embodiment of the present application provides an electronic device, including: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect above.
[0018] In a fourth aspect, another embodiment of the present application provides a storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the steps of any method described in the first aspect above.
[0019] Fifth aspect, another embodiment of the present application provides a computer program product, which includes computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of any of the methods in the above first aspect.
[0020] The beneficial effects of the present application are as follows: By obtaining a target project file and parsing the target project file based on the configuration information of the low-code platform, a plurality of syntax objects corresponding to the target project file and the attribute information of each syntax object are obtained, and at least one file to be checked in the target project file is determined. Thus, the target verification results of each file to be checked can be determined according to the attribute information of each syntax object, each file to be checked, and the syntax object rule information of the low-code platform, realizing the verification of the target project file, improving the verification efficiency, and being able to detect changes in resource references and input information in real time, improving the real-time performance of data verification. At the same time, with the update of the low-code platform, developers of the low-code platform only need to maintain the configuration information and the syntax object rule information, avoiding the need to manually update relevant reference relationships every time a resource or component is modified, and reducing the maintenance cost.
[0021] In addition, the data verification method provided by the present application can also be encapsulated as an independent subprocess, enabling the data verification process to run independently in the background, avoiding the impact on the main functions of the low-code platform, and being able to adapt to the special requirements of different low-code platforms, improving the development efficiency of the low-code platform, and improving the reliability, flexibility, and scalability of data verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 It is a schematic diagram of a scenario of the data verification method provided by the embodiment of the present application;
[0024] Figure 2 It is a schematic flowchart of the data verification method provided by the embodiment of the present application;
[0025] Figure 3 It is a schematic flowchart when determining at least one file to be checked in the data verification method provided by the embodiment of the present application;
[0026] Figure 4It is a schematic flowchart for determining the target verification result of each file to be checked in the data verification method provided by the embodiments of this application;
[0027] Figure 5 It is a schematic flowchart for generating a syntax tree of a file to be checked in the data verification method provided by the embodiments of this application;
[0028] Figure 6 It is a schematic flowchart for determining the target verification result of a file to be checked in the data verification method provided by the embodiments of this application;
[0029] Figure 7 It is a schematic flowchart for obtaining multiple syntax objects corresponding to a target project file and attribute information of each syntax object in the data verification method provided by the embodiments of this application;
[0030] Figure 8 It is another schematic flowchart for obtaining multiple syntax objects corresponding to a target project file and attribute information of each syntax object in the data verification method provided by the embodiments of this application;
[0031] Figure 9 It is a schematic diagram of a data verification device provided by the embodiments of this application;
[0032] Figure 10 It is a schematic diagram of the structure of an electronic device provided by the embodiments of this application. Detailed implementation manners
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. It should be understood that the accompanying drawings in this application are only for the purposes of illustration and description, and are not used to limit the protection scope of this application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical context relationships may be reversed in order or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of this application.
[0034] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all embodiments. Generally, the components of the embodiments of the present application described and illustrated in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application claimed, but only represents the selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts belong to the scope of protection of the present application.
[0035] It should be noted that the term "including" will be used in the embodiments of the present application to indicate the existence of the features stated thereafter, but does not exclude adding other features.
[0036] The prior art usually adopts the traditional method of analyzing engineering structures to handle resource reference and input information legality verification. Specifically, developers manually write verification codes in a hard-coded manner to maintain the reference relationships between resources, so that when a user modifies a target engineering file on a low-code platform, the user's modification can be verified through the operation of the verification code, thereby realizing resource reference and input information legality verification.
[0037] However, this processing method relies on the verification codes manually written by developers. Each parsing and checking consumes a large amount of time and computing resources, resulting in a problem of low verification efficiency. At the same time, when the referenced resources are deleted or modified, these changes cannot be detected in real time, resulting in a problem of poor real-time performance. Moreover, the hard-coded association method makes the maintenance work complicated. Each time a resource or component is modified, the relevant reference relationships need to be updated manually, resulting in problems of difficult maintenance and easy errors. In addition, the program logic of this processing method is relatively fixed, making it difficult to adapt to the special requirements of different low-code platforms, resulting in problems of lack of flexibility and poor scalability.
[0038] Based on the above problems, the embodiments of the present application propose a data verification method. By obtaining a target engineering file and parsing the target engineering file based on the configuration information of the low-code platform, a plurality of syntax objects corresponding to the target engineering file and the attribute information of each syntax object are obtained, and at least one file to be checked in the target engineering file is determined. Thus, according to the attribute information of each syntax object, each file to be checked, and the syntax object rule information of the low-code platform, the target verification results of each file to be checked are determined, realizing the verification of the target engineering file, improving the verification efficiency, and being able to detect modified or deleted resources in real time, improving the real-time performance of data verification. At the same time, it avoids the need to manually update the relevant reference relationships each time a resource or component is modified, and the maintenance is simple. In addition, the flexibility and scalability of data verification are also improved.
[0039] First, the relevant usage scenarios involved in the data verification method provided in the embodiments of the present application will be described.
[0040] It can be understood that a low-code platform is a software development tool that enables users to create application programs with little or almost no handwritten code by providing a visual interface and drag-and-drop components. Specifically, Figure 1 FIG. is a schematic diagram of a scenario of the data verification method provided in the embodiments of the present application. Refer to Figure 1 As shown, users can modify the application program by dragging in the low-code platform, so that the target project file corresponding to the application program is also adjusted accordingly. And after the target project file is adjusted, by executing the steps of the data verification method provided in the embodiments of the present application, the verification of the target project file is realized, and the obtained target verification result is pushed to the user, so that the user can obtain a normally running application program.
[0041] Specifically, continue to refer to Figure 1 As shown, before executing the data verification method provided in the embodiments of the present application, the maintenance personnel or developers of the low-code platform can configure the configuration information and syntax object rule information of the low-code platform in the low-code platform, so that the low-code platform can execute the steps of the data verification method provided in the embodiments of the present application.
[0042] As an example, in the specific implementation process, the technical solution provided in the embodiments of the present application can be deployed in the low-code platform in the form of a plug-in and run together with the operation of the low-code platform, so as to realize the verification of the target project file, and push the obtained target verification result to the user, so that the user can obtain a normally running application program.
[0043] The data verification method provided in the embodiments of the present application will be described in detail below in conjunction with multiple embodiments.
[0044] Figure 2 FIG. is a schematic flowchart of the data verification method provided in the embodiments of the present application. Refer to Figure 2 As shown, the execution subject of this method can be any electronic device with processing capabilities, such as the above-mentioned low-code platform. This method includes:
[0045] S201. Obtain a target project file.
[0046] Among them, the target project file is used to store and manage various elements and configurations of the application, and may include configuration files, visual interface design files, and business logic files. Among them, the configuration file is used to define the basic settings, permission management, data model, etc. of the application, the visual interface design file is used to define the user interface of the application, and the business logic file is used to define the business logic and process control of the application.
[0047] Specifically, the obtained target project file can be the target project file modified by the user this time, or the target project file modified by the user last time.
[0048] S202. Parse the target project file based on the configuration information of the low-code platform to obtain multiple syntax objects corresponding to the target project file and the attribute information of each syntax object.
[0049] It can be understood that in the low-code platform, there are fixed basic elements available for users in the low-code platform, such as user interface elements, data model elements, process control elements, integration and extension elements, and other auxiliary elements. Before executing the data verification method provided in the embodiments of the present application, developers of the low-code platform can configure the fixed basic elements available for users in the low-code platform as the configuration information of the low-code platform in the low-code platform, so that the low-code platform can parse the target project file based on the configuration information of the low-code platform to obtain multiple syntax objects corresponding to the target project file and the attribute information of each syntax object. Among them, the configuration information of the low-code platform includes information such as the fixed basic elements available for users in the low-code platform, the attribute definitions of each basic element, relationship settings, and lifecycle management.
[0050] Optionally, the low-code platform can parse different resources and components in the target project file through the configuration information, so as to obtain multiple syntax objects corresponding to the target project file and the attribute information of each syntax object.
[0051] Among them, the multiple syntax objects corresponding to the target project file include the basic elements of the low-code platform used in the target project file and the components composed of multiple basic elements. Among them, the attribute information of the syntax object includes: the value of the syntax object and the file to which the syntax object belongs in the target project file.
[0052] Exemplarily, when parsing a target project file through configuration information, the low-code platform can first parse the global resources in the target project file, then divide the target project file into modules, and respectively perform syntax analysis and recognition on the resources under each module, so as to obtain multiple target elements and / or multiple components in the target project file, and map the obtained multiple target elements and / or multiple components to the configuration information of the low-code platform to obtain multiple syntax objects corresponding to the target project file and the attribute information of each syntax object.
[0053] Exemplarily, taking the target project file used to build a personnel information management system as an example, the multiple syntax objects corresponding to the obtained target project file may include user interface elements such as a title bar, a personnel list, and an add personnel button, may also include data model elements such as a personnel table, may also include process control elements such as adding personnel, deleting personnel, and editing personnel, may also include extension elements such as sending emails and database connection, and may also include business components such as data verification and data submission.
[0054] Exemplarily, the values and attribute information of user interface elements such as a title bar, a personnel list, and an add personnel button may include the name, position, belonging file, size, and trigger logic of the user interface element. The values and attribute information of data model elements such as a personnel table may include data type, length, and belonging file, etc. The values and attribute information of process control elements such as adding personnel, deleting personnel, and editing personnel, as well as extension elements such as sending emails and database connection may include trigger conditions and belonging files, etc. The values and attribute information of business components such as data verification and data submission may include default values, verification rules, placeholders, and belonging files, etc.
[0055] S203. Determine at least one file to be checked in the target project file.
[0056] It can be understood that the target project file includes multiple files. To improve the verification efficiency, all or part of the target project file can be used as the file to be checked according to the user's modification and the compilation result after modification during verification. Among them, the file to be checked is the file that needs to be verified.
[0057] Optionally, all the files in the target project file modified by the user this time can be used as at least one file to be checked in the target project file.
[0058] Optionally, the files in the target project file related to the user's current modification can also be used as at least one file to be checked in the target project file.
[0059] Optionally, according to the compilation result of the target project file modified by the user this time, the file that causes error information in the compilation result can be used as at least one file to be checked in the target project file.
[0060] S204. Determine the target verification results of the files to be checked according to the attribute information of each syntax object, each file to be checked, and the syntax object rule information of the low-code platform.
[0061] It can be understood that after obtaining each file to be checked, each file to be checked can be verified through the attribute information of each syntax object and the syntax object rule information of the low-code platform, so as to obtain the target verification results of each file to be checked.
[0062] Optionally, according to the attribute information of each syntax object and the syntax object rule information of the low-code platform, the benchmark syntax rules between each syntax object and each syntax object can be determined, and the statements where each syntax object is located in each file to be checked can be matched with the benchmark syntax rules, so as to realize the verification of each file to be checked and obtain the target verification results of each file to be checked.
[0063] Among them, the syntax object rule information of the low-code platform is used to indicate the correct usage rules of each syntax object provided by the low-code platform, which can be understood as the correct attribute rules, event rules, nesting rules, constraint rules, and interaction rules of each syntax object provided by the low-code platform.
[0064] Exemplarily, taking a certain business component as the syntax object, the syntax object rule information is used to indicate multiple conditions under which the business component can execute normally.
[0065] For example: taking a certain business component BusinessComponent() as an example, the syntax object rule information of the business component BusinessComponent() is: the content of the business component BusinessComponent() is obtained based on Table BcByTable or based on business service BcByBs, and the two configuration types can be distinguished through the "@_insrepoType" attribute, and different optional attributes (table or "@_insRepoBusinessService") can be provided according to the configuration type, and the values of these attributes are respectively restricted by the keys in the TABLE_REFER and BS_REFER objects. Among them, the implementation of the syntax object rule information of the business component BusinessComponent() can refer to the following program code:
[0066] type BcByTable = {
[0067] "@_insrepoType": "TABLE",
[0068] table?: keyof typeof TABLE_REFER
[0069] }
[0070] type BcByBs = {
[0071] "@_insrepoType": "API",
[0072] "@_insRepoBusinessService"?: keyof typeof BS_REFER
[0073] }
[0074] Interface BusinessComponent {
[0075] content: BcByTable | BcByBs
[0076] }
[0077] Among them, the target verification result includes: multiple verification records, and each verification record includes: an abnormal syntax object, the error type of the abnormal syntax object, and the file to which the abnormal syntax object belongs.
[0078] In this embodiment, by obtaining the target project file and parsing the target project file based on the configuration information of the low-code platform, multiple syntax objects corresponding to the target project file and the attribute information of each syntax object are obtained, and at least one file to be checked in the target project file is determined. Therefore, according to the attribute information of each syntax object, each file to be checked, and the syntax object rule information of the low-code platform, the target verification result of each file to be checked can be determined, realizing the verification of the target project file, improving the verification efficiency, and being able to detect changes in resource references and input information in real time, improving the real-time performance of data verification. At the same time, with the update of the low-code platform, developers of the low-code platform only need to maintain the configuration information and syntax object rule information, avoiding the need to manually update the relevant reference relationships every time a resource or component is modified, and reducing the maintenance cost.
[0079] In addition, the data verification method provided in this application can also be encapsulated as an independent subprocess, enabling the data verification process to run independently in the background, avoiding affecting the main functions of the low-code platform, and being able to adapt to the special requirements of different low-code platforms, improving the development efficiency of the low-code platform, and improving the reliability, flexibility, and scalability of data verification.
[0080] It should be understood that the file to be inspected can be all target project files or some of the target project files. During verification, according to the user's modifications and the compilation results after modification, some target project files can be used as the files to be inspected, or all target project files can be used as the files to be inspected. The following is an exemplary description.
[0081] In a possible implementation, Figure 3 This is a schematic flowchart of a process for determining at least one file to be inspected in the data verification method provided by the embodiments of this application. Refer to Figure 3 As shown, in the above S203, it includes:
[0082] S301. Compile the target project files to obtain a preliminary compilation result.
[0083] Optionally, after obtaining the target project files, the low-code platform can compile the target project files to obtain a preliminary compilation result.
[0084] S302. Judge the preliminary compilation result. If there is at least one preliminary abnormal syntax object in the preliminary compilation result, determine at least one file to be inspected according to the at least one preliminary abnormal syntax object.
[0085] Optionally, after obtaining the preliminary compilation result, the low-code platform judges the preliminary compilation result. If there is at least one preliminary abnormal syntax object in the preliminary compilation result, determine at least one file to be inspected according to the at least one preliminary abnormal syntax object.
[0086] Exemplarily, the preliminary abnormal syntax object can be found from the log generated during compilation, so as to locate the file to be inspected.
[0087] By compiling the target project files to obtain a preliminary compilation result, judging the preliminary compilation result, and if there is at least one preliminary abnormal syntax object in the preliminary compilation result, determining at least one file to be inspected according to the at least one preliminary abnormal syntax object, the number of files to be verified can be reduced, thereby improving the verification efficiency. Moreover, after obtaining the preliminary compilation result, the file to be inspected can be determined, and the real-time performance of data verification can also be improved.
[0088] In a possible implementation, in the above S302, determining at least one file to be inspected according to the at least one preliminary abnormal syntax object includes:
[0089] Traverse all sub-target project files in the target project files. For the currently traversed sub-target project file, check whether the currently traversed sub-target project file includes at least one preliminary abnormal syntax object. If so, use the currently traversed sub-target project file as the file to be inspected.
[0090] Optionally, it is also possible to traverse all sub-target project files in the target project file. For the currently traversed sub-target project file, by means of string matching, check whether the preliminary abnormal syntax object is included in the currently traversed sub-target project file. If it is included, the currently traversed sub-target project file is used as the file to be checked.
[0091] Optionally, for the currently traversed sub-target project file, by means of string matching, check whether the preliminary abnormal syntax object is included in the currently traversed sub-target project file, and according to the syntax object rule information of the low-code platform, judge whether the value of the preliminary abnormal syntax object is an abnormal value. If the preliminary abnormal syntax object is included in the currently traversed sub-target project file and the value of the preliminary abnormal syntax object is an abnormal value, the currently traversed sub-target project file is used as the file to be checked.
[0092] In a possible implementation manner, it is possible to only check the files related to the user's modification. When determining at least one file to be checked in the target project file in S203 above, it includes:
[0093] Determine the modification points in the target project file, and according to the modification points, the configuration information of the low-code platform, and the syntax object rule information of the low-code platform, determine at least one file to be checked in the target project file.
[0094] Optionally, after the user modifies the target project file, it is possible to determine the relevant information of the modification points in the target project file, and according to the relevant information of the modification points, search for at least one syntax object related to the modification points from the configuration information of the low-code platform and the syntax object rule information of the low-code platform, and use the sub-target project file corresponding to the syntax object as the file to be checked.
[0095] In a possible implementation manner, it is possible to check all target project files. Then, when determining at least one file to be checked in the target project file in S203 above, it includes: using all target project files as the files to be checked.
[0096] Based on the user's modification and the compilation result after modification, using some target project files as the files to be checked, or using all target project files as the files to be checked, enables flexible adjustment according to the actual situation during the data verification process, improving the flexibility and scalability of the data verification process.
[0097] The above gives an exemplary description of the process of determining at least one file to be checked in the target project file. After determining the file to be checked, an exemplary description is given of determining the target verification result of each file to be checked according to the attribute information of each syntax object, each file to be checked, and the syntax object rule information of the low-code platform.
[0098] In a possible implementation, Figure 4 This is a schematic flowchart for determining the target verification result of each file to be checked in the data verification method provided by the embodiments of this application. Refer to Figure 4 As shown, the above S204 includes:
[0099] S401. Generate a syntax tree of the file to be checked according to the attribute information of each syntax object and the code structure in the file to be checked.
[0100] Optionally, taking any file to be checked as an example, each syntax object can be used as an object rule when generating the syntax tree of the file to be checked, and the file to be checked is parsed according to the code structure in the file to be checked and each syntax object. When a syntax object in a file to be checked is recognized, a corresponding syntax tree node is created, and different syntax tree nodes are connected according to the code structure in the file to be checked, and the attribute information of each syntax object is added to the corresponding syntax tree node, thereby generating the syntax tree of the file to be checked.
[0101] Among them, the syntax tree is used to indicate the values of each syntax object in the file to be checked and the actual reference relationship between the syntax objects.
[0102] By generating the syntax tree of the file to be checked, the program code in the file to be checked can be represented in a structured manner, so that the file to be checked can be verified more accurately, and the verification efficiency can also be significantly improved.
[0103] S402. Determine the check template of each syntax object in the file to be checked according to the syntax object rule information.
[0104] Optionally, from all syntax objects, each syntax object existing in the file to be checked is screened through the file name of the file to be checked.
[0105] Optionally, each syntax object in the file to be checked is associated with the corresponding syntax object rule, so as to obtain the check template of each syntax object in the file to be checked.
[0106] Among them, the check template is used to indicate the correct usage rules of the syntax object. Specifically, it can include the value range of the syntax object, the attributes and types that can be owned, the nesting or combination method, the events that can be responded to and the relevant information of the event handling function, specific business logic constraint conditions, and executable interaction behaviors.
[0107] Optionally, the execution order of the above S401 and S402 can also be adjusted according to the actual situation, that is, S401 and S402 can also be executed in parallel, or S402 can be executed first and then S401.
[0108] S403. Determine the target verification result of the file to be inspected according to the syntax tree of the file to be inspected and the inspection templates of each syntax object in the file to be inspected.
[0109] Optionally, after obtaining the syntax tree of the file to be inspected and the inspection templates of each syntax object in the file to be inspected, each node in the syntax tree of the file to be inspected can be searched, and for the searched nodes, inspections can be performed through the inspection templates of the corresponding syntax objects to obtain the target verification results of these nodes, thereby obtaining the target verification result of the file to be inspected.
[0110] Generate the syntax tree of the file to be inspected through the attribute information of each syntax object and the code structure in the file to be inspected, and determine the inspection templates of each syntax object in the file to be inspected through the syntax object rule information. Thus, it is possible to determine the target verification result of the file to be inspected according to the syntax tree of the file to be inspected and the inspection templates of each syntax object in the file to be inspected, which can ensure the accuracy and reliability of the obtained target verification result. At the same time, through the syntax tree and inspection templates, the syntax objects in the file to be inspected can be quickly located, significantly improving the verification efficiency. In addition, the method of obtaining the target verification result through the syntax tree and inspection templates can also be integrated into the continuous integration / continuous deployment (CI / CD) process to achieve automatic code verification and error detection, and can be applied to any programming language, having wide applicability.
[0111] In a possible implementation manner, an exemplary description is given for the process of generating the syntax tree of the file to be inspected. Figure 5 FIG. is a schematic flowchart of a process for generating the syntax tree of the file to be inspected in the data verification method provided in the embodiments of the present application. Refer to Figure 5 As shown, the above S401 includes:
[0112] S501. Screen out at least one syntax object belonging to the file to be inspected according to the file to which each syntax object belongs in the target project file, and create syntax tree nodes corresponding to each syntax object.
[0113] Optionally, since the attribute information of each syntax object includes the file to which each syntax object belongs in the target project file, then, according to the difference of the file to be inspected, each syntax object existing in the current file to be inspected can be screened out from all syntax objects through the file name of the current file to be inspected.
[0114] Optionally, after filtering out each syntax object existing in the currently to-be-checked file, each syntax object can be searched from the program code in the currently to-be-checked file, and for each syntax object, a corresponding syntax tree node can be created. Specifically, through a search algorithm and a node creation function, the syntax tree nodes corresponding to each syntax object can be obtained.
[0115] Optionally, the values and attribute information of each syntax object can also be added to the syntax tree node corresponding to each syntax object.
[0116] S502. Determine the actual reference relationships between the syntax objects of the to-be-checked file based on the code structure in the to-be-checked file.
[0117] Optionally, after obtaining the syntax tree nodes corresponding to each syntax object, the program code in the to-be-checked file can be traversed to obtain the actual reference relationships between the syntax objects of the to-be-checked file. Among them, the actual reference relationships between the syntax objects are the syntax tree nodes.
[0118] S503. Generate the syntax tree of the to-be-checked file according to the syntax tree nodes corresponding to each syntax object and the actual reference relationships between the syntax objects.
[0119] Optionally, the actual reference relationships between the syntax objects are used as the connection relationships of the syntax tree nodes, and the syntax tree of the to-be-checked file is generated according to the syntax tree nodes corresponding to each syntax object and the connection relationships of the syntax tree nodes.
[0120] Exemplarily, according to the connection relationships of the syntax tree nodes, the parent node of the syntax tree can be determined, and the parent-child relationships of the syntax tree nodes can be determined, so as to connect the syntax tree nodes to generate the syntax tree of the to-be-checked file.
[0121] By filtering out at least one syntax object belonging to the to-be-checked file according to the file to which each syntax object belongs in the target project file, creating the syntax tree nodes corresponding to each syntax object, and determining the actual reference relationships between the syntax objects of the to-be-checked file based on the code structure in the to-be-checked file, the syntax tree of the to-be-checked file can be generated according to the syntax tree nodes corresponding to each syntax object and the actual reference relationships between the syntax objects, which helps to discover potential syntax errors, code redundancy, performance bottlenecks and other problems, enables more accurate verification of the to-be-checked file, and can also significantly improve the verification efficiency.
[0122] In a possible implementation manner, when determining the inspection templates of the syntax objects in the to-be-checked file according to the syntax object rule information in S402 above, it includes:
[0123] Determine each syntax object in the file to be checked, and traverse each syntax object in the file to be checked. For the currently traversed syntax object, search for the current syntax rule information corresponding to the current syntax object from the syntax object rule information, and use the current syntax rule information as the check template for the current syntax object.
[0124] Optionally, from all syntax objects, filter out each syntax object existing in the file to be checked through the file name of the file to be checked, and traverse each syntax object in the file to be checked. For the currently traversed syntax object, search for the current syntax rule information corresponding to the current syntax object from the syntax object rule information by means of string matching, and use the current syntax rule information as the check template for the current syntax object, which can ensure the accuracy of the check templates of each obtained syntax object, thereby ensuring the accuracy of the obtained target verification result.
[0125] In a possible implementation manner, an exemplary illustration is given for the process of determining the target verification result of the file to be checked. Figure 6 This is a schematic flowchart of a process for determining the target verification result of the file to be checked in the data verification method provided by the embodiments of the present application. Refer to Figure 6 As shown, the above S403 includes:
[0126] S601. Match the syntax tree of the file to be checked and the check templates of each syntax object in the file to be checked to obtain the initial verification result of the file to be checked.
[0127] Optionally, search the syntax tree of the file to be checked by means of depth-first traversal or breadth-first traversal, and compare the searched nodes with the check templates of each syntax object in the file to be checked, so as to determine the initial verification result of the node, and thus obtain the initial verification result of the file to be checked.
[0128] Among them, the initial verification result may include multiple verification records, and each verification record includes: an abnormal syntax object, the error type of the abnormal syntax object, and the file to which the abnormal syntax object belongs.
[0129] Exemplarily, the values and attribute information of each node in the syntax tree are matched with the value range of the syntax object in the check template, as well as the relevant information of the attributes and types, nesting or combination methods, events that can be responded to, and event handling functions, specific business logic constraint conditions, and executable interaction behaviors, so as to obtain the initial verification result of the file to be checked.
[0130] Exemplarily, the initial verification result may be a set of abnormal verification records, and each abnormal verification record is used to indicate the file where the abnormality occurs, the syntax object that causes the abnormality, and the reason for the abnormality.
[0131] S602. Generate the target verification result of the file to be inspected according to the initial verification result of the file to be inspected and the preset structured statement.
[0132] Optionally, the initial verification result of the file to be inspected can be filled into the preset structured statement respectively, so that the positioning information in the file to be inspected can be inspected or verified by using the objects and their attributes in a specific engineering description language, and thus the target verification result of the file to be inspected can be obtained, which can ensure the consistency between the obtained target verification result and the file to be inspected.
[0133] Exemplarily, the preset structured statement can be LanguageObject[type][id].content in the engineering description language. Specifically, LanguageObject is an object type in the engineering description language, and this object type LanguageObject includes category [type], identifier [id], and attribute content.
[0134] The above has given an exemplary description of the process of determining the target verification result of each file to be inspected. The following will give a detailed description of the process of parsing the target engineering file based on the configuration information of the low-code platform to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object.
[0135] In a possible implementation manner, Figure 7 FIG. is a schematic flowchart of a process for obtaining multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object in the data verification method provided by the embodiments of the present application. Refer to Figure 7 As shown, the above S202 includes:
[0136] S701. Parse the target engineering file based on the configuration information of the low-code platform to generate multiple initial syntax objects corresponding to the target engineering file and the attribute information of each initial syntax object.
[0137] Optionally, the low-code platform can parse different resources and components in the target engineering file through the configuration information, so as to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object.
[0138] Exemplarily, different parsing methods can be adopted according to the format and content of the target engineering file, and different resources and components in the target engineering file are respectively parsed according to the configuration information and the parsing method. The parsed data is matched with the basic elements and the attribute definitions of the basic elements in the configuration information, so as to obtain multiple syntax objects corresponding to the target engineering file. After obtaining each syntax object, attribute information of each syntax object is generated according to the parsed data. Among them, the parsing methods can include JavaScript Object Notation Parser (abbreviated as JSON parser) and eXtensible Markup Language Parser (abbreviated as XML parser).
[0139] S702. Perform post-processing on each initial syntax object and the attribute information of each initial syntax object to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object.
[0140] Optionally, post-processing can be performed on the initial syntax object and the attribute information of each initial syntax object to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object. Among them, the post-processing can include type conversion, format conversion, exception handling, default value filling, object merging, object splitting, and object cleaning of the initial syntax object and the attribute information of each initial syntax object.
[0141] By parsing the target engineering file based on the configuration information of the low-code platform, generating multiple initial syntax objects corresponding to the target engineering file and the attribute information of each initial syntax object, and performing post-processing on the initial syntax object and the attribute information of each initial syntax object to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object, the accuracy of each obtained syntax object and the attribute information of each syntax object can be guaranteed, thereby ensuring the accuracy of the obtained target verification result.
[0142] In a possible implementation manner Figure 8 is another process schematic diagram when obtaining multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object in the data verification method provided by the embodiment of the present application. Refer to Figure 8 As shown, the post-processing of each initial syntax object and the attribute information of each initial syntax object in the above S702 to obtain multiple syntax objects corresponding to the target engineering file and the attribute information of each syntax object includes:
[0143] S801. Perform conflict handling on each initial syntax object to obtain each initial syntax object after conflict handling.
[0144] It can be understood that after obtaining each initial syntax object, due to the ambiguity of the input data or design defects of the parser, etc., there may be conflicts such as duplicate names or abnormal error reports among the initial syntax objects. Therefore, conflict handling can be performed on the initial syntax objects to obtain the initial syntax objects after conflict handling.
[0145] Optionally, each initial syntax object can be checked to determine whether there are conflicts among the current initial syntax objects, determine the type of conflict, and according to the type of conflict, clean and transform the initial syntax objects that cause the conflict, so as to obtain the initial syntax objects after conflict handling, making the initial syntax objects after conflict handling clearer and improving the verification efficiency of the target project file.
[0146] S802. Create indexes for each initial syntax object after conflict handling to obtain each syntax object corresponding to the target project file.
[0147] Optionally, keyword indexes can be created for each initial syntax object after conflict handling according to the different names of each initial syntax object to obtain each syntax object corresponding to the target project file.
[0148] Optionally, property indexes can also be created for each initial syntax object after conflict handling according to the different property information of each initial syntax object to obtain each syntax object corresponding to the target project file.
[0149] Optionally, sequence indexes can also be created for each initial syntax object after conflict handling according to the different orders of each initial syntax object to obtain each syntax object corresponding to the target project file.
[0150] Exemplarily, by introducing a hash table and traversing each initial syntax object after conflict handling, indexes can be created for each initial syntax object after conflict handling to obtain each syntax object corresponding to the target project file.
[0151] S803. Use the property information of each initial syntax object as the property information of each syntax object.
[0152] Optionally, after obtaining each syntax object, use the property information of the corresponding initial syntax object as the property information of each syntax object.
[0153] By performing conflict processing on each initial syntax object, obtaining each initial syntax object after conflict processing, creating an index for each initial syntax object after conflict processing, obtaining each syntax object corresponding to the target project file, and using the attribute information of each initial syntax object as the attribute information of each syntax object, it is possible to ensure the accuracy of each obtained syntax object and the attribute information of each syntax object, thereby ensuring the accuracy of the obtained target verification result. At the same time, due to the existence of the index structure, it is possible to quickly query each syntax object, thereby improving the verification efficiency of the target project file.
[0154] Based on the same inventive concept, an embodiment of the present application also provides a data verification device corresponding to the data verification method. Since the principle of solving problems by the device in the embodiment of the present application is similar to the above data verification method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0155] Figure 9 It is a schematic diagram of a data verification device provided by an embodiment of the present application. Refer to Figure 9 As shown, the device includes: an acquisition module 901, a parsing module 902, a determination module 903, and a verification module 904;
[0156] The acquisition module 901 is used to acquire a target project file;
[0157] The parsing module 902 is used to parse the target project file based on the configuration information of the low-code platform, obtain a plurality of syntax objects corresponding to the target project file and the attribute information of each syntax object. The attribute information includes: the value of the syntax object and the file to which the syntax object belongs in the target project file;
[0158] The determination module 903 is used to determine at least one file to be checked in the target project file;
[0159] The verification module 904 is used to determine the target verification result of each file to be checked according to the attribute information of each syntax object, each file to be checked, and the syntax object rule information of the low-code platform. The target verification result includes: multiple verification records. The syntax object rule information is used to indicate the correct usage rules of each syntax object provided by the low-code platform. Each verification record includes: an abnormal syntax object, the error type of the abnormal syntax object, and the file to which the abnormal syntax object belongs.
[0160] Optionally, the determination module 903 is specifically used for:
[0161] Compiling the target project file to obtain a preliminary compilation result;
[0162] Judge the preliminary compilation result. If there is at least one preliminary abnormal syntax object in the preliminary compilation result, determine at least one file to be checked according to the at least one preliminary abnormal syntax object.
[0163] Optionally, the determination module 903 is specifically used for:
[0164] Traverse all sub-target project files in the target project file. For the currently traversed sub-target project file, check whether the currently traversed sub-target project file contains at least one preliminary abnormal syntax object. If so, use the currently traversed sub-target project file as the file to be checked.
[0165] Optionally, the verification module 904 is specifically used for:
[0166] Generate a syntax tree of the file to be checked according to the attribute information of each syntax object and the code structure in the file to be checked. The syntax tree is used to indicate the values of each syntax object in the file to be checked and the actual reference relationship between syntax objects;
[0167] Determine the check template of each syntax object in the file to be checked according to the syntax object rule information. The check template is used to indicate the correct usage rules of the syntax object and the correct reference relationship between associated syntax objects;
[0168] Determine the target verification result of the file to be checked according to the syntax tree of the file to be checked and the check template of each syntax object in the file to be checked.
[0169] Optionally, the verification module 904 is specifically used for:
[0170] Filter out at least one syntax object belonging to the file to be checked according to the file to which each syntax object belongs in the target project file, and create a syntax tree node corresponding to each syntax object;
[0171] Determine the actual reference relationship between each syntax object in the file to be checked based on the code structure in the file to be checked;
[0172] Generate a syntax tree of the file to be checked according to the syntax tree nodes corresponding to each syntax object, the values of each syntax object in the file to be checked, and the actual reference relationship between each syntax object.
[0173] Optionally, the verification module 904 is specifically used for:
[0174] Determine each syntax object in the file to be checked, traverse each syntax object in the file to be checked. For the currently traversed current syntax object, find the current syntax rule information corresponding to the current syntax object from the syntax object rule information, and use the current syntax rule information as the check template of the current syntax object.
[0175] Optionally, the verification module 904 is specifically configured to:
[0176] Match the syntax tree of the file to be checked with the check templates of each syntax object in the file to be checked to obtain an initial verification result of the file to be checked;
[0177] Generate a target verification result of the file to be checked according to the initial verification result of the file to be checked and a preset structured statement.
[0178] Optionally, the parsing module 902 is specifically configured to:
[0179] Parse the target project file based on the configuration information of the low-code platform to generate a plurality of initial syntax objects corresponding to the target project file and the attribute information of each initial syntax object;
[0180] Perform post-processing on each initial syntax object and the attribute information of each initial syntax object to obtain a plurality of syntax objects corresponding to the target project file and the attribute information of each syntax object.
[0181] Optionally, the parsing module 902 is specifically configured to:
[0182] Perform conflict processing on each initial syntax object to obtain each initial syntax object after conflict processing;
[0183] Create indexes for each initial syntax object after conflict processing to obtain each syntax object corresponding to the target project file;
[0184] Use the attribute information of each initial syntax object as the attribute information of each syntax object.
[0185] The description of the processing flow of each module in the device and the interaction flow between each module can refer to the relevant descriptions in the above method embodiments, which will not be elaborated here.
[0186] This application embodiment also provides an electronic device, as Figure 10 shown, Figure 10 is a schematic structural diagram of the electronic device provided by this application embodiment, including: a processor 1001, a memory 1002, and optionally, a bus 1003 can also be included. The memory 1002 stores machine-readable instructions executable by the processor 1001 (for example, Figure 9 the execution instructions corresponding to the acquisition module 901, the parsing module 902, the determination module 903, and the verification module 904 in the device), when the electronic device runs, the processor 1001 communicates with the memory 1002 through the bus 1003, and when the machine-readable instructions are executed by the processor 1001, the steps of the above data verification method are executed.
[0187] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the above data verification method are executed.
[0188] An embodiment of the present application also provides a computer program product, which includes computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of the above data verification method.
[0189] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the method embodiments, and will not be elaborated herein in the present application. In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or modules can be in electrical, mechanical, or other forms.
[0190] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0191] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application.
Claims
1. A data verification method, characterized in that: include: Get the target project file; Based on the configuration information of the low-code platform, the target project file is parsed to obtain multiple grammatical objects corresponding to the target project file and attribute information of each grammatical object, wherein the attribute information includes: the value of the grammatical object and the file to which the grammatical object belongs in the target project file. The configuration information of the low-code platform includes at least: basic element information available to users, attribute definition information of each basic element, relationship setting information and lifecycle management information; the multiple grammatical objects corresponding to the target project file include basic elements of the low-code platform used in the target project file and components composed of multiple basic elements; Determine at least one file to be checked in the target project file; According to the attribute information of each grammar object, each file to be checked and the grammar object rule information of the low-code platform, the target verification result of each file to be checked is determined, and the target verification result includes: multiple verification records, the grammar object rule information is used to indicate the correct usage rules of each grammar object provided by the low-code platform, and each verification record includes: abnormal grammar object, the error type of the abnormal grammar object and the file to which the abnormal grammar object belongs.
2. The data verification method according to claim 1, characterized in that: The determining at least one file to be checked in the target project file comprises: Compiling the target project file to obtain a preliminary compilation result; The preliminary compilation result is judged, and if there is at least one preliminary abnormal syntax object in the preliminary compilation result, at least one file to be checked is determined according to the at least one preliminary abnormal syntax object.
3. The data verification method according to claim 2, characterized in that: The step of determining at least one file to be checked according to the at least one preliminary abnormal syntax object comprises: Traverse all sub-target project files in the target project file, and for the current sub-target project file traversed, find out whether the current sub-target project file includes at least one of the preliminary abnormal syntax objects. If so, use the current sub-target project file as the file to be checked.
4. The data verification method according to claim 1, characterized in that: Determining the target verification result of each file to be checked according to the attribute information of each grammatical object, each file to be checked and the grammatical object rule information of the low-code platform includes: Generate a syntax tree of the file to be checked according to the attribute information of each syntax object and the code structure in the file to be checked, wherein the syntax tree is used to indicate the value of each syntax object in the file to be checked and the actual reference relationship between the syntax objects; Determine, according to the grammatical object rule information, a check template for each grammatical object in the to-be-checked file, wherein the check template is used to indicate a correct usage rule for the grammatical object; A target verification result of the file to be checked is determined according to the syntax tree of the file to be checked and the checking template of each syntax object in the file to be checked.
5. The data verification method according to claim 4, characterized in that: The generating a syntax tree of the file to be checked according to the attribute information of each syntax object and the code structure in the file to be checked includes: According to the files to which each grammatical object belongs in the target project file, at least one grammatical object belonging to the file to be checked is screened out, and a grammatical tree node corresponding to each grammatical object is created; Determining the actual reference relationship between the grammatical objects of the file to be checked based on the code structure in the file to be checked; A syntax tree of the file to be checked is generated according to the syntax tree nodes corresponding to the syntax objects and the actual reference relationship between the syntax objects.
6. The data verification method according to claim 4, characterized in that: Determining the inspection template for each grammatical object in the to-be-inspected file according to the grammatical object rule information includes: Determine each grammar object in the file to be checked, and traverse each grammar object in the file to be checked. For the current grammar object traversed, search for current grammar rule information corresponding to the current grammar object from the grammar object rule information, and use the current grammar rule information as a checking template for the current grammar object.
7. The data verification method according to claim 4, characterized in that: The step of determining a target verification result of the file to be checked according to the syntax tree of the file to be checked and the checking template of each syntax object in the file to be checked includes: Matching the syntax tree of the file to be checked and the check templates of each syntax object in the file to be checked to obtain an initial check result of the file to be checked; A target verification result of the file to be checked is generated according to the initial verification result of the file to be checked and a preset structured statement.
8. The data verification method according to claim 1, characterized in that: The configuration information based on the low-code platform is used to parse the target project file to obtain multiple grammatical objects corresponding to the target project file and attribute information of each grammatical object, including: Based on the configuration information of the low-code platform, the target project file is parsed to generate a plurality of initial grammatical objects corresponding to the target project file and attribute information of each initial grammatical object; Post-processing is performed on each of the initial grammatical objects and the attribute information of each of the initial grammatical objects to obtain a plurality of grammatical objects corresponding to the target project file and the attribute information of each grammatical object.
9. The data verification method according to claim 8, characterized in that: The post-processing of each of the initial grammatical objects and the attribute information of each of the initial grammatical objects to obtain a plurality of grammatical objects corresponding to the target project file and the attribute information of each grammatical object includes: Performing conflict processing on each of the initial grammatical objects to obtain each of the initial grammatical objects after conflict processing; Creating an index for each of the initial grammatical objects after conflict resolution to obtain each grammatical object corresponding to the target project file; The attribute information of each of the initial grammar objects is used as the attribute information of each of the grammar objects.
10. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the data verification method as described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data verification method according to any one of claims 1 to 9 are executed.
12. A computer program product, characterized in that The computer program product includes computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of the data verification method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Application engineering file processing method and device, electronic equipment and readable medium
CN113946339A
Code checking method and device, computer equipment and storage medium
CN115328487A
Error checking method and device for low-code platform page definition, equipment and medium
CN117435487A