CN117931506A - Document verification method, device, equipment and storage medium - Google Patents

Document verification method, device, equipment and storage medium Download PDF

Info

Publication number
CN117931506A
CN117931506A CN202410096192.4A CN202410096192A CN117931506A CN 117931506 A CN117931506 A CN 117931506A CN 202410096192 A CN202410096192 A CN 202410096192A CN 117931506 A CN117931506 A CN 117931506A
Authority
CN
China
Prior art keywords
target
verification
child node
document
regular expression
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410096192.4A
Other languages
Chinese (zh)
Inventor
李全
黄博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202410096192.4A priority Critical patent/CN117931506A/en
Publication of CN117931506A publication Critical patent/CN117931506A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a document verification method, a device, equipment and a storage medium. The method comprises the following steps: responding to a verification request initiated by the front end, and determining a target document input by a user at the front end and request contents of target child nodes; the request content is sent to the back end, and the back end is controlled to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table; and verifying the target document by adopting the target regular expression, generating a target verification result, and responding to the verification request according to the target verification result. According to the technical scheme, the documents can be checked through interaction of the front end and the rear end of the browser by adopting the preset target positioning table and the target check table, so that the normalization and the accuracy of the data in the running process of the system are ensured.

Description

Document verification method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for verifying a document.
Background
In application systems in the fields of banks and the like, because a large amount of data, configuration, protocol and template information exchange exists between the systems and the third party system service, the standardization and accuracy of the exchanged information must be ensured, so that the service flow is standardized, the service risk is prevented, and therefore, the data often needs to be checked.
XML (extensible Markup Language) is a common data format, which can describe complex data structures, and is commonly used for transmitting and storing data, and has important significance in checking the data.
Therefore, how to verify the document by adopting a preset target positioning table and a target verification table through interaction of the front end and the rear end of the browser, and ensuring the normalization and the accuracy of data in the running process of the system is a problem to be solved urgently at present.
Disclosure of Invention
The invention provides a document verification method, a device, equipment and a storage medium, which are used for verifying a document by adopting a preset target positioning table and a target verification table through interaction of front and rear ends of a browser, so that data normalization and accuracy in a system operation process are ensured.
According to an aspect of the present invention, there is provided a document verification method including:
Responding to a verification request initiated by the front end, and determining a target document input by a user at the front end and request contents of target child nodes;
the request content is sent to the back end, and the back end is controlled to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table;
And verifying the target document by adopting the target regular expression, generating a target verification result, and responding to the verification request according to the target verification result.
According to another aspect of the present invention, there is provided a document verification apparatus including:
The determining module is used for responding to the verification request initiated by the front end and determining a target document input by a user at the front end and the request content of the target child node;
The query module is used for sending the request content to the rear end, controlling the rear end to query and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table;
and the response module is used for verifying the target document by adopting the target regular expression, generating a target verification result and responding to the verification request according to the target verification result.
According to another aspect of the present invention, there is provided an electronic apparatus including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the document verification method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement a document verification method according to any one of the embodiments of the present invention when executed.
According to the technical scheme, the target document input by a user at the front end and the request content of the target child node are determined in response to a verification request initiated by the front end; the request content is sent to the back end, and the back end is controlled to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table; and verifying the target document by adopting the target regular expression, generating a target verification result, and responding to the verification request according to the target verification result. Through interaction of the front end and the rear end of the browser, a preset target positioning table and a target verification table are adopted to verify the document, so that the normalization and accuracy of data in the running process of the system can be ensured.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a document verification method according to an embodiment of the present invention;
FIG. 2A is a flowchart illustrating an XSD file parsing process according to a second embodiment of the present invention;
fig. 2B is a schematic diagram of a front-end verification process according to a second embodiment of the present invention;
FIG. 2C is a schematic diagram illustrating a back-end verification process according to a second embodiment of the present invention;
FIG. 3 is a block diagram of a document verification apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," "candidate," "alternative," and the like in the description and claims of the invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Note that XSD (XML Schema Definition) is a language for defining XML document structure and content. It provides a canonical way to describe elements, attributes, and data types of an XML document and defines the validity of the data and constraint. In the related art, the methods for realizing XML document verification by XSD include the following methods:
1. Verification function built in programming language: many programming languages (e.g., java, C#, python, etc.) provide built-in libraries or modules that can be used to verify XML documents using XSD files. These libraries typically provide validation functions or classes that can take as input an XML document and a corresponding XSD file, and then return the validation results. The developer may use the corresponding verification functionality based on the particular programming language and library documents.
2. Using a third party XML parsing library: many third party XML parsing libraries (e.g., xerces, lxml, xmlschema, etc.) provide the functionality to verify XML documents. These libraries typically provide APIs or functions related to XSD verification that can be used directly to verify the validity of XML documents. The developer can select libraries suitable for own programming language and requirements and perform verification operations according to documents and examples of the libraries.
3. Command line tool: some command line tools (e.g., xmllint, xsd. Exe, etc.) also provide the functionality to check XML documents. These tools may typically execute directly from the command line, receive an XML document and corresponding XSD file as input, and return a verification result. The developer can implement verification of the XML document by invoking these command line tools.
4. Checking in an XML editor: many XML editors (e.g., XMLSpy, visual Studio, etc.) provide the functionality of XSD verification. These editors typically automatically check the validity of an XML document when it is edited and give an error or warning message. These editors may be used by developers to inspect and verify XML documents.
However, the inputs to these methods are XML files, which means that each XSD verification requires verification of the entire XML file. For a real-time operating system, the whole process needs to convert input information into an XML file, and then a calling program checks whether the input information has errors. The feedback of the whole process is relatively slow, and the defects of repeated verification, huge consumed memory resources, namely, low efficiency, untimely feedback, large consumed resources and the like exist in the existing XSD verification possibly exist.
According to the technical scheme, the target positioning table, the target verification table and the target regular expression are generated in advance according to the XSD file, so that the matching verification of the target document input by the user can be realized directly through front-end and back-end interaction, the comprehensive repeated analysis of the whole target document is avoided, the necessity of converting the target document input by the user into an XML format is avoided, the accuracy and the efficiency of document verification can be effectively improved, and the specific implementation mode is described in detail in the following embodiment.
Example 1
FIG. 1 is a flowchart of a document verification method according to an embodiment of the present invention; the embodiment can be suitable for the situation that the browser controls front-end and back-end interaction to verify the XML document, the method can be executed by a document verification device, the document verification device can be realized in a hardware and/or software mode, the document verification device can be configured in electronic equipment and executed by the browser, and the browser comprises a front end and a back end. As shown in fig. 1, the document verification method includes:
s101, responding to a verification request initiated by the front end, and determining a target document input by a user at the front end and request content of a target child node.
Wherein, the front end refers to the front end of the browser. The check request may be an AJAX (Asynchronous JavaScript And XML, asynchronous JS and XML) request issued by the front end when loading the page. The target document refers to text corresponding to the corresponding text input by the user, and the format of the target document can be an xml format. The target child node refers to a child node for which the target performs verification. The request content refers to the request content contained in the verification request, and specifically may include the name of the target child node and/or path information of the target child node.
Optionally, text information input by the user at the front end can be directly obtained based on an interactive interface with the user to obtain the target document, the child node related to the user request can be further determined as the target child node according to analysis on the target document, and finally, the request content of the target child node is obtained according to analysis on the verification request.
S102, sending the request content to the back end, and controlling the back end to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table.
The target positioning table refers to a table for front-end or back-end call node positioning, paths and names of the child nodes can be stored in the target positioning table, the target checking table refers to a table for checking the target document by adopting constraint conditions after regularization, and names, types and constraints of the child nodes and constraint conditions (i.e. regular expressions) after regularization can be stored in the target checking table. The target location table and the target verification table are determined by a pre-defined target XSD (XML Schema Definition) file. The target regular expression refers to a regular expression that the target child node needs to satisfy.
It should be noted that, because the child node has multiplexing condition, the path and name of the child node can be stored in the target positioning table, which is denoted as a table a, so as to facilitate positioning in the procedure of calling front-end and back-end programs. In addition, the name, type, constraint and corresponding regular expression of the child node are stored in a target check table, and are expressed as a table B.
Optionally, according to the request content, a preset target positioning table and a target check table, querying to obtain a target regular expression corresponding to the target child node includes: determining whether the request content contains name information of a target child node; if not, matching is carried out in a preset target positioning table according to the path information of the target child node in the request content so as to determine the name information of the target child node; and matching in the target check table according to the name information of the target child node so as to determine a target regular expression corresponding to the target child node.
The back end may obtain the node name through the input child node path lookup table a, so as to obtain the type of the child node and the corresponding regular expression through the lookup table B, that is, determine the target regular expression corresponding to the target child node.
Optionally, after determining whether the request content includes the name information of the target child node, the method further includes: if the request content contains the name information of the target child node, matching is carried out in the target check table according to the name information of the target child node so as to determine a target regular expression corresponding to the target child node.
For example, if the front end directly carries the name of the child node when initiating the request, the corresponding information of the child node can be directly obtained through the lookup table B.
Optionally, after the regular expression of the child node is obtained, the regular expression can be filled in the pattern attribute of the corresponding element through JavaScript, so that after the corresponding text is input by a subsequent user, verification of the input text is completed according to the regular expression.
Optionally, before the control back end queries to obtain the target regular expression corresponding to the target child node according to the request content, the preset target positioning table and the target check table, the method further includes: determining a target XSD file, calling a preset reading program, and analyzing the target XSD file; and generating a target positioning table for positioning the front end and a target verification table for verifying the document according to the analysis result. The preset reading program may be, for example, a JAVA program. The target XSD file refers to a preset file containing child node attribute information.
By way of example, the target XSD file may be read by the JAVA program, and then traversed from the root node to the end of the child node by a backtracking method, so as to obtain the path, name, type and constraint of each child node, thereby implementing parsing of the target XSD file.
Optionally, generating a target positioning table for positioning the front end and a target verification table for verifying the document according to the analysis result includes: determining attribute information of each node in the target XSD file according to the analysis result; the names and paths in the attribute information are stored in a target positioning table, and the names, types and constraints in the attribute information are stored in a target check table to generate the target positioning table and the target check table.
Wherein the attribute information may be path, name, type and constraint of the child node.
Optionally, after generating the target verification table for document verification, the method further includes: determining constraint and data types of each node in a target check table; based on a preset conversion strategy, converting the constraint and the data type in the target check table into a regular expression so as to update the target check table.
The data types are various data types defined in the XSD file, and the data types can be boolean, date, dateTime, decimal, string, time. Constraints refer to constraints on the target document for verifying the validity of XML data, and both data types and constraints can be converted into regular expressions. The conversion policy may be a regular expression generated by associating constraints with data types according to preset conditions that need to be satisfied, such as defining the size of the data types.
For example, the table B may be read by a JAVA program and converted into a corresponding regular expression, so as to implement updating of the target check table.
Optionally, after updating the target check table, correspondingly, the control back end queries the target regular expression corresponding to the target child node according to the request content, the preset target positioning table and the target check table, and uses the updated target check table to query and determine the target regular expression.
S103, checking the target document by using the target regular expression, generating a target checking result, and responding to the checking request according to the target checking result.
Alternatively, the browser may control the backend to substitute text in the target document into the target regular expression, determine whether a condition is satisfied, generate a target verification result,
Optionally, the process of checking is performed at the front end and the back end of the browser respectively, and the final target check result is generated by integrating the two check results, and after the target document input by the user at the front end and the request content of the target child node are determined correspondingly, the method further includes: and the control front end checks the target document according to the request content of the target child node, a preset target positioning table and a target checking table, and generates a front end checking result. Correspondingly, the target document is verified by adopting the target regular expression, and a target verification result is generated, which comprises the following steps: and the control back end adopts a target regular expression to check the target document, generates a back end check result, and generates a target check result according to the front end check result and the back end check result.
For example, if the front end and the rear end are both checked, the target checking result may be determined to be checked, if the front end or the rear end is checked, and if the front end and the rear end are not checked, the front end may be checked.
It should be noted that, the verification process of the back end is unnecessary, after the front end sends the request, the back end will check whether the database contains the leaf node path or the child node name according to the input parameters, and if not, return an error code to the front end. When only byte paths are contained, the name of the child node is obtained through the lookup table A, if the name of the child node is contained, the regular expression is directly obtained through the lookup table B, corresponding verification is completed, and a verification result is returned to the front end.
According to the technical scheme, the target document input by a user at the front end and the request content of the target child node are determined in response to a verification request initiated by the front end; the request content is sent to the back end, and the back end is controlled to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table; and verifying the target document by adopting the target regular expression, generating a target verification result, and responding to the verification request according to the target verification result. Through interaction of the front end and the rear end of the browser, a preset target positioning table and a target verification table are adopted to verify the document, so that the normalization and accuracy of data in the running process of the system and the timeliness of system response interaction can be ensured.
Example two
FIG. 2A is a flowchart illustrating an XSD file parsing process according to a second embodiment of the present invention; fig. 2B is a schematic diagram of a front-end verification process according to a second embodiment of the present invention; FIG. 2C is a schematic diagram illustrating a back-end verification process according to a second embodiment of the present invention; the embodiment provides a preferred example of verifying a target document (such as an XML file) by using an XSD file based on the above embodiment.
For example, referring to fig. 2A, the browser may generate, based on the pre-specified XSD file, a target location table (table a) and a target verification table (table B) before performing verification, and specific implementation steps may include: reading an XSD file, traversing from a root node to a leaf node to obtain attribute information of each child node, further storing paths and names of the child nodes into a table A of a database, converting all constraints of the table B into regular expressions, and finally storing names, types and constraints of the child nodes into the table B after the child nodes are reached.
For example, referring to fig. 2B, when the front end loads the page, an AJAX request may be initiated to the back end, where the AJAX request may include a node name, if the AJAX request does not include a node name, the back end may acquire a child node path of the input box from the table a to determine the node name, and finally acquire a regular expression corresponding to the child node type through the table lookup B, and if the AJAX request includes the node name, may directly acquire a regular expression corresponding to the child node type through the table lookup B; after determining the corresponding regular expression, the regular expression can be filled in the pattern attribute, and when the data input by the user is detected, the browser can complete verification and return a verification result by calling the regular expression in the pattern attribute.
Illustratively, referring to FIG. 2C, the backend may check whether the path or name of the child node is contained in response to an API (Application Programming Interface ) request issued by the front-end; if only paths of the child nodes are included, firstly acquiring the names of the child nodes through a table lookup A, acquiring regular expressions through a table lookup B to complete verification, and waiting for a new API request to be sent by the front end; if only the name of the child node is contained, directly looking up the list B to acquire the regular expression to finish verification, and waiting for the front end to send a new API request; if the check finds that the path and name of the child node are not contained, it is determined that the path and name of the child node are not contained, an error code is returned, and the front end waits for a new API request to be sent out.
The technical proposal of the invention has the following advantages,
1. And (3) automatic treatment: by writing a JAVA program to read the XSD file, extracting node information and generating a regular expression, an automatic processing process can be realized. This reduces the likelihood of manual operation and human error, improving efficiency;
2. Integrity and accuracy: by obtaining the path, name, type and constraint of all nodes in the XSD file. The whole coverage of the whole XSD structure in the verification process is ensured, and the information of all nodes can be captured, so that the accurate verification is performed;
3. flexibility and scalability: by storing the node information in the database table, the node information can be flexibly managed and queried. The scheme has better expandability, and can be adjusted and expanded along with the change of the requirement;
4. Maintainability: the check rules are easy to maintain and update by converting the types and constraints of the nodes into regular expressions and storing them in a database. If the XSD file changes, only the program is required to be rerun to update the verification rules in the database, and the code is not required to be manually changed;
5. Front-rear end separation: by storing regular expressions of nodes in a database, the front-end and back-end can read and use these verification rules independently. The front end can directly use regular expressions to verify data input by a user, and the back end can also use the same rules to verify received data, so that the front end and the back end can achieve data consistency.
Example III
FIG. 3 is a block diagram of a document verification apparatus according to a third embodiment of the present invention; the embodiment can be suitable for the situation that the browser controls the front-end and the back-end to interactively realize the verification of the XML document, and the document verification device provided by the embodiment of the invention can execute the document verification method provided by any embodiment of the invention and has the corresponding functional modules and beneficial effects of the execution method; the document verification device can be realized in the form of hardware and/or software and is configured in a device with a document verification function. As shown in fig. 3, the document verification apparatus specifically includes:
a determining module 301, configured to determine, in response to a verification request initiated by the front end, a target document input by a user at the front end, and a request content for a target child node;
The query module 302 is configured to send the request content to the back end, and control the back end to query and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table;
And the response module 303 is configured to verify the target document by using the target regular expression, generate a target verification result, and respond to the verification request according to the target verification result.
According to the technical scheme, the target document input by a user at the front end and the request content of the target child node are determined in response to a verification request initiated by the front end; the request content is sent to the back end, and the back end is controlled to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table; and verifying the target document by adopting the target regular expression, generating a target verification result, and responding to the verification request according to the target verification result. Through interaction of the front end and the rear end of the browser, a preset target positioning table and a target verification table are adopted to verify the document, so that the normalization and accuracy of data in the running process of the system can be ensured.
Further, the device further comprises:
the generating module is used for determining a target XSD file, calling a preset reading program and analyzing the target XSD file; and generating a target positioning table for positioning the front end and a target verification table for verifying the document according to the analysis result.
Further, the generating module is specifically configured to:
Determining attribute information of each node in the target XSD file according to the analysis result;
The names and paths in the attribute information are stored in a target positioning table, and the names, types and constraints in the attribute information are stored in a target check table to generate the target positioning table and the target check table.
Further, the device is also used for:
determining constraint and data types of each node in a target check table;
Based on a preset conversion strategy, converting the constraint and the data type in the target check table into a regular expression so as to update the target check table.
Further, the query module 302 is specifically configured to:
Determining whether the request content contains name information of a target child node;
If not, matching is carried out in a preset target positioning table according to the path information of the target child node in the request content so as to determine the name information of the target child node;
And matching in the target check table according to the name information of the target child node so as to determine a target regular expression corresponding to the target child node.
Further, the query module 302 is further configured to:
If the request content contains the name information of the target child node, matching is carried out in the target check table according to the name information of the target child node so as to determine a target regular expression corresponding to the target child node.
Further, the device is also used for:
The control front end checks the target document according to the request content of the target child node, a preset target positioning table and a target checking table to generate a front end checking result;
Accordingly, the response module 303 is specifically configured to:
and the control back end adopts a target regular expression to check the target document, generates a back end check result, and generates a target check result according to the front end check result and the back end check result.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention; fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a document verification method.
In some embodiments, the document verification method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the document verification method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the document verification method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A document verification method, comprising:
Responding to a verification request initiated by the front end, and determining a target document input by a user at the front end and request contents of target child nodes;
the request content is sent to the back end, and the back end is controlled to inquire and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table;
And verifying the target document by adopting the target regular expression, generating a target verification result, and responding to the verification request according to the target verification result.
2. The method of claim 1, wherein before the control back-end queries to obtain the target regular expression corresponding to the target child node according to the request content, the preset target positioning table and the target check table, the method further comprises:
determining a target XSD file, calling a preset reading program, and analyzing the target XSD file;
and generating a target positioning table for positioning the front end and a target verification table for verifying the document according to the analysis result.
3. The method of claim 2, wherein generating a target location table for front-end location and a target verification table for document verification based on the parsing result comprises:
Determining attribute information of each node in the target XSD file according to the analysis result;
The names and paths in the attribute information are stored in a target positioning table, and the names, types and constraints in the attribute information are stored in a target check table to generate the target positioning table and the target check table.
4. The method according to claim 2, further comprising, after generating the target verification table for performing document verification:
determining constraint and data types of each node in a target check table;
Based on a preset conversion strategy, converting the constraint and the data type in the target check table into a regular expression so as to update the target check table.
5. The method of claim 1, wherein querying to obtain the target regular expression corresponding to the target child node according to the request content, the preset target positioning table and the target check table comprises:
Determining whether the request content contains name information of a target child node;
If not, matching is carried out in a preset target positioning table according to the path information of the target child node in the request content so as to determine the name information of the target child node;
And matching in the target check table according to the name information of the target child node so as to determine a target regular expression corresponding to the target child node.
6. The method of claim 5, further comprising, after determining whether the request content includes name information of the target child node:
If the request content contains the name information of the target child node, matching is carried out in the target check table according to the name information of the target child node so as to determine a target regular expression corresponding to the target child node.
7. The method of claim 1, wherein after determining the target document entered by the user at the front end and the requested content for the target child node, further comprising:
The control front end checks the target document according to the request content of the target child node, a preset target positioning table and a target checking table to generate a front end checking result;
correspondingly, the target document is verified by adopting the target regular expression, and a target verification result is generated, which comprises the following steps:
and the control back end adopts a target regular expression to check the target document, generates a back end check result, and generates a target check result according to the front end check result and the back end check result.
8. A document verification apparatus, comprising:
The determining module is used for responding to the verification request initiated by the front end and determining a target document input by a user at the front end and the request content of the target child node;
The query module is used for sending the request content to the rear end, controlling the rear end to query and obtain a target regular expression corresponding to the target child node according to the request content, a preset target positioning table and a target check table;
and the response module is used for verifying the target document by adopting the target regular expression, generating a target verification result and responding to the verification request according to the target verification result.
9. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program for execution by the at least one processor to enable the at least one processor to perform the document verification method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the document verification method of any one of claims 1-7.
CN202410096192.4A 2024-01-23 2024-01-23 Document verification method, device, equipment and storage medium Pending CN117931506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410096192.4A CN117931506A (en) 2024-01-23 2024-01-23 Document verification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410096192.4A CN117931506A (en) 2024-01-23 2024-01-23 Document verification method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117931506A true CN117931506A (en) 2024-04-26

Family

ID=90766214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410096192.4A Pending CN117931506A (en) 2024-01-23 2024-01-23 Document verification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117931506A (en)

Similar Documents

Publication Publication Date Title
US11461542B2 (en) Providing asynchronous general user interface (GUI) input
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN113626223A (en) Interface calling method and device
CN115509522A (en) Interface arranging method and system for low-code scene and electronic equipment
CN116360735A (en) Form generation method, device, equipment and medium
CN112416333A (en) Software model training method, device, system, equipment and storage medium
CN116185389A (en) Code generation method and device, electronic equipment and medium
CN117931506A (en) Document verification method, device, equipment and storage medium
CN114707961A (en) Pending task execution method, device, equipment, medium and program product based on approval flow configuration
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN113760240A (en) Method and device for generating data model
CN116382333B (en) Satellite instruction arranging method and device, electronic equipment and storage medium
CN116301869B (en) Front-end page configuration management and control system, method, equipment and medium
CN116756460B (en) Combined data acquisition method and device and related equipment
CN113254826B (en) Dump file processing method and device
CN115934101A (en) Interface document generation method, device, medium and electronic equipment
CN116382640A (en) Method, device, equipment and storage medium for managing micro-service
CN116860751A (en) Data processing method and device, electronic equipment and storage medium
CN118133794A (en) Table configuration method, apparatus, device and storage medium
CN117332773A (en) Method, device, equipment and medium for cascading document design results
CN118210408A (en) Information display method and device, electronic equipment and storage medium
CN117608575A (en) Application development method, system, equipment and storage medium
CN118012897A (en) Heterogeneous database grammar conversion method, device, equipment and storage medium
CN117632652A (en) Recording system, method, equipment and storage medium of browser
CN115686479A (en) File creation method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination