CN112287651A - Template conversion method and device, storage medium and computer equipment - Google Patents

Template conversion method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN112287651A
CN112287651A CN202011179402.4A CN202011179402A CN112287651A CN 112287651 A CN112287651 A CN 112287651A CN 202011179402 A CN202011179402 A CN 202011179402A CN 112287651 A CN112287651 A CN 112287651A
Authority
CN
China
Prior art keywords
conversion
template
linked list
data
node
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
CN202011179402.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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011179402.4A priority Critical patent/CN112287651A/en
Publication of CN112287651A publication Critical patent/CN112287651A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a template conversion method and device, a storage medium and computer equipment, relates to the technical field of data processing, and mainly aims to solve the problems of poor conversion efficiency and low precision of the existing template. The method comprises the following steps: when a received template conversion request is received, determining a conversion target to be converted in a template; acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path; and performing replacement processing according to the conversion data and the conversion target to complete the conversion of the template. The method is mainly used for converting the template.

Description

Template conversion method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a template conversion method and apparatus, a storage medium, and a computer device.
Background
With the gradual development of the risk control of the insurance industry, the wind control system becomes an important underwriting link. However, the stored data format templates corresponding to the data in different data sources are different, and in order to enable the wind control system to effectively collect the data, template conversion is usually performed on the data in different data source systems, for example, a credit investigation report is converted into data in other forms to be stored.
At present, preprocessing is needed before conversion of an existing report template, partial data in preprocessing is configuration data, an online process cannot be changed, data need to be read from a database based on a value-taking path every time, frequent interaction with the database is needed under the high concurrency condition, a large amount of resource consumption is generated, a recursion method is adopted for conversion, regular expression matching data needs to be conducted on template nodes, time consumption is slightly high, secondary processing needs to be conducted on generated data, and therefore frequent data redundancy is generated, and the template conversion efficiency is poor and the template conversion precision is low.
Disclosure of Invention
In view of the above, the present invention provides a template conversion method and apparatus, a storage medium, and a computer device, and mainly aims to solve the problems of poor conversion efficiency and low accuracy of the existing template.
According to an aspect of the present invention, there is provided a template conversion method, including:
when a received template conversion request is received, determining a conversion target to be converted in a template;
acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path;
and performing replacement processing according to the conversion data and the conversion target to complete the conversion of the template.
Further, before determining the template node information to be converted in the template when the received template conversion request is received, the method further includes:
acquiring template nodes in a template to be converted;
splitting according to the node information in the template nodes to obtain linked list nodes, value taking paths and storage positions of the template nodes;
extracting conversion data from the storage position based on the value taking path, establishing a corresponding relation between the linked list nodes and the conversion data and the conversion target, and generating a template conversion linked list according to linked list hierarchy according to the corresponding relation.
Further, the splitting according to the node information in the template node to obtain the linked list node, the value taking path, and the storage location of the template node includes:
according to the character string attributes, a first character string belonging to a linked list node, a second character string belonging to a value-taking path and a third character string belonging to a storage position are split from a plurality of character strings of the node information, wherein the character string attributes are used for representing the use of the character strings in different node information.
Further, the generating the template transformation linked list according to the linked list hierarchy according to the correspondence includes:
and sequentially generating a template conversion linked list which has linked list hierarchy and contains the corresponding relation according to the linked list nodes, wherein the linked list hierarchy is used for representing the relation between linked list father nodes and linked list child nodes in the template conversion linked list.
Further, the obtaining, from the generated template conversion linked list, conversion data matched with the conversion target according to the linked list hierarchy includes:
searching whether a linked list node which is matched with the conversion target and serves as a linked list father node exists in the template conversion linked list, and if yes, acquiring the conversion data from linked list elements matched with the linked list nodes;
and if the link list nodes do not have the conversion targets, searching whether the link list nodes with the same hierarchy as the link list nodes have the matched conversion targets, and if so, acquiring the conversion data from the link list elements of the searched link list nodes.
Further, the method further comprises:
and if the conversion data matched with the conversion target is not found in the template conversion linked list, searching the conversion data matched with the conversion target from a preset template conversion database, wherein the conversion data matched with all the conversion targets are stored in the preset template conversion database.
Further, after the performing the replacement processing according to the conversion data and the conversion target and completing the conversion of the template, the method further includes:
storing the replaced conversion data into a template list in a writing stack mode, and recording and storing the conversion data into a storage position of the stack;
and when an output request is received, acquiring the conversion data from the storage position in a stack reading mode for outputting.
According to another aspect of the present invention, there is provided a template converting apparatus, comprising:
the determining module is used for determining a conversion target to be converted in the template when the received template conversion request is received;
the acquisition module is used for acquiring conversion data matched with the conversion target according to the chain table level from the generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on the value taking path;
and the processing module is used for carrying out replacement processing according to the conversion data and the conversion target so as to complete the conversion of the template.
Further, the apparatus further comprises: a module for generating a plurality of modules,
the acquisition module is also used for acquiring template nodes in the template to be converted;
the processing module is further configured to perform splitting processing according to the node information in the template node to obtain a linked list node, a value taking path, and a storage location of the template node;
the generating module is used for extracting conversion data from the storage position based on the value taking path, establishing a corresponding relation between the linked list node and the conversion data and the conversion target, and generating a template conversion linked list according to a linked list hierarchy according to the corresponding relation.
Further, the processing module is specifically configured to split a first character string belonging to a linked list node, a second character string belonging to a value-taking path, and a third character string belonging to a storage location from the plurality of character strings of the node information according to a character string attribute, where the character string attribute is used to characterize the use of the character strings in different node information.
Further, the generating module is specifically configured to generate a template transformation linked list that has a linked list hierarchy and includes the correspondence in sequence according to the linked list nodes.
Further, the obtaining module comprises:
the first searching unit is used for searching whether a linked list node which is matched with the conversion target and is used as a linked list father node exists in the template conversion linked list, and if the linked list node exists, the conversion data is obtained from the linked list element matched with the linked list node;
and a second searching unit, configured to search whether a linked list node having the same link list node hierarchy as the linked list node has a matching conversion target if the linked list node does not have the conversion target, and obtain the conversion data from a linked list element of the searched linked list node if the linked list node has the matching conversion target, where a linked list child node is node information determined by a next template node having a linked list hierarchy with a linked list parent node.
Further, the apparatus further comprises:
and the searching module is used for searching the conversion data matched with the conversion target from a preset template conversion database if the conversion data matched with the conversion target is not searched in the template conversion linked list, wherein the conversion data matched with all the conversion targets are stored in the preset template conversion database.
Further, the apparatus further comprises;
the storage module is used for storing the replaced conversion data into a template list in a stack writing mode and recording and storing the conversion data into a storage position of the stack;
and the output module is used for acquiring the conversion data from the storage position in a stack reading mode for outputting when receiving an output request.
According to another aspect of the present invention, there is provided a storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the conversion method of the template.
According to still another aspect of the present invention, there is provided a computer apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the template conversion method.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
the invention provides a template conversion method and device, a storage medium and computer equipment, compared with the prior art, the embodiment of the invention determines a conversion target to be converted in a template when a received template conversion request is received; acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path; and performing replacement processing according to the conversion data and the conversion target to complete conversion of the template, achieving the purpose of extracting the conversion data based on a storage structure in a linked list form, greatly reducing the interaction times with a database aiming at the same conversion target, matching and searching the conversion target based on each node in the linked list form, and reducing data redundancy without performing secondary processing on the data, thereby improving the conversion efficiency and precision of the template.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. In the drawings:
FIG. 1 is a flow chart of a template transformation method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another template transformation method provided by the embodiment of the invention;
fig. 3 is a schematic structural diagram illustrating a template transformation linked list according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating a template transformation apparatus according to an embodiment of the present invention;
FIG. 5 is a block diagram of another template transformation apparatus provided in an embodiment of the present invention;
fig. 6 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
An embodiment of the present invention provides a template conversion method, as shown in fig. 1, the method includes:
101. and when the received template conversion request is received, determining a conversion target to be converted in the template.
The template is a form in which a system with a data processing function stores entered data when entering data, and is applicable to, but not limited to, application scenarios such as reports, resumes, charts and the like, for example, for a wind control system, the entered data is a credit investigation report, and a corresponding template is a credit investigation report template.
It should be noted that the conversion target is used to represent data that needs to be converted in the template, including but not limited to text data, picture data, language data, etc., the conversion target to be converted in the template may include one or more data to be converted, generally, when the template is generated, the position or area where different data is in the template is marked as a template node to distinguish different data, for example, a name is stored in a name column area of the template, and an age is stored in an age column area of the template to determine different data. Therefore, when determining a conversion target to be converted, the conversion target to be converted may be determined according to the positions or areas of different marks in the template, for example, the conversion target is determined to be credit data according to the credit score identifier, and the embodiment of the present invention is not limited specifically.
102. And acquiring conversion data matched with the conversion target from the generated template conversion linked list according to the linked list hierarchy.
The template conversion linked list is a composite linked list composed of a plurality of sub-link lists, each sub-link list is a list with a list head, a list tail and link list elements, and the link list hierarchy is used for representing the relationship between a link list father node and a link list child node in the template conversion linked list. Specifically, any sub-chain table may be used as a chain table parent node of the next sub-chain table, or may be used as a chain table child node of the previous sub-chain table, thereby forming a matching chain table with a chain table hierarchy, where a head of one sub-chain table is pointed to by a head of the sub-chain table serving as the chain table parent node, and the head of the next sub-chain table serving as the chain table child node points to a head of the next sub-chain table, thereby completing a link.
It should be noted that, because the template transformation linked list includes a plurality of sub-link lists, and a linked list element of each sub-link list stores one piece of data included in one transformation target and transformation data to be transformed, when it is determined that a linked list element is a transformation target, the transformation data also stored in the linked list element is acquired.
103. And performing replacement processing according to the conversion data and the conversion target to complete the conversion of the template.
For the embodiment of the invention, the conversion data matched with the conversion target is sequentially searched through the pre-generated template conversion linked list, the rapid search of the template conversion is realized, and the conversion data and the conversion target are replaced after the conversion data is obtained, the conversion of the template is realized, the resource loss caused by repeatedly utilizing the value taking path to read the database is reduced, and the efficiency of the template conversion is improved.
Compared with the prior art, the embodiment of the invention provides a template conversion method, and the embodiment of the invention determines a conversion target to be converted in a template when a received template conversion request is received; acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path; and performing replacement processing according to the conversion data and the conversion target to complete conversion of the template, achieving the purpose of extracting the conversion data based on a storage structure in a linked list form, greatly reducing the interaction times with a database aiming at the same conversion target, matching and searching the conversion target based on each node in the linked list form, and reducing data redundancy without performing secondary processing on the data, thereby improving the conversion efficiency and precision of the template.
An embodiment of the present invention provides another template conversion method, as shown in fig. 2, the method includes:
201. and acquiring template nodes in the template to be converted.
For the embodiment of the invention, in order to pre-establish the template conversion linked list for template conversion so as to realize fast and accurate search of the conversion data to be converted, firstly, the template nodes in the template to be converted are obtained. The template node is a node in the template that needs to convert data, and may be characterized as a node that includes at least one template that needs to be converted, and specifically, a position or an area in the template may be marked as the template node, for example, if the template to be converted is a credit investigation report, the template node may be a name corresponding to the name node of the template, credit investigation information of up to 5 years corresponding to the credit investigation information node of the template, and the embodiment of the present invention is not particularly limited. In addition, one template node may contain one or more conversion targets, for example, the template node is basicocinc, and includes three conversion targets, entName, userName, regNo.
202. And splitting according to the node information in the template node to obtain the linked list node, the value taking path and the storage position of the template node.
For the embodiment of the invention, in order to establish the template conversion linked list, simplify the acquisition steps of the conversion data in the conversion process, reduce the data interaction with each database and split the node information in the template node in advance. Specifically, the template nodes include different conversion targets and value-taking modes of the different conversion targets, that is, conversion data is acquired from the storage location through a value-taking path, so that data interaction is directly performed with the database during each conversion. However, in order to avoid frequent interaction, after determining the template node, splitting the node information, where the node information includes 3 attributes to be subjected to template conversion, that is, a value taking path, a storage location, and template data before conversion.
For the embodiment of the present invention, in order to further refine and explain the split content of the node information, step 202 specifically includes: and splitting a first character string belonging to a linked list node, a second character string belonging to a value-taking path and a third character string belonging to a storage position from a plurality of character strings of the node information according to the character string attributes.
Specifically, the node information comprises different character strings with 3 attributes, converted data content can be obtained from storage by using a value-taking path, in addition, the node information is split by using the character string attributes, in the embodiment of the invention, the character strings with different character string attributes are divided by using different symbols, therefore, the splitting processing is that the character strings with the value-taking path and the linked list nodes are obtained by combining the character strings with different attributes according to different symbols, for example, the character strings with the attributes are separated according to a blank space and then are separated according to an equal number. And the character string attribute is used for representing the purpose of character strings in different node information. For example, the template node is named basicninc, and includes three conversion targets, which are respectively entName, userName, regNo, and each conversion data corresponds to a value taking path, that is, when entName is { application. When the userName is { application. When the regNo is { application. And the value taking path can obtain that basicocinc is an entrname and userName linked list node, and basicocincmap is the storage positions of the entrname and the userName.
203. Extracting conversion data from the storage position based on the value taking path, establishing a corresponding relation between the linked list nodes and the conversion data and the conversion target, and generating a template conversion linked list according to linked list hierarchy according to the corresponding relation.
For the embodiment of the invention, in order to enable the template conversion linked list to sequentially store the conversion data matched with the conversion targets only according to the linked list hierarchy so as to realize the purpose of extracting the conversion content of each template for conversion, the conversion data is extracted from the storage position based on the value taking path, the corresponding relation between the linked list nodes and the conversion data and the conversion targets is established, and the template conversion linked list is generated according to the linked list hierarchy according to the corresponding relation. Specifically, for example, the first character string, the second character string, and the third character string after splitting are respectively represented as a linked list node, a value taking path, and a value taking position, and if the node information of the template target, which is entNam, is split, the corresponding node information is obtained: entNam, application. busiblaze. iccompany map. basicicmanmap. entname, basicicmanmap, transformation data "company" extracted from basicicmanmap by the value path application. busiblaze. iccompany map. basicicmanmap. In addition, a corresponding relationship between the linked list node and the conversion data and the conversion target is established, that is, the linked list node and the extraction conversion data and the conversion target are spliced, specifically, the linked list node and the extraction conversion data are spliced and then combined into the splice with the conversion target, for example, entName ═ company ═ userName ═ minimum brightness ═ regNo ═ 1234 "is respectively the splice between the linked list node and the conversion data, the established corresponding relationship is < basicnentname ═ company ═ userName ═ company" userName ═ minimum brightness "regNo ═ 1234" >, the template conversion linked list of the linked list node basicninc includes respectively entName ═ company ═ userName ═ minimum brightness, and regNo ═ 1234 "sublist, wherein the templates entName ═ userName, regNo ═ regNo correspond to the company, the minimum brightness, and the 1234 respectively.
For further limitation and description, step 203 of the embodiment of the present invention specifically includes: and sequentially generating a template conversion linked list which has linked list hierarchy and contains the corresponding relation according to the linked list nodes, wherein the linked list hierarchy is used for representing the relation between linked list father nodes and linked list child nodes in the template conversion linked list.
Specifically, each link list node may be a link list parent node or a link list child node, and is not specifically limited, a first template switching link list is configured by using the link list node, and a corresponding relationship matched with the link list node is stored in the link list element of the link list node, so that when a matched link list node is searched, data is directly extracted from the link list element of the link list node. In addition, a template conversion linked list with linked list hierarchy is established, namely, the determination is carried out according to the relation between linked list nodes, for example, the template node is a, and the template node b is converted after the template node a according to the conversion attribute, so that when the data conversion linked list is established, the table tail of the linked list node a obtained by splitting the template node a points to the table head of the linked list node b obtained by splitting the template node b, if a plurality of template nodes with the relation exist, a plurality of sub-chain tables with the hierarchy relation are established, and a composite template linked list is formed. As shown in the structural diagram of the template switching linked list shown in fig. 3, in a single sublink, the structures of the head, the tail and the linked list elements of the table and the structure of the template switching linked list composed of a plurality of compounded sublinks can be obtained, and a complete template switching is performed by combining the linked list elements in each sublink according to the relationship between the template nodes to perform query switching in sequence.
204. And when the received template conversion request is received, determining a conversion target to be converted in the template.
205. And acquiring conversion data matched with the conversion target from the generated template conversion linked list according to the linked list hierarchy.
For the embodiment of the present invention, step 205 specifically includes: and searching whether a linked list node which is matched with the conversion target and serves as a linked list father node exists in the template conversion linked list, and if so, acquiring the conversion data from linked list elements matched with the linked list nodes.
For the embodiment of the invention, in order to realize efficient and accurate searching of the conversion data based on the template conversion linked list, after the conversion target is determined, whether the conversion target exists or not is searched from the template conversion linked list, generally, when the template conversion linked list is established, the relationship between the conversion target and the linked list nodes is also stored in the linked list elements, so that when inquiring is carried out, whether the linked list nodes serving as linked list father nodes exist matched conversion targets or not can be inquired, and if the linked list nodes exist, the conversion data is acquired from the linked list elements of the linked list nodes.
For the embodiment of the present invention, step 205 further includes: and if the link list nodes do not have the conversion targets, searching whether the link list nodes with the same hierarchy as the link list nodes have the matched conversion targets, and if so, acquiring the conversion data from the link list elements of the searched link list nodes.
For the embodiment of the invention, in order to improve the effectiveness of template conversion and avoid losing conversion data, if the link table node does not have the conversion target, whether a matching conversion target exists in the sub link tables in other same levels can be searched, thereby realizing the searching process of the conversion data. And extracting the conversion data from the link list elements in the searched link list nodes.
It should be noted that, in the embodiment of the present invention, because the child link tables of the plurality of linked list child nodes pointed by the linked list parent node are established based on the node relationship, the conversion target is not found in the linked list parent node, and the conversion target is not found in the child link table of the pointed linked list child node, so that the child link tables that are the parent nodes of the linked lists in the same hierarchy need to be found, which is not specifically limited in the embodiment of the present invention.
206. And if the conversion data matched with the conversion target is not found in the template conversion linked list, searching the conversion data matched with the conversion target from a preset template conversion database.
For the embodiment of the invention, in order to improve the efficiency of template conversion and realize the effectiveness of template conversion, if the conversion data matched with the conversion target is not found in the template conversion linked list, the value taking path is indicated as taking the corresponding conversion data, so that the conversion data matched with the conversion target is found from the preset template conversion database. The preset template conversion database stores conversion data matched with all conversion targets, namely, the preset template conversion database is a guarantee mechanism for template conversion, when the conversion data cannot be searched in the template conversion linked list, in order to enable the template conversion to have effectiveness, a mode of data interaction with the database is adopted once, so that the conversion data matched with the conversion targets is searched in the preset template conversion database, and the conversion guarantee for the template is realized because the conversion data corresponding to all the conversion targets are stored in the preset template conversion database.
207. And performing replacement processing according to the conversion data and the conversion target to complete the conversion of the template.
Further, in order to implement storage and output of the converted template, the embodiment of the present invention further includes: and storing the replaced conversion data into a template list in a writing stack mode, and recording and storing the conversion data into a storage position of the stack. And when an output request is received, acquiring the conversion data from the storage position in a stack reading mode for outputting.
Specifically, the template list is a storage form after template conversion, so that when different template forms are output, the template form is directly obtained from the template list, wherein the template form includes tables, block diagrams and the like in different forms, that is, the converted data after replacement is stored in an intermediate medium, and when an output request is currently received, the converted data is obtained from the template list as the intermediate medium. In addition, in order to output the replaced conversion data in a corresponding template form, when the conversion data is stored in the template list, the conversion data is stored in a stack writing mode, that is, each conversion data is written into the template list one by one, and a storage position written based on the stack writing mode is recorded, so that when the conversion data is output, the conversion data is acquired in a stack reading mode according to the storage position, and the conversion data is output, and therefore the overall output efficiency of the template is completely realized.
Compared with the prior art, the embodiment of the invention provides another template conversion method, and the embodiment of the invention determines a conversion target to be converted in the template when a received template conversion request is received; acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path; and performing replacement processing according to the conversion data and the conversion target to complete conversion of the template, achieving the purpose of extracting the conversion data based on a storage structure in a linked list form, greatly reducing the interaction times with a database aiming at the same conversion target, matching and searching the conversion target based on each node in the linked list form, and reducing data redundancy without performing secondary processing on the data, thereby improving the conversion efficiency and precision of the template.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present invention provides a template conversion apparatus, as shown in fig. 4, the apparatus includes:
a determining module 31, configured to determine, when a template conversion request is received, a conversion target to be converted in a template;
an obtaining module 32, configured to obtain, from a generated template conversion linked list, conversion data matched with the conversion target according to a linked list hierarchy, where the template conversion linked list stores conversion data obtained by different conversion targets based on a value taking path;
and the processing module 33 is configured to perform replacement processing according to the conversion data and the conversion target, so as to complete conversion of the template.
Compared with the prior art, the embodiment of the invention provides a template conversion device, and the embodiment of the invention determines a conversion target to be converted in a template when a received template conversion request is received; acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path; and performing replacement processing according to the conversion data and the conversion target to complete conversion of the template, achieving the purpose of extracting the conversion data based on a storage structure in a linked list form, greatly reducing the interaction times with a database aiming at the same conversion target, matching and searching the conversion target based on each node in the linked list form, and reducing data redundancy without performing secondary processing on the data, thereby improving the conversion efficiency and precision of the template.
Further, as an implementation of the method shown in fig. 2, an embodiment of the present invention provides another template conversion apparatus, as shown in fig. 5, the apparatus includes:
a determining module 41, configured to determine, when a template conversion request is received, a conversion target to be converted in a template;
an obtaining module 42, configured to obtain, from a generated template conversion linked list, conversion data matched with the conversion target according to a linked list hierarchy, where the template conversion linked list stores conversion data obtained by different conversion targets based on a value taking path;
and the processing module 43 is configured to perform replacement processing according to the conversion data and the conversion target, so as to complete conversion of the template.
Further, the apparatus further comprises: the generation module 44 is used to generate a model,
the obtaining module 42 is further configured to obtain a template node in the template to be converted;
the processing module 43 is further configured to perform splitting processing according to the node information in the template node, so as to obtain a linked list node, a value taking path, and a storage location of the template node;
the generating module 44 is configured to extract conversion data from the storage location based on the value taking path, establish a correspondence between the linked list node and the conversion data and the conversion target, and generate a template conversion linked list according to a linked list hierarchy according to the correspondence.
Further, the processing module 43 is specifically configured to split, according to a character string attribute, a first character string belonging to a linked list node, a second character string belonging to a value-taking path, and a third character string belonging to a storage location from a plurality of character strings of the node information, where the character string attribute is used to characterize the use of the character strings in different node information.
Further, the generating module 44 is specifically configured to generate a template switching linked list having a linked list hierarchy and including the correspondence according to the linked list nodes in sequence, where the linked list hierarchy is used to represent a relationship between a linked list parent node and a linked list child node in the template switching linked list.
Further, the obtaining module 42 includes:
a first searching unit 4201, configured to search, from the template conversion linked list, whether a linked list node serving as a linked list parent node that matches the conversion target exists, and if the linked list node exists, obtain the conversion data from a linked list element that matches the linked list node;
a second searching unit 4202, configured to search, if the conversion target does not exist in the linked list node, whether a matched conversion target exists in the linked list node having the same link level as the linked list node, and if the matched conversion target exists, obtain the conversion data from a linked list element of the searched linked list node, where a child linked list node is node information determined by a next template node having a link level with a parent linked list node.
Further, the apparatus further comprises:
the searching module 45 is configured to search the conversion data matched with the conversion target from a preset template conversion database if the conversion data matched with the conversion target is not found in the template conversion linked list, where the conversion data matched with all the conversion targets is stored in the preset template conversion database.
Further, the apparatus further comprises;
a storage module 46, configured to store the replaced conversion data in a template list in a manner of writing to a stack, and record and store the conversion data in a storage location in the stack;
and the output module 47 is used for acquiring the conversion data from the storage position in a stack reading mode for outputting when an output request is received.
Compared with the prior art, the embodiment of the invention provides another template conversion device, and the embodiment of the invention determines a conversion target to be converted in the template when the received template conversion request is received; acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path; and performing replacement processing according to the conversion data and the conversion target to complete conversion of the template, achieving the purpose of extracting the conversion data based on a storage structure in a linked list form, greatly reducing the interaction times with a database aiming at the same conversion target, matching and searching the conversion target based on each node in the linked list form, and reducing data redundancy without performing secondary processing on the data, thereby improving the conversion efficiency and precision of the template.
According to an embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, and the computer executable instruction can execute the template conversion method in any of the above method embodiments.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computer device.
As shown in fig. 6, the computer apparatus may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein: the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically execute relevant steps in the embodiment of the template conversion method described above.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The computer device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may specifically be used to cause the processor 502 to perform the following operations:
when a received template conversion request is received, determining a conversion target to be converted in a template;
acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path;
and performing replacement processing according to the conversion data and the conversion target to complete the conversion of the template.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for converting a template, comprising:
when a received template conversion request is received, determining a conversion target to be converted in a template;
acquiring conversion data matched with the conversion target according to a chain table level from a generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on a value taking path;
and performing replacement processing according to the conversion data and the conversion target to complete the conversion of the template.
2. The method of claim 1, wherein before determining the template node information to be converted in the template when the template conversion request is received, the method further comprises:
acquiring template nodes in a template to be converted;
splitting according to the node information in the template nodes to obtain linked list nodes, value taking paths and storage positions of the template nodes;
extracting conversion data from the storage position based on the value taking path, establishing a corresponding relation between the linked list nodes and the conversion data and the conversion target, and generating a template conversion linked list according to linked list hierarchy according to the corresponding relation.
3. The method of claim 2, wherein the splitting according to the node information in the template node to obtain the linked list nodes, the value-taking paths, and the storage locations of the template node comprises:
according to the character string attributes, a first character string belonging to a linked list node, a second character string belonging to a value-taking path and a third character string belonging to a storage position are split from a plurality of character strings of the node information, wherein the character string attributes are used for representing the use of the character strings in different node information.
4. The method of claim 2, wherein generating the template translation chain table according to the correspondence and the chain table hierarchy comprises:
and sequentially generating a template conversion linked list which has linked list hierarchy and contains the corresponding relation according to the linked list nodes, wherein the linked list hierarchy is used for representing the relation between linked list father nodes and linked list child nodes in the template conversion linked list.
5. The method of claim 4, wherein the obtaining, from the generated template transformation linked list, transformation data matching the transformation target according to a linked list hierarchy comprises:
searching whether a linked list node which is matched with the conversion target and serves as a linked list father node exists in the template conversion linked list, and if yes, acquiring the conversion data from linked list elements matched with the linked list nodes;
and if the link list nodes do not have the conversion targets, searching whether the link list nodes with the same hierarchy as the link list nodes have the matched conversion targets, and if so, acquiring the conversion data from the link list elements of the searched link list nodes.
6. The method according to any one of claims 2-5, further comprising:
and if the conversion data matched with the conversion target is not found in the template conversion linked list, searching the conversion data matched with the conversion target from a preset template conversion database, wherein the conversion data matched with all the conversion targets are stored in the preset template conversion database.
7. The method according to claim 1, wherein after the performing the replacement process according to the transformation data and the transformation target completes the transformation of the template, the method further comprises:
storing the replaced conversion data into a template list in a writing stack mode, and recording and storing the conversion data into a storage position of the stack;
and when an output request is received, acquiring the conversion data from the storage position in a stack reading mode for outputting.
8. A template switching apparatus, comprising:
the determining module is used for determining a conversion target to be converted in the template when the received template conversion request is received;
the acquisition module is used for acquiring conversion data matched with the conversion target according to the chain table level from the generated template conversion chain table, wherein the template conversion chain table stores the conversion data acquired by different conversion targets based on the value taking path;
and the processing module is used for carrying out replacement processing according to the conversion data and the conversion target so as to complete the conversion of the template.
9. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the method of converting a template according to any one of claims 1-7.
10. A computer device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the template conversion method according to any one of claims 1-7.
CN202011179402.4A 2020-10-29 2020-10-29 Template conversion method and device, storage medium and computer equipment Pending CN112287651A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011179402.4A CN112287651A (en) 2020-10-29 2020-10-29 Template conversion method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011179402.4A CN112287651A (en) 2020-10-29 2020-10-29 Template conversion method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN112287651A true CN112287651A (en) 2021-01-29

Family

ID=74374088

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011179402.4A Pending CN112287651A (en) 2020-10-29 2020-10-29 Template conversion method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN112287651A (en)

Similar Documents

Publication Publication Date Title
US9858270B2 (en) Converting data into natural language form
US6510425B1 (en) Document search method for registering documents, generating a structure index with elements having position of occurrence in documents represented by meta-nodes
JP4940973B2 (en) Logical structure recognition processing program, logical structure recognition processing method, and logical structure recognition processing apparatus
CN111680634B (en) Document file processing method, device, computer equipment and storage medium
CN117056471A (en) Knowledge base construction method and question-answer dialogue method and system based on generation type large language model
CN112925563B (en) Code reuse-oriented source code recommendation method
US20220414463A1 (en) Automated troubleshooter
CN113836038A (en) Test data construction method, device, equipment and storage medium
CN113434482A (en) Data migration method and device, computer equipment and storage medium
CN111984745B (en) Database field dynamic expansion method, device, equipment and storage medium
KR100326936B1 (en) System and method for translating foreign language phonetic presentation of korean word to korean word and retrieving information related to translated korean word
CN110008448B (en) Method and device for automatically converting SQL code into Java code
CN112287651A (en) Template conversion method and device, storage medium and computer equipment
CN112925874B (en) Similar code searching method and system based on case marks
CN115114297A (en) Data lightweight storage and search method and device, electronic equipment and storage medium
CN114116779A (en) Deep learning-based power grid regulation and control field information retrieval method, system and medium
CN114372177A (en) Excel table data matching method
JPH10283368A (en) Information processor and method therefor
CN105589803A (en) Method and terminal device for generating test tool
CN116383233B (en) Distributed database high-speed retrieval method and system
CN115242612B (en) Fault diagnosis method and device
Xia et al. A novel data schema integration framework for the human-centric services in smart city
CN113297089B (en) Knowledge graph-based mass measurement assistant implementation method
CN117194410B (en) Method and system for generating business report by artificial intelligence language model
CN117874088B (en) Data fuzzy matching method, device, equipment and medium

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