CN111445319A - Voucher generation method and device, computer equipment and storage medium - Google Patents

Voucher generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111445319A
CN111445319A CN202010097697.4A CN202010097697A CN111445319A CN 111445319 A CN111445319 A CN 111445319A CN 202010097697 A CN202010097697 A CN 202010097697A CN 111445319 A CN111445319 A CN 111445319A
Authority
CN
China
Prior art keywords
rule
certificate
credential
service type
level cache
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
CN202010097697.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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010097697.4A priority Critical patent/CN111445319A/en
Publication of CN111445319A publication Critical patent/CN111445319A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/12Accounting
    • G06Q40/125Finance or payroll

Abstract

The application relates to the technical field of data processing, and the promotion of certificate making efficiency is realized through multi-level cache. Specifically disclosed are a credential generation method, apparatus, computer device and storage medium, the method comprising: acquiring a certificate rule from a database, and respectively storing the certificate rule in a preset primary cache or a preset secondary cache according to the rule type of the certificate rule; if the data to be certified is received, determining a service type identifier corresponding to the data to be certified; reading the certificate rule corresponding to the service type identification from the second-level cache, and judging whether the certificate rule corresponding to all the service type identifications is read or not; if the certificate rule corresponding to the service type identifier is not read, reading the certificate rule corresponding to the service type identifier from the primary cache according to the unread service type identifier; and according to the certificate rules corresponding to all the service type identifications, making the certificate of the data to be made to obtain the certificate corresponding to the data to be made.

Description

Voucher generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a credential generation method and apparatus, a computer device, and a storage medium.
Background
The voucher is a written certificate which is compiled according to a certain format and used for registering an accounting book and is used for recording the occurrence of economic business so as to define economic responsibility. In order to meet the requirement of financial business integration, most enterprise management software integrates a business system, and the business system can convert business data into a certificate according to a predefined certificate rule.
The voucher rules are usually stored in the same storage space, and the voucher rules required for selecting the service data from the numerous voucher rules are not efficient, so that the speed of generating the voucher is low, the working efficiency of the user is difficult to improve, and a quick voucher generation method is required to realize the improvement of the certificate making efficiency.
Disclosure of Invention
The embodiment of the application provides a certificate generation method, a certificate generation device, a computer device and a storage medium, and the method and the device can be used for accelerating the speed of reading a certificate rule required by a generated certificate by setting a multi-level cache, so that the certificate making efficiency is improved.
In a first aspect, the present application provides a credential generation method, including:
acquiring a certificate rule from a database, and respectively storing the certificate rule in a preset first-level cache or a preset second-level cache according to the rule type of the certificate rule, wherein the reading speed of the second-level cache is higher than that of the first-level cache;
if the data to be certified is received, determining a service type identifier corresponding to the data to be certified;
reading the certificate rule corresponding to the service type identification from the second-level cache, and judging whether the certificate rule corresponding to all the service type identifications is read or not;
if the certificate rule corresponding to the service type identifier is not read, reading the certificate rule corresponding to the service type identifier from the primary cache according to the unread service type identifier;
and according to the certificate rules corresponding to all the service type identifications, making the certificate of the data to be made to obtain the certificate corresponding to the data to be made.
In a second aspect, the present application provides a credential generation apparatus comprising:
the rule obtaining module is used for obtaining the certificate rules from the database and respectively storing the certificate rules in a preset first-level cache or a preset second-level cache according to the rule types of the certificate rules, and the reading speed of the second-level cache is higher than that of the first-level cache;
the identification determining module is used for determining a service type identification corresponding to the data to be certified if the data to be certified is received;
the first reading module is used for reading the certificate rule corresponding to the service type identifier from the second-level cache and judging whether the certificate rule corresponding to all the service type identifiers is read or not;
the second reading module is used for reading the certificate rule corresponding to the service type identifier from the first-level cache according to the unread service type identifier if the certificate rule corresponding to the service type identifier is not read;
and the certificate generation module is used for making the certificate of the data to be made according to the certificate rules corresponding to all the service type identifications to obtain the certificate corresponding to the data to be made.
In a third aspect, the present application provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and implement the credential generation method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the credential generation method is implemented.
The application discloses a voucher generation method, a device, computer equipment and a storage medium, wherein voucher rules are respectively stored in a preset first-level cache or a preset second-level cache according to rule types corresponding to the voucher rules; then reading a certificate rule corresponding to the service type identification from the secondary cache according to the service type identification corresponding to the data to be certified, and judging whether the certificate rule corresponding to all the service type identifications is read or not; and if the certificate rule corresponding to the service type identifier is not read, reading the certificate rule corresponding to the service type identifier from the primary cache according to the unread service type identifier, and then making the certificate of the data to be made according to all the obtained certificate rules. By the method, the rate of reading the certificate rule can be improved, and the certificate making efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a credential generation method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of credential rule acquisition according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a credential rule table obtained by classifying credential rules;
fig. 4 is a schematic structural diagram of a credential generating device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another credential generating device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation. In addition, although the division of the functional blocks is made in the device diagram, in some cases, it may be divided in blocks different from those in the device diagram.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The embodiment of the application provides a certificate generation method, a certificate generation device, computer equipment and a storage medium. The certificate generation method can be used for improving the speed of reading the certificate rule, so that the certificate making efficiency is improved.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, an embodiment of the present application provides a credential generation method. The credential generation method may be applied to a server, for example. The certificate generation method is used for carrying out hierarchical storage on certificate rules according to rule types and sequentially obtaining the certificate rules in the hierarchical storage according to the business type identification corresponding to the data to be certified, so that the speed of reading the certificate rules is increased, and the certification efficiency is improved.
As shown in fig. 1, the credential generation method specifically includes the following steps S11 to S15
S11, obtaining the certificate rule from the database, and storing the certificate rule in a preset first-level cache or second-level cache according to the rule type of the certificate rule, wherein the reading speed of the second-level cache is faster than that of the first-level cache.
The server comprises a database for storing the certificate rule, or the certificate rule can be acquired from the database of other servers, wherein the certificate rule is used for inputting the data to be certified into the certificate template corresponding to the data to be certified so as to finish the certification.
Specifically, the credential rules stored in the database have different use probabilities and different modification frequencies, for example, some credential rules are common credential rules during certificate making, belong to basic credential rules, and have high use probabilities and low modification frequencies; some certificate rules are only applicable to part of data to be certified, so the use probability is low, the certificate rules belong to extended certificate rules, and the frequency of modifying the extended certificate rules according to the data to be certified is high.
In some embodiments, the credential rules are divided into a base credential rule and an extended credential rule according to a probability of use and a frequency of modification of the credential rule, the frequency of modification of the base credential rule being lower than the extended credential rule.
Specifically, the credential rules stored in the database can be classified into two types according to the modification frequency and data general situation of the credential rules: one is basic certificate rules which are low in modification frequency and general to business data, and the basic certificate rules are basically unchanged; the other is an extended credential rule which is a credential rule that has a high modification frequency and can be modified along with the operation of the terminal.
In some embodiments, the database stores a credential rule table, where the credential rule table includes a plurality of credential rules and rule types corresponding to the credential rules, where the rule types include a base type and an extension type, and the rule type may be used as an identifier of the credential rule. The certificate rule corresponding to the basic type is a certificate rule which is low in modification frequency and general for business data, and is a basic certificate rule; the certificate rule corresponding to the extension type is a certificate rule which has high modification frequency and can be modified along with the operation of the terminal, namely the extension certificate rule.
When the server calls the certificate rule from the database, all the certificate rules corresponding to the identification can be called according to the identification corresponding to the certificate rule, namely the rule type. For example, when the server retrieves the basic credential rule from the database, all credential rules with the rule type as the basic type may be retrieved from the database according to the identifier corresponding to the basic credential rule, that is, the rule type. Or when the server calls the extended voucher rule from the database, all voucher rules with the rule type as the extended type can be called from the database according to the identification corresponding to the extended voucher rule, namely the rule type.
In some embodiments, the database may set a basic credential rule table and an extended credential rule table according to rule types corresponding to credential rules, that is, a basic type and an extended type, and store the basic credential rule and the extended credential rule into the basic credential rule table or the extended credential rule table according to the corresponding rule types, respectively. When obtaining the voucher rules from the database, the voucher rule table corresponding to the rule types in the database can be called according to the rule types, and then all the voucher rules corresponding to the voucher types can be obtained.
In some embodiments, the storing the credential rule in a preset first-level cache or a preset second-level cache according to the rule type corresponding to the credential rule specifically includes:
loading the basic certificate rule to a preset second-level cache;
and loading the extended certificate rule to a preset first-level cache.
The basic certificate rule is a general certificate rule during certificate making, the use probability is high, the reading speed of the second-level cache is higher than that of the first-level cache, and therefore the reading speed of the certificate rule can be increased by storing the basic certificate rule by the second-level cache, and the certificate making speed is improved.
And S12, if the data to be certified is received, determining the service type identifier corresponding to the data to be certified.
The server receives a certificate making request sent by a user from a terminal, wherein the certificate making request comprises data to be made, or the certificate making request comprises a storage address of the data to be made, and the data to be made can be obtained according to the storage address.
The data to be certified comprises a service type identifier corresponding to the data to be certified, and the service type identifier is used for distinguishing certificate rules required by the data to be certified. Or the server can determine a certificate rule required for making the data to be made the certificate according to the data to be made the certificate, and obtain the service type identifier. The service type identifier may be used to match credential rules.
In some embodiments, the service type identification may be used to directly match underlying credential rules; the service type identification comprises a service type coding field, the extended voucher rule comprises a corresponding service type coding field, and the service type coding field is unique, so that the extended voucher rule corresponding to the data to be certified can be matched according to the service type coding field in the data to be certified.
And S13, reading the certificate rule corresponding to the service type identifier from the secondary cache, and judging whether the certificate rule corresponding to all the service type identifiers is read.
And reading a certificate rule corresponding to the service type identifier from the secondary cache according to the service type identifier, namely reading a basic certificate rule corresponding to the service type identifier.
In some embodiments, since the credential rule stored in the secondary cache is a basic credential rule, and the basic credential rule is common to the certification authority, that is, common to the data to be certified, the basic credential rule can be directly read according to the service type identifier of the data to be certified.
The server is preset with a plurality of certificate templates, and different certificate types and different certificate templates corresponding to different service types are different. In order to facilitate the automatic generation of the financial voucher, the server stores a mapping file corresponding to the voucher template. The mapping file can record the mapping relation between the certificate template and the service type corresponding to the data to be certified. Specifically, the server may obtain, by querying the mapping file, a credential template corresponding to the data to be certified by using the service type identifier corresponding to the data to be certified.
And judging whether all rules required for making the certificate are read from the secondary cache area. Specifically, if all rules required for making the data to be made are obtained in the secondary cache, the data to be made are input to a certificate template corresponding to the data to be made according to the read certificate rules to generate a certificate; if the service type identifier does not match the corresponding certificate rule, which indicates that all rules required for making the certificate are not read from the secondary cache region, the certificate rule required for making the certificate of the data to be made is required to be continuously read from the primary cache region.
In some embodiments, each service type has a corresponding credential template, so that the credential template corresponding to the data to be certified can be obtained according to the service type of the data to be certified. The certificate rules store the corresponding relation between the field names in each certificate template and the data to be certified, and the corresponding data to be certified can be imported into the items to be filled corresponding to the field names of the certificate templates through the certificate rules.
Specifically, if all credential rules required for making the data to be certified are acquired in the secondary cache and a credential template corresponding to the data to be certified is acquired according to the data to be certified, the corresponding position relationship between the data to be certified and the items to be filled corresponding to the field names of the credential template is confirmed according to the acquired credential rules, and the corresponding data to be certified is imported into the corresponding items to be filled in the credential template, for example, after one data field W (such as a business type) in the data to be certified is confirmed according to the credential rules to correspond to a field name Y (such as a business) in the credential template, the field name Y corresponds to the item to be filled in Z (such as a business type item), the data field W is imported into the item to be filled in Z, and after all the corresponding data to be certified are imported into the credential template, the server may generate a credential for the data to be certified using a credential template populated with the data to be certified.
S14, if the certificate rule corresponding to the service type identification is not read, reading the certificate rule corresponding to the service type identification from the first-level cache according to the unread service type identification.
And if the basic certificate rule read from the secondary cache area is not enough to complete the certification of the data to be certified, that is, all certificate rules corresponding to the data to be certified are not inquired, acquiring the extended certificate rule corresponding to the data to be certified in the primary cache area according to the service type coding field in the service type identifier corresponding to the unread data to be certified.
In some embodiments, the first-level cache region stores credential rules with low common frequency and high modification frequency of the data to be certified, that is, extended credential rules. If the to-be-filled items corresponding to the credential templates corresponding to the acquired to-be-certified data cannot be completely filled according to the basic credential rules acquired in the secondary cache, that is, if the to-be-filled items still exist, the required credential rules need to be continuously searched in the primary cache.
Exemplarily, if all credential rules required for making the data to be made are acquired in the primary cache, the corresponding relationship between the data to be made and the making template corresponding to the data to be made, that is, the corresponding relationship between the data to be made and the to-be-filled items in the making template, is confirmed according to the read extended credential rules, and the corresponding data to be made is input to the to-be-filled items in the credential template corresponding to the data to be made. And when the to-be-filled items in the certificate template are completely filled, the server can generate the certificate of the to-be-certified data by using the certificate template filled with the to-be-certified data.
In some embodiments, after reading the credential rule corresponding to the service type identifier from the primary cache according to the unread service type identifier, the method further includes:
and if the certificate rule corresponding to the service type identifier is not read in the second-level cache and the first-level cache, reading the certificate rule corresponding to the service type identifier from a database according to the unread service type identifier.
Due to a system failure, such as downtime, the credential rules generated by the database may not be stored in the credential rule table, resulting in the loss of the credential rules stored in the credential rule table. The server directly calls the certificate rule from the certificate rule table and stores the certificate rule in a preset first-level cache and a preset second-level cache, so the certificate rule which cannot be read in the second-level cache and the first-level cache can be read in the database sometimes.
Illustratively, if the credential rule required for completing the certification of the data to be certified cannot be read in the second-level cache and the first-level cache, that is, the credential rule corresponding to the service type identifier is not read in the second-level cache and the first-level cache, the credential rule corresponding to the service type identifier is read from the database according to the unread service type identifier.
In some embodiments, after reading the credential rule corresponding to the service type identifier from the database according to the unread service type identifier, the method further includes:
and storing the certificate rule in a preset first-level cache or second-level cache according to the rule type corresponding to the certificate rule read from the database.
Exemplarily, if a rule type corresponding to a credential rule obtained from a database is a basic credential, storing the obtained credential rule in a preset secondary cache; and if the rule type corresponding to the certificate rule acquired from the database is the extended certificate, storing the acquired certificate rule in a preset first-level cache. In some embodiments, the credential generation method further includes, specifically, further including:
if the certificate rule corresponding to the service type identifier is not read in the second-level cache, the first-level cache and the database, prompting a user to input a user-defined certificate rule according to the unread service type identifier;
and if the user-defined voucher rule input by the user is obtained, storing the user-defined voucher rule in a preset primary cache or a preset secondary cache according to the rule type corresponding to the user-defined voucher rule.
Specifically, the voucher rule corresponding to the service data is not queried in the database, and the server sends the information of failure query to the terminal and requests the user to add the user-defined voucher rule. And after receiving the request for adding the custom credential rule, the user inputs data required by adding the custom credential rule at the terminal. And the server acquires the data and generates a user-defined certificate rule according to the data.
In some embodiments, the generating a custom credential rule according to the data specifically includes:
acquiring rule setting data input by a user from a terminal;
and generating a self-defined certificate rule according to the data input by the terminal.
Specifically, the data input by the terminal can be directly input by manual operation, or data in a preset data dictionary on the business system is selected, wherein the data dictionary comprises a data dictionary of minimum elements in a regular configuration and a data dictionary of subject codes. And the server generates a custom credential rule according to data manually and directly input by the terminal or data selected in the data dictionary.
In some embodiments, after generating the custom credential rule according to the data input by the terminal, the method further includes:
and storing the user-defined voucher rule in a voucher rule table and a preset primary cache or a preset secondary cache according to the rule type corresponding to the user-defined voucher rule.
And S15, according to the certificate rules corresponding to all the service type identifications, making the certificate of the data to be made to obtain the certificate corresponding to the data to be made.
Specifically, according to all acquired certificate rules, namely according to all read certificate rules of the service type identifier corresponding to the data to be certified, the data to be certified is filled in the corresponding position in the certification template corresponding to the data to be certified, and thus the certification is completed.
Illustratively, after all credential rules required for making the data to be made are acquired, the corresponding relationship between the data to be made and the making template corresponding to the data to be made is confirmed according to the acquired credential rules, that is, the corresponding relationship between the data to be made and the items to be filled in the making template, and the corresponding data to be made is input into the items to be filled in the credential template corresponding to the data to be made. And when the to-be-filled items in the certificate template are completely filled, the server can generate the certificate of the to-be-certified data by using the certificate template filled with the to-be-certified data.
In some embodiments, as shown in fig. 2, the credential generating method specifically includes step S21 and step S22.
And step S21, if the newly added certificate rule is obtained, determining the rule type of the newly added certificate rule.
In some embodiments, the user may manually input data through the terminal, or select data in a data dictionary preset on the service system, so as to add the new credential rule. The data dictionary comprises a data dictionary of minimum elements of a rule configuration and a data dictionary of subject codes.
Illustratively, after the newly added credential rule is stored in the database, a rule newly added prompt may be generated. And according to the rule addition prompt, the server can acquire the newly added certificate rule in the database.
And determining the rule type corresponding to the newly added certificate rule according to the change frequency and the data general condition of the certificate rule, for example, determining whether the newly added certificate rule belongs to a basic certificate rule or an extended certificate rule.
And step S22, adding the newly added credential rule and the corresponding rule type to the credential rule table.
Exemplarily, if it is determined that the newly added credential rule is a basic credential rule, a rule type corresponding to the newly added credential rule, that is, a basic type, is used as an identifier for facilitating subsequent reading, and then the basic type and the newly added credential rule are added to the credential rule table together; and if the newly added certificate rule is determined to be an extended certificate rule, taking a rule type corresponding to the newly added certificate rule, namely an extended type, as an identifier convenient for subsequent reading, and then adding the extended type and the newly added certificate rule to the certificate rule table together.
In some embodiments, the newly added credential rule may be stored in a preset primary cache or a preset secondary cache according to a rule type corresponding to the newly added credential rule.
In some embodiments, the credential generation method further includes, specifically, further including:
and if the change information of the certificate rules in the database is acquired, the certificate rules stored in the primary cache and/or the secondary cache are adjusted according to the change information. The change information includes at least one of the following information: credential rule addition information, credential rule deletion information, and credential rule modification information.
Specifically, whether the certificate rules in the database are changed such as modification or addition/deletion is monitored, and if the change information is monitored, the certificate rules stored in the primary cache and/or the secondary cache are adjusted according to the change information so as to achieve data synchronization.
Illustratively, when the credential rule in the database is changed, such as modified or added or deleted, the credential rule stored in the first-level cache and/or the second-level cache is modified or added or deleted synchronously according to the change, so as to ensure that the credential rule data stored in the first-level cache, the second-level cache and the database are consistent.
Specifically, when a voucher rule in a database is monitored to be changed, change information of the voucher rule is obtained, and the change information includes at least one of the following information: credential rule addition information, credential rule deletion information, and credential rule modification information.
Monitoring change information of the credential rule in the database, illustratively, when the credential rule is newly added in the database, obtaining credential rule addition information corresponding to the newly added credential rule; when the certificate rule stored in the database is deleted, acquiring the certificate rule deletion information corresponding to the deleted certificate rule; when the certificate rule stored in the database is modified, the certificate rule modification information corresponding to the modified certificate rule is obtained.
Specifically, the server receives the change information and generates a change instruction for the first-level cache and/or the second-level cache, where the change instruction includes at least one of the following instructions: a voucher rule adding instruction, a voucher rule deleting instruction and a voucher rule modifying instruction.
Exemplarily, a credential rule adding instruction is generated according to the acquired credential rule adding information corresponding to the newly added credential rule, and the credential rule adding instruction is used for inputting the newly added credential rule to the primary cache or the secondary cache according to the rule type of the newly added credential rule; generating a certificate rule deleting instruction according to the acquired certificate rule deleting information corresponding to the deleted certificate rule, wherein the certificate rule deleting instruction is used for deleting the corresponding certificate rule stored in the first-level cache or the second-level cache; and generating a certificate rule modification instruction according to the acquired certificate rule modification information corresponding to the modified certificate rule, wherein the certificate rule modification instruction is used for modifying the corresponding certificate rule stored in the first-level cache or the second-level cache.
And deleting the stored corresponding certificate rules by the primary cache and/or the secondary cache according to the received change instruction, such as a certificate rule deletion instruction, so that the certificate rules in the primary cache and/or the secondary cache and the certificate rules in the database realize data synchronization.
In some embodiments, when the credential rules stored in the first-level cache and/or the second-level cache are changed, the corresponding credential rules in the database are automatically changed, so that change delay caused by manual change is avoided, the consistency of the credential rules among the first-level cache, the second-level cache and the database is ensured, the rate of acquiring the credential rules is increased, and the efficiency of generating the credentials is improved.
Illustratively, when the credential rules stored in the first-level cache and/or the second-level cache are changed, such as modified or added or deleted, the credential rules stored in the database are synchronously modified or added or deleted according to the change, so as to ensure that the credential rule data stored in the first-level cache, the second-level cache and the database are consistent.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for setting a credential rule table according to an embodiment of the present application. The setting method is used for obtaining the credential rule table.
As shown in fig. 3, the setting method includes steps S31 to S33.
And S31, obtaining sample certificate rules, and training a certificate rule classification model according to the sample certificate rules, wherein the certificate rule classification model can be used for classifying the certificate rules.
In some embodiments, a plurality of credential rules are obtained, and the credential rules are labeled according to rule types corresponding to the credential rules to obtain sample credential rules; and performing model training on a preset natural language processing model according to a sample certificate rule to obtain the certificate rule classification model.
And S32, obtaining a certificate rule, and inputting the certificate rule into the certificate rule classification model for classification to obtain a rule type corresponding to the certificate rule.
And after obtaining the certificate rule, inputting the certificate rule into a certificate rule classification model to obtain a rule type corresponding to the certificate rule. For example, if a credential rule is a basic credential rule, the credential rule is input into a credential rule classification model to obtain a rule type corresponding to the credential rule as a basic type.
S33, storing the voucher rules and the corresponding rule types in a voucher rule table in the database.
Illustratively, the rule types of the classified credential rules, such as base type and extension type, are stored to the database together with the credential rules as an identification of the credential rules.
The application discloses a certificate generation method, which is used for carrying out hierarchical storage on certificate rules according to rule types and sequentially obtaining the certificate rules in the hierarchical storage according to business type identifications corresponding to data to be certified, so that the rate of reading the certificate rules is increased, and the certification efficiency is improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a credential generating device according to an embodiment of the present application, where the credential generating device may be configured in a server or a terminal for executing the credential generating method.
The server may be an independent server or a server cluster. The terminal can be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and a wearable device.
As shown in fig. 4, the credential generating apparatus 400 includes: a rule obtaining module 401, an identity determining module 402, a first reading module 403, a second reading module 404 and a credential generating module 405.
The rule obtaining module 401 is configured to obtain credential rules from a database, and store the credential rules in a preset first-level cache or a preset second-level cache according to rule types of the credential rules, where a reading speed of the second-level cache is faster than that of the first-level cache.
In some embodiments, as shown in fig. 5, the rule obtaining module 401 in the credential generating apparatus 400 includes: a rule obtaining sub-module 4011, a rule processing sub-module 4012, and a rule synchronization sub-module 4013.
The rule obtaining submodule 4011 is configured to load the basic credential rule into a preset secondary cache; and loading the extended certificate rule to a preset first-level cache.
And the rule processing submodule 4012 is configured to determine a rule type of the newly added credential rule if the newly added credential rule in the database is obtained, and add the newly added credential rule and the corresponding rule type to the credential rule table.
The rule change submodule 4013 is configured to, if change information of the credential rule in the database is obtained, adjust the credential rule stored in the primary cache and/or the secondary cache according to the change information; the change information includes at least one of the following information: credential rule addition information, credential rule deletion information, and credential rule modification information.
An identifier determining module 402, configured to determine, if data to be certified is received, a service type identifier corresponding to the data to be certified.
A first reading module 403, configured to read the credential rule corresponding to the service type identifier from the secondary cache, and determine whether to read the credential rule corresponding to all service type identifiers;
a second reading module 404, configured to, if a credential rule corresponding to a service type identifier is not read, read a credential rule corresponding to the service type identifier from the primary cache according to the unread service type identifier;
in some embodiments, as shown in fig. 5, the second reading module 404 in the credential generating device 400 includes: rule reading submodule 4041, rule generating submodule 4042 and rule synchronizing submodule 4043.
And the rule reading submodule 4041 is configured to read a credential rule corresponding to the data to be certified from the primary cache and the database.
And the rule generating submodule 4042 is configured to prompt the user to input a custom credential rule according to the unread service type identifier if the credential rule corresponding to the service type identifier is not read in the second-level cache, the first-level cache and the database.
The rule synchronization submodule 4043 is configured to acquire a user-defined credential rule input by a user, and store the user-defined credential rule in a preset primary cache or a preset secondary cache according to a rule type corresponding to the user-defined credential rule.
And the credential generating module 405 is configured to perform credential making on the data to be certified according to the credential rules corresponding to all the service type identifiers, so as to obtain a credential corresponding to the data to be certified.
In some embodiments, the credential generating apparatus 400 further includes a model training module, specifically configured to:
obtaining a sample certificate rule, and training a certificate rule classification model according to the sample certificate rule, wherein the certificate rule classification model can be used for classifying the certificate rule.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus, the modules and the units described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The methods, apparatus, and devices of the present application are operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
For example, the method and apparatus described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 6.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. The computer device may be a server or a terminal. The computer device includes a processor, a memory, and a network interface connected by a system bus, where the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any of the credential generation methods.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment. The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by the processor, causes the processor to perform any of the credential generation methods.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the configuration of the computer apparatus is merely a block diagram of a portion of the configuration associated with aspects of the present application and is not intended to limit the computer apparatus to which aspects of the present application may be applied, and that a particular computer apparatus may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
acquiring a certificate rule from a database, and respectively storing the certificate rule in a preset first-level cache or a preset second-level cache according to the rule type of the certificate rule, wherein the reading speed of the second-level cache is higher than that of the first-level cache;
if the data to be certified is received, determining a service type identifier corresponding to the data to be certified;
reading the certificate rule corresponding to the service type identification from the second-level cache, and judging whether the certificate rule corresponding to all the service type identifications is read or not;
if the certificate rule corresponding to the service type identifier is not read, reading the certificate rule corresponding to the service type identifier from the primary cache according to the unread service type identifier;
and according to the certificate rules corresponding to all the service type identifications, making the certificate of the data to be made to obtain the certificate corresponding to the data to be made.
In some embodiments, a base credential rule and an extended credential rule are stored in the database, the base credential rule being modified less frequently than the extended credential rule; the processor is used for realizing that when the certificate rules are respectively stored in a preset first-level cache or a preset second-level cache according to the rule types of the certificate rules, the following steps are realized:
loading the basic certificate rule to a preset second-level cache;
and loading the extended certificate rule to a preset first-level cache.
In some embodiments, a credential rule table is stored in the database, the credential rule table includes a plurality of credential rules and rule types corresponding to the credential rules, the rule types include a basic type and an extended type, and when the processor is used to implement the credential generation method, the processor implements:
if a newly added certificate rule in the database is obtained, determining the rule type of the newly added certificate rule;
and adding the newly added credential rule and the corresponding rule type to the credential rule table.
In some embodiments, the processor, when configured to implement the credential generation method, is configured to:
if change information of the certificate rules in the database is acquired, the certificate rules stored in a first-level cache and/or a second-level cache are adjusted according to the change information;
the change information includes at least one of the following information: credential rule addition information, credential rule deletion information, and credential rule modification information.
In some embodiments, after the reading of the credential rule corresponding to the service type identifier from the primary cache according to the unread service type identifier, the processor is configured to implement:
and if the certificate rule corresponding to the service type identifier is not read in the second-level cache and the first-level cache, reading the certificate rule corresponding to the service type identifier from a database according to the unread service type identifier.
In some embodiments, the processor, when configured to implement the credential generation method, is configured to:
if the certificate rule corresponding to the service type identifier is not read in the second-level cache, the first-level cache and the database, prompting a user to input a user-defined certificate rule according to the unread service type identifier;
the method comprises the steps of obtaining a user-defined voucher rule input by a user, and storing the user-defined voucher rule in a preset primary cache or a preset secondary cache according to a rule type corresponding to the user-defined voucher rule.
In some embodiments, when the processor is used to implement the credential generation method, the processor further implements:
acquiring a sample certificate rule, and training a certificate rule classification model according to the sample certificate rule, wherein the certificate rule classification model can be used for classifying the certificate rule;
obtaining a certificate rule, and inputting the certificate rule into the certificate rule classification model for classification to obtain a rule type corresponding to the certificate rule;
storing the credential rules and corresponding rule types to a credential rule table in the database.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solution of the present application may be substantially embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute the credential generating method described in the embodiments or some parts of the embodiments of the present application, such as: a computer-readable storage medium, which stores a computer program, where the computer program includes program instructions, and the processor executes the program instructions to implement any credential generation method provided in this application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A credential generation method, comprising:
acquiring a certificate rule from a database, and respectively storing the certificate rule in a preset first-level cache or a preset second-level cache according to the rule type of the certificate rule, wherein the reading speed of the second-level cache is higher than that of the first-level cache;
if the data to be certified is received, determining a service type identifier corresponding to the data to be certified;
reading the certificate rule corresponding to the service type identification from the second-level cache, and judging whether the certificate rule corresponding to all the service type identifications is read or not;
if the certificate rule corresponding to the service type identifier is not read, reading the certificate rule corresponding to the service type identifier from the primary cache according to the unread service type identifier;
and according to the certificate rules corresponding to all the service type identifications, making the certificate of the data to be made to obtain the certificate corresponding to the data to be made.
2. The credential generation method of claim 1, wherein a base credential rule and an extended credential rule are stored in the database, the base credential rule having a lower frequency of modification than the extended credential rule;
the storing the credential rule in a preset first-level cache or second-level cache according to the rule type of the credential rule respectively includes:
loading the basic certificate rule to a preset second-level cache;
and loading the extended certificate rule to a preset first-level cache.
3. The credential generation method according to claim 2, wherein the database stores a credential rule table, the credential rule table includes a plurality of credential rules and rule types corresponding to the credential rules, and the rule types include a base type and an extension type; the credential generation method further comprises:
if a newly added certificate rule is obtained, determining the rule type of the newly added certificate rule;
and adding the newly added credential rule and the corresponding rule type to the credential rule table.
4. The credential generation method of claim 1, further comprising:
if change information of the certificate rules in the database is acquired, the certificate rules stored in the first-level cache and/or the second-level cache are adjusted according to the change information;
the change information includes at least one of the following information: credential rule addition information, credential rule deletion information, and credential rule modification information.
5. The method for generating credentials according to claim 1, wherein after reading the credential rule corresponding to the service type identifier from the primary cache according to the unread service type identifier, the method further comprises:
and if the certificate rule corresponding to the service type identifier is not read in the second-level cache and the first-level cache, reading the certificate rule corresponding to the service type identifier from a database according to the unread service type identifier.
6. The credential generation method of claim 5, wherein if a credential rule corresponding to a service type identifier is not read in the secondary cache, the primary cache, or the database, the user is prompted to input a custom credential rule according to the unread service type identifier;
and if the user-defined voucher rule input by the user is obtained, storing the user-defined voucher rule in a preset primary cache or a preset secondary cache according to the rule type corresponding to the user-defined voucher rule.
7. The credential generation method of any one of claims 1 to 6, further comprising:
acquiring a sample certificate rule, and training a certificate rule classification model according to the sample certificate rule, wherein the certificate rule classification model can be used for classifying the certificate rule;
obtaining a certificate rule, and inputting the certificate rule into the certificate rule classification model for classification to obtain a rule type corresponding to the certificate rule;
storing the credential rules and corresponding rule types to a credential rule table in the database.
8. A credential generation apparatus, the credential generation apparatus comprising:
the rule obtaining module is used for obtaining the certificate rules from the database and respectively storing the certificate rules in a preset first-level cache or a preset second-level cache according to the rule types of the certificate rules, and the reading speed of the second-level cache is higher than that of the first-level cache;
the identification determining module is used for determining a service type identification corresponding to the data to be certified if the data to be certified is received;
the first reading module is used for reading the certificate rule corresponding to the service type identifier from the second-level cache and judging whether the certificate rule corresponding to all the service type identifiers is read or not;
the second reading module is used for reading the certificate rule corresponding to the service type identifier from the first-level cache according to the unread service type identifier if the certificate rule corresponding to the service type identifier is not read;
and the certificate generation module is used for making the certificate of the data to be made according to the certificate rules corresponding to all the service type identifications to obtain the certificate corresponding to the data to be made.
9. A computer device, wherein the computer device comprises a memory and a processor;
the memory is used for storing a computer program;
the processor for executing the computer program and implementing the credential generation method according to any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: the computer program, if executed by a processor, implementing the credential generation method of any one of claims 1-7.
CN202010097697.4A 2020-02-17 2020-02-17 Voucher generation method and device, computer equipment and storage medium Pending CN111445319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010097697.4A CN111445319A (en) 2020-02-17 2020-02-17 Voucher generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010097697.4A CN111445319A (en) 2020-02-17 2020-02-17 Voucher generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111445319A true CN111445319A (en) 2020-07-24

Family

ID=71627083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010097697.4A Pending CN111445319A (en) 2020-02-17 2020-02-17 Voucher generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111445319A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112183040A (en) * 2020-09-27 2021-01-05 金蝶软件(中国)有限公司 Voucher generation method and related device
CN114022264A (en) * 2021-11-05 2022-02-08 平安科技(深圳)有限公司 Method, device, equipment and storage medium for generating certificate
CN114625805A (en) * 2022-05-16 2022-06-14 杭州时代银通软件股份有限公司 Method, device, equipment and medium for configuration of return test

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112183040A (en) * 2020-09-27 2021-01-05 金蝶软件(中国)有限公司 Voucher generation method and related device
CN114022264A (en) * 2021-11-05 2022-02-08 平安科技(深圳)有限公司 Method, device, equipment and storage medium for generating certificate
CN114625805A (en) * 2022-05-16 2022-06-14 杭州时代银通软件股份有限公司 Method, device, equipment and medium for configuration of return test
CN114625805B (en) * 2022-05-16 2022-09-20 杭州时代银通软件股份有限公司 Return test configuration method, device, equipment and medium

Similar Documents

Publication Publication Date Title
WO2020186786A1 (en) File processing method and apparatus, computer device and storage medium
CN109617646B (en) Message conversion method and device, computer equipment and computer readable storage medium
CN111445319A (en) Voucher generation method and device, computer equipment and storage medium
CN109617647B (en) Message conversion method and device, computer equipment and computer readable storage medium
US9998450B2 (en) Automatically generating certification documents
CN108762898B (en) Thread interface management method, terminal equipment and computer readable storage medium
CN110738038A (en) Contract text generation method, device, equipment and computer readable storage medium
CN112559526A (en) Data table export method and device, computer equipment and storage medium
CN113626223A (en) Interface calling method and device
CN112328486A (en) Interface automation test method and device, computer equipment and storage medium
CN113297153A (en) Data export method, device, equipment and storage medium
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN111585897B (en) Request route management method, system, computer system and readable storage medium
CN115203339A (en) Multi-data source integration method and device, computer equipment and storage medium
CN114547184A (en) Personnel information synchronization method, terminal device and storage medium
CN111045983A (en) Nuclear power station electronic file management method and device, terminal equipment and medium
CN116301758B (en) Rule editing method, device, equipment and medium based on event time points
CN113434098B (en) Printing function realization method, device, electronic equipment, system and storage medium
CN111813842B (en) Data processing method, device, system, equipment and storage medium
CN113986333A (en) Configurable log progress analysis method, device and system
CN115329013A (en) Detection method, device and equipment of data warehouse and storage medium
CN116820633A (en) Data verification method and device, electronic equipment and storage medium
CN116069861A (en) Data processing method, system and electronic equipment
CN115981657A (en) Code generation method and device, electronic equipment and readable medium
CN112395287A (en) Table classification method, table creation 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