A digital certificate generation method, system, device and medium
By using blockchain technology to search and verify components in digital voucher generation, adaptively design and generate digital vouchers, the problem of inefficiency of traditional methods is solved, and efficient, secure and personalized digital voucher production is achieved.
Patent Information
- Application Number
- CN202411045323.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The traditional digital voucher generation method is inefficient, requires a lot of human resources, and cannot meet the needs of different users, resulting in low generation efficiency.
By receiving the user's digital credential configuration requirements, using the blockchain to search the target block and verify security information, calling components in the blockchain to process the blank digital credential template, generating target digital credentials, and realizing the adaptive design and generation of the template. .
It improves the efficiency of digital credential generation, meets the needs of different users and business scenarios, ensures the uniqueness and security of credentials, and achieves efficient, secure and personalized production.
Smart Images

Figure CN118573373B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system, device and medium for generating a digital certificate. Background Art
[0002] Digital credentials will play a key role in digital business and data factor markets. Special equipment or specific methods are required to produce digital credentials. However, in the traditional method, designers use computer tool software to manually create template files and add target data to generate digital credentials. This method takes up a lot of human resources, and in the process of digital credential generation, due to different user needs, they need to be designed one by one, which is too inefficient.
[0003] Therefore, how to effectively improve the efficiency of generating digital credentials has become a technical problem that technical personnel in this field need to solve urgently. Summary of the invention
[0004] The present invention provides a digital certificate generation method, system, device and medium to solve the problem of how to effectively improve the generation efficiency of digital certificates.
[0005] In order to solve the above technical problems, the first aspect of the present invention provides a method for generating a digital certificate, comprising:
[0006] Receive a digital credential configuration requirement sent by a user; the digital credential configuration requirement includes a target digital credential and its corresponding blank digital credential template, component requirement information and security information; the security information is obtained by encrypting the component requirement information through an anti-counterfeiting mark;
[0007] In response to the digital credential configuration requirement, a target block is searched from the blockchain according to the component requirement information, and the security information is verified according to a preset configuration rule in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark;
[0008] When the verification is passed, the component in the target block is called to process the blank digital certificate template to obtain the target digital certificate.
[0009] As one of the preferred solutions, before receiving the digital credential configuration requirement sent by the user, the method includes:
[0010] Receiving a template creation request sent by the user; the template creation request includes template parameters and their types and quantities;
[0011] Responding to the template creation request and displaying the template parameters according to the target digital certificate;
[0012] A template framework is constructed according to the template parameters and a corresponding data source is associated at a specific location to obtain the blank digital certificate template.
[0013] As one of the preferred solutions, before receiving the digital credential configuration requirement sent by the user, the method further includes:
[0014] receiving a template adjustment request sent by the user; the template adjustment request includes updated template parameters and their types and quantities;
[0015] Responding to the template adjustment request, and adjusting the display content in the blank digital certificate template according to the updated template parameters;
[0016] A template framework is constructed according to the updated template parameters and the corresponding data source is associated at a specific location to obtain an adjusted blank digital certificate template.
[0017] As one preferred solution, the security information is obtained by encrypting the component requirement information through an anti-counterfeiting mark, including:
[0018] Adding an anti-counterfeiting mark to the component requirement information to obtain an anti-counterfeiting requirement component;
[0019] Generate an authentication request according to the anti-counterfeiting requirement component, and generate a first random number according to the authentication request;
[0020] The first random number and the anti-counterfeiting requirement component are encrypted, and a timestamp is added during encryption to obtain the security information.
[0021] As one of the preferred solutions, the blockchain includes a plurality of blocks marked with serial numbers, each of the blocks also includes a second random number, and the second random number is generated by an authentication request triggered by a component in a corresponding block;
[0022] The step of responding to the digital credential configuration requirement, searching for a target block from the blockchain according to the component requirement information, and verifying the security information according to a preset configuration rule in the target block, includes:
[0023] In response to the digital credential configuration requirement, the component requirement information is matched with the component information in the block, the block with the highest matching degree is used as the target block, and the serial number of the target block is fed back to the user;
[0024] Responding to the verification request generated by the user according to the feedback, receiving and decrypting the security information sent by the user according to the response to obtain decrypted data; the decrypted data includes the timestamp, the anti-counterfeiting mark and the first random number;
[0025] The smart contract in the blockchain is called, and if it is determined based on the smart contract that the decrypted data complies with the preset configuration rules in the target block, it is determined that the security information verification has passed.
[0026] As one of the preferred solutions, determining that the decrypted data complies with the preset configuration rules in the target block based on the smart contract includes:
[0027] If the timestamp is within the time threshold, determining that the decrypted data complies with the first reconfiguration rule of the target block;
[0028] If the anti-counterfeiting mark in the decrypted data is the same as the preset anti-counterfeiting mark in the target block, determining that the decrypted data complies with the second reconfiguration rule of the target block;
[0029] If the first random number is the same as the second random number, determining that the decrypted data complies with a third reconfiguration rule of the target block;
[0030] If the decrypted data satisfies the first, second and third configuration rules of the target block at the same time, it is determined that the decrypted data complies with the preset configuration rule in the target block.
[0031] As one preferred solution, the blank digital certificate template includes a location tag, a description tag, and an association between the two;
[0032] When the verification is passed, calling the component in the target block to process the blank digital certificate template to obtain the target digital certificate includes:
[0033] When the verification is passed, the blank digital certificate template is located and marked by the location tag to obtain a plurality of location identifiers;
[0034] The components in the target block are called, and the corresponding data is inserted into the position identification in the blank digital certificate template synchronously through the description tag according to the association relationship, so as to obtain the target digital certificate.
[0035] A second aspect of the present invention provides a digital credential generation system, comprising:
[0036] A demand receiving module is used to receive a digital credential configuration demand sent by a user; the digital credential configuration demand includes a target digital credential and its corresponding blank digital credential template, component demand information and security information; the security information is obtained by encrypting the component demand information through an anti-counterfeiting mark;
[0037] An information verification module, configured to respond to the digital credential configuration requirement, search for a target block from the blockchain according to the component requirement information, and verify the security information according to a preset configuration rule in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark;
[0038] The credential generation module is used to call the components in the target block to process the blank digital credential template to obtain the target digital credential when the verification is passed.
[0039] A third aspect of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the digital credential generation method as described above when executing the computer program.
[0040] A fourth aspect of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the device where the computer-readable storage medium is located executes the computer program, the digital credential generation method as described above is implemented.
[0041] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0042] (1) Adaptive modification of the template based on the user's configuration requirements realizes the adaptive design and generation of digital credentials and improves the efficiency of digital credential generation;
[0043] (2) It meets the specific needs of different users or business scenarios, ensures the uniqueness and security of digital credentials, and realizes the efficient, secure and personalized production of digital credentials;
[0044] (3) It is applicable not only to individual users but also to enterprises, governments and other organizations, providing strong support for identity authentication, rights protection and transaction security in the digital world. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 is a flow chart of a method for generating a digital certificate provided by a certain embodiment of the present invention;
[0047] Figure 2 is a diagram of a construction process of a blank digital certificate template provided by an embodiment of the present invention;
[0048] Figure 3 is a diagram of an adjustment process of a blank digital voucher template provided by a certain embodiment of the present invention;
[0049] Figure 4 is a diagram of a process of generating security information provided by a certain embodiment of the present invention;
[0050] Figure 5 is a flowchart of step S2 provided by an embodiment of the present invention;
[0051] Figure 6 is a flowchart of step S3 provided by an embodiment of the present invention;
[0052] Figure 7 is a system diagram of a digital credential generation system provided by a certain embodiment of the present invention;
[0053] Figure 8 It is a structural diagram of an electronic device provided by a certain embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0056] In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two components. The terms "vertical", "horizontal", "left", "right", "upper", "lower" and similar expressions used herein are for illustrative purposes only, and do not indicate or imply that the system or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0057] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those commonly understood by those skilled in the art. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood by specific circumstances.
[0058] In one embodiment, if Figure 1 As shown, the first aspect of the present invention provides a method for generating a digital certificate, comprising:
[0059] S1. Receive digital credential configuration requirements sent by a user; the digital credential configuration requirements include a target digital credential and its corresponding blank digital credential template, component requirement information and security information; wherein the component requirement information is obtained based on the difference between the target digital credential and the blank digital credential template, and the blank digital credential template can be processed by the required component, such as content filling, to obtain the required digital credential; the security information is used to perform security verification on the component requirement information to ensure the security of the component requirement information, thereby improving the construction speed and accuracy of the target digital credential.
[0060] Before step S1, a blank digital certificate template corresponding to the target digital certificate is constructed. The construction process is as follows: Figure 2 As shown, including:
[0061] S001. Receive a template creation request sent by the user; the template creation request includes template parameters and their types and quantities;
[0062] S002, responding to the template creation request, and displaying the template parameters according to the target digital certificate;
[0063] S003. Construct a template framework according to the template parameters and associate the corresponding data source at a specific location to obtain the blank digital certificate template.
[0064] Specifically, before receiving the user's digital certificate configuration requirements, it is necessary to build a blank digital certificate template corresponding to the target digital certificate, and obtain the template framework, insertable data sources and their corresponding positions by displaying the template parameters contained in the template creation request sent by the user, and generate a blank digital certificate template. It should be noted that the data source associated with a specific position is a data item set in advance for each template parameter, and the types of template parameters include lines, text, etc., which can be selected from the template parameter source and adjusted according to the target digital certificate. No specific restrictions are made here. The present application can build the template framework, input data and position by displaying the template parameters, and then generate a blank digital certificate template. The whole process is simple to operate and does not require adjustment of the development code. Users can select template parameters according to actual needs, which improves the efficiency of certificate template generation.
[0065] Before step S1, the blank digital certificate template is also adaptively adjusted. The adjustment process is as follows: Figure 3 As shown, including:
[0066] S011. Receive a template adjustment request sent by the user; the template adjustment request includes updated template parameters and their types and quantities;
[0067] S012, responding to the template adjustment request, and adjusting the display content in the blank digital certificate template according to the updated template parameters;
[0068] S013. Build a template framework according to the updated template parameters and associate the corresponding data source at a specific location to obtain an adjusted blank digital voucher template.
[0069] Specifically, when user needs change, a new blank digital voucher template can be obtained by updating the template parameters, that is, the user can adaptively edit the blank digital voucher template, which simplifies the voucher template development process, shortens the voucher template development cycle, and reduces the labor cost of voucher template development. In addition, users can also combine template parameters to form a variety of different blank digital voucher templates, and once a blank digital voucher template is formed, it can be saved with the corresponding template parameters, so that subsequent users can reuse the same template parameters in different voucher templates, which not only avoids repeated development, but also improves the utilization rate of the template.
[0070] In one embodiment, the security information is obtained by encrypting the component requirement information through an anti-counterfeiting mark; and the generation process of the security information is as follows: Figure 4As shown, including:
[0071] S101, adding an anti-counterfeiting mark to the component requirement information to obtain an anti-counterfeiting requirement component;
[0072] S102, generating an authentication request according to the anti-counterfeiting requirement component, and generating a first random number according to the authentication request;
[0073] S103: Encrypt the first random number and the anti-counterfeiting requirement component, and add a timestamp during encryption to obtain the security information.
[0074] Specifically, the present application adds an anti-counterfeiting mark b to the component requirement information a, obtains the anti-counterfeiting requirement component a+b, then generates an authentication request according to the anti-counterfeiting requirement component a+b, generates a first random number c1 according to the authentication request, encrypts the first random number c1 and the anti-counterfeiting requirement component a+b, and adds a timestamp t during encryption to obtain security information (a+b, c1) tx. It should be noted that the above letter description is only provided for the understanding of those skilled in the art, and does not indicate that the security information must be presented in this way. The present application adds an anti-counterfeiting mark to the component requirement information, which can ensure the authenticity and non-counterfeitability of the information; wherein, the anti-counterfeiting mark includes but is not limited to a QR code, a laser, etc., and the component requirement information with the anti-counterfeiting mark added can avoid human modification, and can further ensure the security of the security information formed by encryption, and ensure the standardization and confidentiality of the component requirement information from the source. It should be noted that the present application does not specifically limit the encryption and decryption process, and can be carried out using the RSA algorithm, etc., and during the data transmission process, the correctness of the identity of the source of the component requirement information can be verified through random numbers and encryption technology to avoid identity impersonation problems.
[0075] S2. In response to the digital credential configuration requirement, a target block is searched from the blockchain according to the component requirement information, and the security information is verified according to a preset configuration rule in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark; the blockchain includes a number of blocks marked with serial numbers, each of the blocks also includes a second random number, the second random number is generated by an authentication request triggered by a component in the corresponding block, and its generation process refers to the generation process of the first random number.
[0076] In one embodiment, step S2 is as follows Figure 5 As shown, including:
[0077] S21, in response to the digital credential configuration requirement, matching the component requirement information with the component information in the block, taking the block with the highest matching degree as the target block, and feeding back the sequence number of the target block to the user;
[0078] S22, responding to the verification request generated by the user according to the feedback, receiving and decrypting the security information sent by the user according to the response to obtain decrypted data; the decrypted data includes the timestamp, the anti-counterfeiting mark and the first random number;
[0079] S23. Calling the smart contract in the blockchain, if it is determined based on the smart contract that the decrypted data complies with the preset configuration rules in the target block, then determining that the security information verification has passed.
[0080] Specifically, the present application adopts a component-based matching algorithm. First, a matching block is searched in the blockchain by using a search function (such as find_component_model), that is, the required component is found by searching the component name, and then the accuracy of the searched block is determined by comparing the component content or pattern in the block. The block with the highest ranking is used as the target block and the block number is fed back to the user. If a single block that meets the component requirement information cannot be found, it can be achieved by combining blocks, but the target block does not contain components other than the component requirement information, so as to ensure the accuracy of the constructed target digital certificate.
[0081] After the user receives the serial number of the target block in feedback, a verification request is generated to verify the security information. After responding to the user's verification request, the security information (a+b, c1) tx sent by the user is received and decrypted to obtain the timestamp t, anti-counterfeiting mark b and the first random number c1. The decrypted information is compared with the information in the target block to verify the correctness of the digital certificate configuration requirements sent by the user, thereby ensuring the accuracy of the subsequent target digital certificate.
[0082] In one embodiment, the rule determination process in step S23 is specifically as follows:
[0083] If the timestamp is within the time threshold, determining that the decrypted data complies with the first reconfiguration rule of the target block;
[0084] If the anti-counterfeiting mark in the decrypted data is the same as the preset anti-counterfeiting mark in the target block, determining that the decrypted data complies with the second reconfiguration rule of the target block;
[0085] If the first random number is the same as the second random number, determining that the decrypted data complies with a third reconfiguration rule of the target block;
[0086] If the decrypted data satisfies the first, second and third configuration rules of the target block at the same time, it is determined that the decrypted data complies with the preset configuration rule in the target block.
[0087] Specifically, the application sets a time threshold to verify whether the time of the digital certificate configuration requirement sent by the user is within the authentication time. If the timestamp exceeds the time threshold, the authentication exceeds the limit, and the decrypted data is determined to be inconsistent with the preset configuration rules in the target block. If the timestamp does not exceed the time threshold, the decrypted data is determined to be consistent with the first reconfiguration rule in the target block. The application limits the authentication time to prevent accidental touches, improve user experience, and improve security to prevent brute force cracking.
[0088] Then, the anti-counterfeiting mark is authenticated. If the anti-counterfeiting mark formed after decryption is different from the preset anti-counterfeiting mark in the target block, the authentication fails, and the decrypted data is judged not to comply with the preset configuration rule in the target block. If the two marks are the same, the decrypted data is judged to comply with the second configuration rule in the target block. The present application can ensure information security, improve data transmission efficiency, and prevent data leakage and abuse through the authentication of anti-counterfeiting marks.
[0089] Finally, the random number generated by the authentication request of the component information is verified. If the first random number and the second random number generated after decryption are not the same, the authentication fails, and the decrypted data is determined to be inconsistent with the preset configuration rules in the target block. If the two are the same, the decrypted data is determined to be consistent with the third reconfiguration rule in the target block. The present application can increase the security of information transmission through random number verification. Since random numbers are unpredictable and unique, it is difficult for attackers to guess or copy these random numbers, thereby increasing the difficulty of cracking or tampering with information.
[0090] Only when the decrypted data satisfies the first, second and third configuration rules of the target block at the same time, can it be determined that the decrypted data complies with the preset configuration rules in the target block. This application adopts a variety of different authentication mechanisms in the rule determination process, making the data more secure during the verification process, which can greatly improve the reliability of the verification results. Through multiple verifications, it can ensure that the source of the data is credible, the content is complete and has not been tampered with, thereby reducing the risk of data being illegally obtained or abused.
[0091] S3. When the verification is passed, calling the component in the target block to process the blank digital certificate template to obtain the target digital certificate; wherein the blank digital certificate template includes a location tag, a description tag and an association relationship between the two;
[0092] In one embodiment, step S3 is as follows Figure 6 As shown, including:
[0093] S31. When the verification is passed, the blank digital certificate template is located and marked by the location tag to obtain a plurality of location identifiers;
[0094] S32, calling the component in the target block, and inserting the corresponding data into the position identification in the blank digital certificate template synchronously by number through the description tag according to the association relationship, to obtain the target digital certificate.
[0095] Specifically, the location tag in the blank digital certificate template is used to identify the template parameters, and the description tag is used to describe the data source corresponding to the template parameters, that is, the location tag identifies the editable location, and the description tag identifies the editable content. The two are related to each other, and there is also a mapping relationship between the two. After the rule verification is passed, the blank digital certificate template is processed according to the template configuration requirements sent by the user, and the data in the corresponding data source is inserted into the location identifier by using the associated mapping relationship between the location tag and the description tag. Compared with the existing solution of using target variables and target placeholders to correspond to each other and insert data from multiple different data sources in sequence when editing the template, this solution can adapt to multiple different data types at the same time and reduce the work of developers. When the verification fails, it means that the content of the user's input requirement is incorrect, and it will be rejected, so that the user can modify the requirement until it meets the requirements and makes the target digital certificate.
[0096] In the embodiment of the present application, based on the problem of how to effectively improve the efficiency of digital credential generation, a digital credential generation method is designed, which realizes receiving digital credential configuration requirements sent by users; the digital credential configuration requirements include a target digital credential and its corresponding blank digital credential template, component requirement information and security information; the security information is obtained by encrypting the component requirement information through an anti-counterfeiting mark; in response to the digital credential configuration requirements, a target block is searched from the blockchain according to the component requirement information, and the security information is verified according to the preset configuration rules in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark; when the verification is passed, the component in the target block is called to process the blank digital credential template to obtain a technical solution for the target digital credential; the template is adaptively modified according to the user's configuration requirements, so as to realize the adaptive design and generation of digital credentials and improve the generation efficiency of digital credentials.
[0097] It should be noted that although the steps in the above flowchart are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders.
[0098] In another embodiment, if Figure 7 As shown, the second aspect of the present invention provides a digital certificate generation system, comprising:
[0099] The demand receiving module 10 is used to receive the digital credential configuration demand sent by the user; the digital credential configuration demand includes the target digital credential and its corresponding blank digital credential template, component demand information and security information; the security information is obtained by encrypting the component demand information through the anti-counterfeiting mark;
[0100] An information verification module 20, for responding to the digital credential configuration requirement, searching for a target block from the blockchain according to the component requirement information, and verifying the security information according to a preset configuration rule in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark;
[0101] The credential generation module 30 is used to call the components in the target block to process the blank digital credential template to obtain the target digital credential when the verification is passed.
[0102] It should be noted that each module in the above-mentioned digital credential generation system can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules. For the specific definition of a digital credential generation system, please refer to the definition of a digital credential generation method above. The two have the same functions and effects, which will not be repeated here.
[0103] A third aspect of the present invention provides an electronic device, the electronic device comprising:
[0104] processor, memory, and bus;
[0105] The bus is used to connect the processor and the memory;
[0106] The memory is used to store operation instructions;
[0107] The processor is used to call the operation instruction, and the executable instruction enables the processor to perform the operation corresponding to the digital certificate generation method shown in the first aspect of the present application.
[0108] In an alternative embodiment, an electronic device is provided, such as Figure 8 As shown, Figure 8 The electronic device 5000 shown includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are connected, such as through a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that in actual applications, the transceiver 5004 is not limited to one, and the structure of the electronic device 5000 does not constitute a limitation on the embodiments of the present application.
[0109] Processor 5001 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 5001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0110] The bus 5002 may include a path to transmit information between the above components. The bus 5002 may be a PCI bus or an EISA bus, etc. The bus 5002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0111] The memory 5003 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0112] The memory 5003 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 5001. The processor 5001 is used to execute the application code stored in the memory 5003 to implement the content shown in any of the above method embodiments.
[0113] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
[0114] The fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, a digital credential generation method shown in the first aspect of the present application is implemented.
[0115] Another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.
[0116] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented.
[0117] In summary, the present invention discloses a method, system, device and medium for generating a digital credential, wherein the method comprises receiving a digital credential configuration requirement sent by a user; the digital credential configuration requirement comprises a target digital credential and its corresponding blank digital credential template, component requirement information and security information; the security information is obtained by encrypting the component requirement information through an anti-counterfeiting mark; in response to the digital credential configuration requirement, searching a target block from a blockchain according to the component requirement information, and verifying the security information according to a preset configuration rule in the target block; each of the blocks comprises a number of components and a preset anti-counterfeiting mark; when the verification passes, calling the component in the target block to process the blank digital credential template to obtain the target digital credential; adaptively modifying the template according to the user's configuration requirement, realizing the adaptive design and generation of the digital credential, and improving the generation efficiency of the digital credential.
[0118] Each embodiment in this specification is described in a progressive manner, and the same or similar parts of each embodiment can be directly referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above-mentioned embodiments only express several preferred implementation modes of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in the technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention, and these improvements and substitutions should also be regarded as the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be based on the protection scope of the claims.
Claims
1. A method for generating a digital certificate, characterized in that: include: Receive a digital credential configuration requirement sent by a user; the digital credential configuration requirement includes a target digital credential and its corresponding blank digital credential template, component requirement information and security information; the security information is obtained by encrypting the component requirement information through an anti-counterfeiting mark; In response to the digital credential configuration requirement, a target block is searched from the blockchain according to the component requirement information, and the security information is verified according to a preset configuration rule in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark; When the verification is passed, calling the component in the target block to process the blank digital certificate template to obtain the target digital certificate; The security information is obtained by encrypting the component requirement information through the anti-counterfeiting mark, including: Adding an anti-counterfeiting mark to the component requirement information to obtain an anti-counterfeiting requirement component; Generate an authentication request according to the anti-counterfeiting requirement component, and generate a first random number according to the authentication request; Encrypting the first random number and the anti-counterfeiting requirement component, and adding a timestamp during encryption to obtain the security information; The blockchain includes a plurality of blocks marked with serial numbers, each of the blocks also includes a second random number, and the second random number is generated by an authentication request triggered by a component in the corresponding block; The step of responding to the digital credential configuration requirement, searching for a target block from the blockchain according to the component requirement information, and verifying the security information according to a preset configuration rule in the target block, includes: In response to the digital credential configuration requirement, the component requirement information is matched with the component information in the block, the block with the highest matching degree is used as the target block, and the serial number of the target block is fed back to the user; Responding to the verification request generated by the user according to the feedback, receiving and decrypting the security information sent by the user according to the response to obtain decrypted data; the decrypted data includes the timestamp, the anti-counterfeiting mark and the first random number; Calling a smart contract in the blockchain, and if it is determined based on the smart contract that the decrypted data complies with a preset configuration rule in the target block, determining that the security information verification has passed; The determining, based on the smart contract, that the decrypted data complies with a preset configuration rule in the target block includes: If the timestamp is within the time threshold, determining that the decrypted data complies with the first reconfiguration rule of the target block; If the anti-counterfeiting mark in the decrypted data is the same as the preset anti-counterfeiting mark in the target block, determining that the decrypted data complies with the second reconfiguration rule of the target block; If the first random number is the same as the second random number, determining that the decrypted data complies with a third reconfiguration rule of the target block; If the decrypted data satisfies the first, second and third configuration rules of the target block at the same time, it is determined that the decrypted data complies with the preset configuration rule in the target block.
2. A method for generating a digital certificate according to claim 1, characterized in that: Before receiving the digital credential configuration requirement sent by the user, the method includes: Receiving a template creation request sent by the user; the template creation request includes template parameters and their types and quantities; Responding to the template creation request and displaying the template parameters according to the target digital certificate; A template framework is constructed according to the template parameters and a corresponding data source is associated at a specific location to obtain the blank digital certificate template.
3. A method for generating a digital certificate according to claim 2, characterized in that: Before receiving the digital credential configuration requirement sent by the user, the method further includes: receiving a template adjustment request sent by the user; the template adjustment request includes updated template parameters and their types and quantities; Responding to the template adjustment request, and adjusting the display content in the blank digital certificate template according to the updated template parameters; A template framework is constructed according to the updated template parameters and the corresponding data source is associated at a specific location to obtain an adjusted blank digital certificate template.
4. A method for generating a digital certificate according to claim 1, characterized in that: The blank digital certificate template includes a location tag, a description tag and an association relationship between the two; When the verification is passed, calling the component in the target block to process the blank digital certificate template to obtain the target digital certificate includes: When the verification is passed, the blank digital certificate template is located and marked by the location tag to obtain a plurality of location identifiers; The components in the target block are called, and the corresponding data is inserted into the position identification in the blank digital certificate template synchronously through the description tag according to the association relationship, so as to obtain the target digital certificate.
5. A digital certificate generation system, characterized in that: include: A demand receiving module is used to receive a digital credential configuration demand sent by a user; the digital credential configuration demand includes a target digital credential and its corresponding blank digital credential template, component demand information and security information; the security information is obtained by encrypting the component demand information through an anti-counterfeiting mark; An information verification module, configured to respond to the digital credential configuration requirement, search for a target block from the blockchain according to the component requirement information, and verify the security information according to a preset configuration rule in the target block; each of the blocks includes a number of components and a preset anti-counterfeiting mark; A credential generation module, for invoking the components in the target block to process the blank digital credential template to obtain the target digital credential when the verification is passed; The security information is obtained by encrypting the component requirement information through the anti-counterfeiting mark, including: Adding an anti-counterfeiting mark to the component requirement information to obtain an anti-counterfeiting requirement component; Generate an authentication request according to the anti-counterfeiting requirement component, and generate a first random number according to the authentication request; Encrypting the first random number and the anti-counterfeiting requirement component, and adding a timestamp during encryption to obtain the security information; The blockchain includes a plurality of blocks marked with serial numbers, each of the blocks also includes a second random number, and the second random number is generated by an authentication request triggered by a component in the corresponding block; The step of responding to the digital credential configuration requirement, searching for a target block from the blockchain according to the component requirement information, and verifying the security information according to a preset configuration rule in the target block, includes: In response to the digital credential configuration requirement, the component requirement information is matched with the component information in the block, the block with the highest matching degree is used as the target block, and the serial number of the target block is fed back to the user; Responding to the verification request generated by the user according to the feedback, receiving and decrypting the security information sent by the user according to the response to obtain decrypted data; the decrypted data includes the timestamp, the anti-counterfeiting mark and the first random number; Calling a smart contract in the blockchain, and if it is determined based on the smart contract that the decrypted data complies with a preset configuration rule in the target block, determining that the security information verification has passed; The determining, based on the smart contract, that the decrypted data complies with a preset configuration rule in the target block includes: If the timestamp is within the time threshold, determining that the decrypted data complies with the first reconfiguration rule of the target block; If the anti-counterfeiting mark in the decrypted data is the same as the preset anti-counterfeiting mark in the target block, determining that the decrypted data complies with the second reconfiguration rule of the target block; If the first random number is the same as the second random number, determining that the decrypted data complies with a third reconfiguration rule of the target block; If the decrypted data satisfies the first, second and third configuration rules of the target block at the same time, it is determined that the decrypted data complies with the preset configuration rule in the target block.
6. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the digital credential generation method as claimed in any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the device where the computer-readable storage medium is located executes the computer program, the digital credential generation method as described in any one of claims 1 to 4 is implemented.
