Disclosure of Invention
The embodiment of the invention provides a method and a device for generating a business certificate, which can improve the efficiency of generating the business certificate.
In a first aspect, an embodiment of the present invention provides a method for generating a service credential, including:
constructing a data model according to a set data format;
acquiring a to-be-processed business chart;
determining at least one data object from the to-be-processed business graph, wherein each data object comprises a node name and node content corresponding to the node name;
converting the node name in each data object into a field main key of a set data format according to the data model, and converting the node content corresponding to the current node name into metadata of the set data format;
generating at least one service certificate element by using each field primary key and each metadata;
and combining the at least one service certificate element to form a service certificate.
Preferably, the first and second electrodes are formed of a metal,
the combining the at least one service certificate element to generate a service certificate corresponding to the service chart includes:
determining a size parameter of a service certificate to be generated;
determining the character length corresponding to each service certificate element;
and arranging the service certificate elements according to the character length corresponding to each service certificate element to form the service certificate corresponding to the size parameter.
Preferably, the first and second electrodes are formed of a metal,
further comprising: presetting at least one certificate template corresponding to at least one service type;
before the combining the at least one service credential element to form a service credential, further comprising:
determining a service type corresponding to the service diagram to be processed;
selecting a voucher template corresponding to the determined service category;
the combining the at least one service credential element to form a service credential comprises:
and writing each service certificate element into the selected certificate template to form a service certificate.
Preferably, the first and second electrodes are formed of a metal,
the acquiring of the to-be-processed service chart comprises the following steps:
determining a storage path of the service graph to be processed;
and reading the service chart to be processed from an external service system according to the determined storage path.
Preferably, the first and second electrodes are formed of a metal,
the field primary key includes: any one or more of a service type, a service name, a voucher number, a generation date and a service amount.
In a second aspect, an embodiment of the present invention provides a service credential generating apparatus, including: the device comprises a storage unit, a determination unit, a conversion unit and a generation unit; wherein,
the storage unit is used for storing a data model constructed according to a set data format;
the determining unit is used for acquiring a to-be-processed service diagram and determining at least one data object from the to-be-processed service diagram, wherein each data object comprises a node name and node content corresponding to the node name;
the conversion unit is used for converting the node name in each data object into a field main key with a set data format according to the data model stored in the storage unit, and converting the node content corresponding to the current node name into metadata with the set data format;
the generating unit is configured to generate at least one service credential element by using each field key and each metadata converted by the converting unit, and combine the at least one service credential element to form a service credential.
Preferably, the first and second electrodes are formed of a metal,
the generating unit is used for determining the size parameter of the service certificate to be generated and the character length corresponding to each service certificate element, and arranging each service certificate element according to the character length corresponding to each service certificate element to form the service certificate corresponding to the size parameter.
Preferably, the first and second electrodes are formed of a metal,
further comprising: a setting unit; wherein,
the setting unit is used for setting at least one certificate template corresponding to at least one service type;
the generating unit is further configured to determine a service category corresponding to the to-be-processed service graph, select a credential template corresponding to the determined service category from the setting unit, and write each service credential element into the selected credential template to form a service credential.
Preferably, the first and second electrodes are formed of a metal,
the determining unit is configured to determine a storage path of the to-be-processed service graph, and read the to-be-processed service graph from an external service system according to the determined storage path.
Preferably, the first and second electrodes are formed of a metal,
the field primary key includes: any one or more of a service type, a service name, a voucher number, a generation date and a service amount.
The embodiment of the invention provides a method and a device for generating a business certificate, wherein each business object in a business chart is converted into a field main key with a set data format and corresponding metadata thereof, so that the business certificate can be generated directly according to the field main key with the set data format and the corresponding metadata, and corresponding business rules do not need to be searched one by one according to the format of the business chart and then are converted according to the business rules, thereby improving the efficiency of generating the business certificate.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for generating a service credential, where the method may include the following steps:
step 101, constructing a data model according to a set data format;
step 102, acquiring a to-be-processed business chart;
step 103, determining at least one data object from the to-be-processed service graph, wherein each data object comprises a node name and node content corresponding to the node name;
step 104, converting the node name in each data object into a field main key with a set data format according to the data model, and converting the node content corresponding to the current node name into metadata with the set data format;
step 105, generating at least one service certificate element by using each field main key and each metadata;
and 106, combining the at least one service certificate element to form a service certificate.
In the embodiment, each business object in the business chart is converted into the field main key with the set data format and the corresponding metadata thereof, so that the business voucher can be generated directly according to the field main key with the set data format and the corresponding metadata, the corresponding business rules do not need to be searched one by one according to the format of the business chart, and then the conversion is performed according to the business rules, thereby improving the efficiency of generating the business voucher.
Specifically, in an embodiment of the present invention, the detailed implementation of step 106 may include:
determining a size parameter of a service certificate to be generated;
determining the character length corresponding to each service certificate element;
and arranging the service certificate elements according to the character length corresponding to each service certificate element to form the service certificate corresponding to the size parameter.
For example, if the service certificate to be generated is a rectangle with fixed length and fixed width, a table with a corresponding number of rows and columns can be formed in the rectangle with fixed length and fixed width according to the number of the service certificate elements, the size parameters of each row and each column in the table are determined according to the character length of each service certificate element, and then each service certificate is arranged in a corresponding cell in the table to form the service certificate.
Specifically, when the service certificate to be generated is an electronic certificate with the resolution of 80 × 40, and the service certificate elements include the service type, financial, service name, office supplies, certificate number, 00011, generation date, 2017.01.01, and service amount, 100, a five-row and two-column form can be set on an 80 × 40 picture backplane according to the number of the service certificate elements, as shown in table 1, field main keys and metadata corresponding to each service certificate element are respectively filled in the form, and the size of a cell and the size of a character number of a character can be adjusted in a two-way manner according to the character length of each service certificate element, so that the generated service certificate is arranged neatly and attractively, and user experience is improved.
TABLE 1
| Type of service | Finance affairs |
| Name of service | Office appliance |
| Voucher number | 00011 |
| Date of creation | 2017.01.01 |
| Amount of service | 100 |
In order to further improve the generation efficiency of the service credential, in an embodiment of the present invention, the method for generating the service credential may further include: presetting at least one certificate template corresponding to at least one service type;
before step 106, it may further include:
determining a service type corresponding to the service diagram to be processed;
selecting a voucher template corresponding to the determined service category;
the combining the at least one service credential element to form a service credential comprises:
and writing each service certificate element into the selected certificate template to form a service certificate.
For example, a voucher template corresponding to the financial voucher can be preset, and the voucher template comprises templates in the forms of tax invoices, transfer vouchers, receipts and the like. After receiving the service chart to be processed, selecting a corresponding voucher template according to the service category of the service chart to be processed, for example, if receiving a service chart in a tax form, selecting a corresponding tax invoice template, and writing each service voucher element into the voucher template to form a service voucher. In this case, the unit name, the invoice number, the specific money and the amount corresponding thereto corresponding to the service may be sequentially written on the template of the tax invoice to form a corresponding tax invoice. By presetting templates of various business categories, when generating the voucher, various business voucher elements can be directly written into the corresponding templates according to the business categories of the business chart, so that the arrangement form of each business voucher element is not required to be adjusted according to the properties (number, character length and the like) of the business voucher elements in the process of generating the business voucher, the workload of generating the voucher is reduced, and the efficiency of generating the business voucher is improved. In addition, corresponding business vouchers are generated according to voucher templates respectively corresponding to various business categories, so that the business vouchers corresponding to the same business category are the same in type, a user can conveniently check and transmit the business vouchers, and the user experience is improved.
In order to further improve the generation efficiency of the service credential, in an embodiment of the present invention, a specific implementation manner of the step 102 may include:
determining a storage path of the service graph to be processed;
and reading the service chart to be processed from an external service system according to the determined storage path.
In the above embodiment, the storage path of at least one to-be-processed service graph in the external service system is determined through preselection, for example, an acquisition link of each to-be-processed service graph is established, and when the to-be-processed service graph is acquired, the to-be-processed service graph can be directly acquired according to the determined storage path, so that the to-be-processed service graph is conveniently acquired, and the generation efficiency of the service voucher is further improved.
In one embodiment of the present invention, the field primary key includes: any one or more of a service type, a service name, a voucher number, a generation date and a service amount.
The following describes in detail a method for generating a business certificate according to an embodiment of the present invention, taking generating a financial certificate as an example, where the method includes the following steps:
step 201, constructing a data model according to a set data format.
For example, if a data model is constructed according to xml (Extensible Markup Language) format, various forms of charts can be converted into xml format according to the data model.
Step 202, setting at least one certificate template corresponding to at least one service type.
For example, voucher templates corresponding to various financial vouchers can be preset, and the templates comprise templates in the forms of tax invoices, transfer vouchers, receipts and the like.
And step 203, determining a storage path of the financial chart to be processed, and reading the financial chart to be processed from the external financial system according to the determined storage path.
For example, each to-be-processed financial chart is uniformly stored in the external financial system, and then an acquisition link of each to-be-processed financial chart can be established, so that the to-be-processed financial chart can be acquired through the acquisition link, and the process of acquiring the to-be-processed financial chart is more convenient.
Step 204, determining at least one data object from the to-be-processed financial chart, wherein each data object comprises a node name and node content corresponding to the node name.
For example, 5 data objects are determined from the to-be-processed finance chart, and each data object respectively comprises contents such as a service type-finance, a service name-office supplies, a certificate number-00011, a generation date-2017.01.01 and a service amount-100, wherein the service type, the service name, the certificate number, the generation date and the service amount are node names, and the specific data thereafter is node contents corresponding to the node names. The nodes and the corresponding node contents thereof are different according to the format of the financial chart to be processed, and the formats of the nodes and the corresponding node contents thereof are also different.
Step 205, according to the data model, converting the node name in each data object into a field primary key of a set data format, and converting the node content corresponding to the node name at present into metadata of the set data format.
For example, according to a data model constructed in an xml format, each node in different formats and the content of the node thereof are converted into a field primary key in a uniform xml format and metadata in the xml format respectively corresponding to each field primary key.
And step 206, generating at least one service certificate element by using each field main key and each metadata.
And generating a business certificate element by using each field primary key and the corresponding metadata thereof, so that the business certificate elements with the number corresponding to the field primary keys can be generated, and here, 5 corresponding certificate elements are generated.
And step 207, determining the business category corresponding to the financial chart to be processed, and selecting a voucher template corresponding to the determined business category.
For example, when receiving a business form of tax form, selecting a corresponding tax invoice template, and writing each business voucher element into the voucher template to form a business voucher. In this case, the unit name, the invoice number, the specific money and the amount corresponding thereto corresponding to the service may be sequentially written on the template of the tax invoice to form a corresponding tax invoice.
And 208, writing each service certificate element into the selected certificate template to form a service certificate.
In addition, each business voucher element can be arranged in a user-defined mode according to the size parameter of the business voucher to be generated and the character length of each business voucher element, and a corresponding tax invoice is generated.
In the above embodiment, at least one data object is determined from the obtained service graph, and then according to a pre-constructed data model with a set data format, a node name included in each data object is converted into a field main key with the set data format, and node content corresponding to the node name is converted into metadata with the set data format corresponding to the field main key. And generating at least one service certificate element by using each converted field main key and each corresponding metadata, and combining each service certificate element to form a service certificate. Because each business object in the business chart is converted into the field main key with the set data format and the corresponding metadata thereof, the business voucher can be directly generated according to the field main key with the set data format and the corresponding metadata, and the corresponding business rules do not need to be searched one by one according to the format of the business chart and then are converted according to the business rules, thereby improving the efficiency of generating the business voucher.
As shown in fig. 3, an embodiment of the present invention provides a service credential generating apparatus, including: a storage unit 301, a determination unit 302, a conversion unit 303, and a generation unit 304; wherein,
the storage unit 301 is configured to store a data model constructed according to a set data format;
the determining unit 302 is configured to obtain a to-be-processed service graph, and determine at least one data object from the to-be-processed service graph, where each data object includes a node name and a node content corresponding to the node name;
the converting unit 303 is configured to convert the node name in each data object determined in the determining unit 302 into a field main key in a set data format according to the data model stored in the storage unit 301, and convert the node content corresponding to the node name into metadata in the set data format;
the generating unit 304 is configured to generate at least one service credential element by using each field key and each metadata converted by the converting unit 303, and combine the at least one service credential element to form a service credential.
In the above embodiment, at least one data object is determined from the obtained service graph, and then according to a pre-constructed data model with a set data format, a node name included in each data object is converted into a field main key with the set data format, and node content corresponding to the node name is converted into metadata with the set data format corresponding to the field main key. And generating at least one service certificate element by using each converted field main key and each corresponding metadata, and combining each service certificate element to form a service certificate. Because each business object in the business chart is converted into the field main key with the set data format and the corresponding metadata thereof, the business voucher can be directly generated according to the field main key with the set data format and the corresponding metadata, and the corresponding business rules do not need to be searched one by one according to the format of the business chart and then are converted according to the business rules, thereby improving the efficiency of generating the business voucher.
Specifically, in an embodiment of the present invention, the generating unit 304 is configured to determine a size parameter of a service credential to be generated and a character length corresponding to each service credential element, and arrange each service credential element according to the character length corresponding to each service credential element, so as to form a service credential corresponding to the size parameter.
For example, if the service certificate to be generated is a rectangle with fixed length and fixed width, a table with a corresponding number of rows and columns can be formed in the rectangle with fixed length and fixed width according to the number of the service certificate elements, the size parameters of each row and each column in the table are determined according to the character length of each service certificate element, and then each service certificate is arranged in a corresponding cell in the table to form the service certificate.
Specifically, when the service certificate to be generated is an electronic certificate with the resolution of 80 × 40, and the service certificate elements include the service type, financial, service name, office supplies, certificate number, 00011, generation date, 2017.01.01, and service amount, 100, a five-row and two-column form can be set on an 80 × 40 picture backplane according to the number of the service certificate elements, as shown in table 2, field main keys and metadata corresponding to each service certificate element are respectively filled in the form, and the size of the cell and the size of the character number of the character can be adjusted in two directions according to the character length of each service certificate element, so that the generated service certificate is arranged neatly and attractively, and user experience is improved.
TABLE 2
| Type of service | Finance affairs |
| Name of service | Office appliance |
| Voucher number | 00011 |
| Date of creation | 2017.01.01 |
| Amount of service | 100 |
In order to further improve the generation efficiency of the service credential, in an embodiment of the present invention, as shown in fig. 4, the service credential generating apparatus may further include: a setting unit 401; wherein,
the setting unit 401 is configured to set at least one credential template corresponding to at least one service category;
the generating unit 304 is further configured to determine a service category corresponding to the to-be-processed service graph, select a credential template corresponding to the determined service category from the setting unit 401, and write each service credential element into the selected credential template to form a service credential.
For example, a voucher template corresponding to the financial voucher can be preset, and the voucher template comprises templates in the forms of tax invoices, transfer vouchers, receipts and the like. After receiving the service chart to be processed, selecting a corresponding voucher template according to the service category of the service chart to be processed, for example, if receiving a service chart in a tax form, selecting a corresponding tax invoice template, and writing each service voucher element into the voucher template to form a service voucher. In this case, the unit name, the invoice number, the specific money and the amount corresponding thereto corresponding to the service may be sequentially written on the template of the tax invoice to form a corresponding tax invoice. By presetting templates of various business categories, when generating the voucher, various business voucher elements can be directly written into the corresponding templates according to the business categories of the business chart, so that the arrangement form of each business voucher element is not required to be adjusted according to the properties (number, character length and the like) of the business voucher elements in the process of generating the business voucher, the workload of generating the voucher is reduced, and the efficiency of generating the business voucher is improved. In addition, corresponding business vouchers are generated according to voucher templates respectively corresponding to various business categories, so that the business vouchers corresponding to the same business category are the same in type, a user can conveniently check and transmit the business vouchers, and the user experience is improved.
In order to further improve the generation efficiency of the service credential, in an embodiment of the present invention, the determining unit 302 is configured to determine a storage path of the to-be-processed service graph, and read the to-be-processed service graph from an external service system according to the determined storage path.
In the above embodiment, the storage path of at least one to-be-processed service graph in the external service system is determined through preselection, for example, an acquisition link of each to-be-processed service graph is established, and when the to-be-processed service graph is acquired, the to-be-processed service graph can be directly acquired according to the determined storage path, so that the to-be-processed service graph is conveniently acquired, and the generation efficiency of the service voucher is further improved.
In one embodiment of the present invention, the field primary key includes: any one or more of a service type, a service name, a voucher number, a generation date and a service amount.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
The present invention further provides a readable medium, which includes an execution instruction, and when a processor of a storage controller executes the execution instruction, the storage controller executes the service credential generation method provided in any of the above embodiments of the present invention.
In addition, the present invention also provides a memory controller comprising: a processor, a memory, and a bus; the memory is configured to store an execution instruction, the processor is connected to the memory through the bus, and when the storage controller runs, the processor executes the execution instruction stored in the memory, so that the storage controller executes the service credential generation method provided in any of the above embodiments of the present invention.
In summary, the embodiments of the present invention have at least the following advantages:
1. in the embodiment of the invention, at least one data object is determined from the acquired service graph, then the node name included in each data object is converted into the field main key of the set data format according to the pre-constructed data model of the set data format, and the node content corresponding to the node name is converted into the metadata of the set data format corresponding to the field main key. And generating at least one service certificate element by using each converted field main key and each corresponding metadata, and combining each service certificate element to form a service certificate. Because each business object in the business chart is converted into the field main key with the set data format and the corresponding metadata thereof, the business voucher can be directly generated according to the field main key with the set data format and the corresponding metadata, and the corresponding business rules do not need to be searched one by one according to the format of the business chart and then are converted according to the business rules, thereby improving the efficiency of generating the business voucher.
2. In the embodiment of the invention, the service voucher elements are arranged according to the size parameters of the service voucher to be generated and the character lengths corresponding to the service voucher elements respectively to form the service voucher corresponding to the size parameters, so that the generated service voucher is arranged neatly and attractively, and the user experience is improved.
3. In the embodiment of the invention, at least one certificate template corresponding to at least one business category is preset, the corresponding certificate template is selected according to the business category corresponding to the business chart to be processed, and each business certificate element is written into the selected certificate template to form the business certificate, so that the workload of generating the certificate is reduced, the efficiency of generating the business certificate is improved, the user can conveniently check and transmit the business certificate, and the user experience is improved.
4. In the embodiment of the invention, the storage path of at least one to-be-processed service chart in the external service system is determined through preselection, and the to-be-processed service chart can be directly obtained according to the determined storage path when being obtained, so that the to-be-processed service chart is convenient to obtain, and the generation efficiency of the service certificate is further improved.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.