CN110930253B - Method and device for generating main key inside intelligent contract, computer equipment and storage medium - Google Patents

Method and device for generating main key inside intelligent contract, computer equipment and storage medium Download PDF

Info

Publication number
CN110930253B
CN110930253B CN201911128079.5A CN201911128079A CN110930253B CN 110930253 B CN110930253 B CN 110930253B CN 201911128079 A CN201911128079 A CN 201911128079A CN 110930253 B CN110930253 B CN 110930253B
Authority
CN
China
Prior art keywords
internal
main key
generating
key
intelligent contract
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.)
Active
Application number
CN201911128079.5A
Other languages
Chinese (zh)
Other versions
CN110930253A (en
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.)
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Priority to CN201911128079.5A priority Critical patent/CN110930253B/en
Publication of CN110930253A publication Critical patent/CN110930253A/en
Application granted granted Critical
Publication of CN110930253B publication Critical patent/CN110930253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a method and a device for generating an intelligent contract internal main key, computer equipment and a storage medium. The method belongs to the technical field of block chains, and comprises the following steps: receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key; at least one internal main key is generated according to the external main key and preset parameters and preset rules, and different related services can be identified based on the at least one internal main key. According to the embodiment of the invention, the plurality of internal main keys for the internal use of the intelligent contract can be generated according to one external main key generated by the distributed main key generation system, so that the generation of the internal main keys in the intelligent contract is reduced to depend on the external system excessively, and the development cost and complexity can be reduced to a certain extent.

Description

Method and device for generating main key inside intelligent contract, computer equipment and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method and apparatus for generating a primary key in an intelligent contract, a computer device, and a storage medium.
Background
With the development of blockchain technology, applications based on blockchains are increasing. Such blockchain-based applications are generally referred to as DAPPs (Decentralized Application, distributed applications or decentralized applications), while the core functionality of DAPPs on blockchains is implemented primarily through smart contracts. The main key in the intelligent contract is an attribute required by most business records, and is used for identifying a record, so that the business records are more convenient and effective to operate, and the data integrity can be well maintained. However, at present, all intelligent contract internal main keys of intelligent contracts in each blockchain platform are generated by an external unified intelligent contract internal main key generation system, and then the generated intelligent contract internal main keys are transmitted into the intelligent contracts for use, so that the number of the intelligent contract internal main keys needed to be used in the intelligent contracts needs the number of the external intelligent contract internal main key generation system to generate the number of the intelligent contract internal main keys, the intelligent contracts are excessively dependent on an external system, and the development cost and complexity are greatly increased.
Disclosure of Invention
The embodiment of the invention provides a method, a device, computer equipment and a storage medium for generating an intelligent contract internal main key, which aim to solve the problem that the generation of the existing intelligent contract internal main key excessively depends on an external system.
In a first aspect, an embodiment of the present invention provides a method for generating a primary key inside an intelligent contract, where the method includes:
receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key;
and generating at least one internal main key according to the external main key and the preset parameters and preset rules, and identifying different related services based on the at least one internal main key.
In a second aspect, an embodiment of the present invention further provides a method for generating a primary key inside an intelligent contract, where the method includes:
receiving a request sent by a user for starting generation of an intelligent contract internal main key;
sending a request for generating the intelligent contract internal main key to a distributed main key generation system;
receiving an external primary key generated by the distributed primary key generation system;
transmitting preset parameters required by the external main key and the internal main key of the intelligent contract to generate at least one internal main key;
and receiving related services sent by the intelligent contract and identified by the internal main key.
In a third aspect, an embodiment of the present invention further provides an apparatus for generating an internal primary key of an intelligent contract, where the apparatus includes a unit for executing a method for generating an internal primary key of an intelligent contract according to the first aspect, or includes a unit for executing a method for generating an internal primary key of an intelligent contract according to the second aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method for generating a main key inside an intelligent contract according to the first aspect or implements the method for generating a main key inside an intelligent contract according to the second aspect when executing the computer program.
In a fifth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor may implement the method for generating a master key inside a smart contract according to the first aspect or implement the method for generating a master key inside a smart contract according to the second aspect.
The embodiment of the invention provides an intelligent contract internal main key generation method, an intelligent contract internal main key generation device, computer equipment and a storage medium. Wherein the method comprises the following steps: receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key; and generating at least one internal main key according to the external main key and the preset parameters and preset rules, and identifying different related services based on the at least one internal main key. According to the embodiment of the invention, the plurality of internal main keys for the internal use of the intelligent contract can be generated according to one external main key generated by the distributed main key generation system, so that the generation of the internal main keys in the intelligent contract is reduced to depend on the external system excessively, and the development cost and complexity can be reduced to a certain extent.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a timing diagram of a method for generating a primary key in an intelligent contract according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for generating a primary key in an intelligent contract according to an embodiment of the present invention;
FIG. 3 is a schematic sub-flowchart of a method for generating a primary key in an intelligent contract according to an embodiment of the present invention;
FIG. 4 is a schematic sub-flowchart of a method for generating a primary key in an intelligent contract according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for generating a primary key in an intelligent contract according to another embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for generating a primary key in an intelligent contract according to another embodiment of the present invention;
FIG. 7 is a schematic block diagram of an apparatus for generating a primary key inside an intelligent contract according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a generating unit of the smart contract internal main key generating apparatus provided by the embodiment of the present invention;
FIG. 9 is a schematic block diagram of a generation subunit of the smart contract internal primary key generation apparatus provided by an embodiment of the invention;
FIG. 10 is a schematic block diagram of a computing unit of the smart contract internal primary key generation apparatus provided by an embodiment of the present invention;
FIG. 11 is a schematic block diagram of an encoding unit of the smart contract internal main key generation apparatus provided by the embodiment of the present invention;
FIG. 12 is a schematic block diagram of an intelligent contract internal primary key generation apparatus provided in another embodiment of the present invention;
FIG. 13 is a schematic block diagram of an apparatus for generating a primary key inside an intelligent contract according to still another embodiment of the present invention; and
fig. 14 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification 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 be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Referring to fig. 1, fig. 1 is a timing chart of a method for generating a primary key in an intelligent contract according to an embodiment of the invention. The intelligent contract internal main key generation method in the embodiment of the invention can be applied to a server and a terminal. The terminal comprises, but is not limited to, electronic equipment with a communication function, such as a smart phone, a tablet personal computer, a notebook computer, a desktop computer and the like. The server may be an independent server or a server cluster formed by a plurality of servers. The server communicates with the terminal to receive a request sent by the terminal to generate an internal primary key, thereby generating at least one internal primary key.
In fig. 1, a terminal receives a request sent by a user to start generating a server internal main key, and sends the request for generating the server internal main key to a distributed main key generating system, wherein an interface of the distributed main key generating system is integrated in program software installed in the terminal, and when the program software runs, the distributed main key generating system can be called; the distributed main key generation system generates external main keys according to a request for generating the internal main keys of the server and sends the external main keys to the terminal; the terminal receives an external main key generated by the distributed main key generation system and sends the external main key and preset parameters required by generating the internal main key of the server to the server; the method comprises the steps that a server receives a request for generating an internal main key sent by a terminal, generates at least one internal main key according to a preset rule according to an external main key and preset parameters, and then sends related services identified by the internal main key to the terminal; and the terminal receives the related service identified by the internal main key and sent by the server and displays the service to the client for inquiring.
Referring to fig. 2, fig. 1 is a flowchart illustrating a method for generating a primary key in an intelligent contract according to an embodiment of the invention. The method is applied to the server. In specific implementation, the method for generating the primary key inside the intelligent contract is realized through software installed on the server. More specifically, the method for generating the primary key inside the intelligent contract is realized through the intelligent contract in the blockchain installed on the server. Thus, the generation of internal main keys in the intelligent contract is reduced, the generation of the internal main keys is excessively dependent on an external system, and the development cost and complexity are further reduced. As shown in FIG. 2, the method includes the following steps S1-S2.
S1, receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key.
In the embodiment of the invention, when a user operates a distributed application installed on a terminal to create a new service on a blockchain, the distributed application firstly sends a request for generating an external main key to a distributed main key generation system through an interface of the distributed main key generation system; the distributed internal main key generation system receives a request for generating an external main key sent by the distributed application, generates the external main key, and returns the generated main key to the distributed application; after the distributed application receives the external main key generated by the distributed main key generation system, a new service creation request is sent to the intelligent contract in the blockchain, wherein the new service request is a request for generating the internal main key of the intelligent contract and comprises the external main key and preset parameters. The preset parameters are other parameters needed by the intelligent contract to generate an internal main key. The external primary key is a primary key in the form of a character string generated by combining the current server system time, the own machine ID and the current count after the distributed primary key system receives a request sent by the distributed application. In this embodiment, the external primary key is a snowflake key, which is a character string in the form of a 13-bit integer.
It should be noted that, the interaction between the distributed application and the distributed primary key generating system, and the interaction between the distributed application and the smart contract are all implemented through HTTP or RPC (Remote Procedure Call Protocol ).
S2, generating at least one internal main key according to the external main key and the preset parameters and preset rules, and identifying different related services based on the at least one internal main key.
In the embodiment of the invention, the intelligent contract receives the external main key and preset parameters sent by the distributed application and generates a plurality of internal main keys for internal use of the intelligent contract according to preset rules.
In the implementation, because the intelligent contract can generate a plurality of internal main keys for the internal use of the intelligent contract according to one external main key generated by the distributed main key generation system, the generation of the internal main key in the intelligent contract can be reduced to excessively depend on the external system, so that the business logic in the intelligent contract can be decoupled from the external system, and the expandability of the contract is improved.
In one embodiment, referring to FIG. 3, step S2 above includes the following steps S21-S22.
S21, determining a name space array according to the preset parameters based on the preset data table.
In the embodiment of the invention, the preset data table is a data table in an intelligent contract. In particular embodiments, a service namespace mapping table records different service data. Based on the service name space mapping table and preset parameters, a name space array can be determined so as to ensure that the main keys in the intelligent contracts generated subsequently are different from each other, and the aim that different services are identified by different main keys is fulfilled.
S22, generating the internal main key according to the name space array and the external main key.
In the embodiment of the invention, after the name space array is determined according to the preset parameters based on the preset data table, the name space array and the external main keys are used as the input parameters to be input into the generator function in the intelligent contract to generate a plurality of internal main keys, so that the function of generating a plurality of internal main keys according to a single external main key is realized.
In one embodiment, referring to fig. 4, the above step S22 specifically includes the following steps S221-S223.
S221, splicing the name space array and the external primary key into a binary number array.
S222, calculating the binary number group through a preset algorithm to obtain binary numbers.
S223, carrying out preset coding on the binary number to obtain the internal primary key.
In the embodiment of the invention, after a name space array is determined according to preset parameters based on a preset data table, firstly, the name space data and an external primary key are spliced into a binary number array, then the binary number array is calculated through a preset algorithm to obtain binary numbers, and finally, preset encoding is carried out on the binary numbers to obtain the internal primary key.
In specific implementation, the binary number group is calculated by a salt hash algorithm to obtain a binary number, and then the binary number is Hex-coded to obtain an internal primary key.
Fig. 5 is a flowchart of a method for generating a primary key in an intelligent contract according to another embodiment of the present invention. As shown in fig. 5, the smart contract internal main key generation method of the present embodiment includes steps S41 to S46. Steps S41 to S42 are similar to steps S1 to S2 in the above embodiment, and will not be described here again. Steps S43 to S46 added in the present embodiment are described in detail below.
S43, storing the related service of the internal primary key identification into a blockchain.
S44, judging whether the related business is successfully stored in the block chain, if so, executing the step S45, otherwise, executing the step S46.
S45, the related service is sent to the distributed application.
S46, sending an unsuccessful prompt to the user.
In the embodiment of the invention, after an internal main key is generated according to an external main key and preset parameters and a preset rule, the intelligent bonding date stores related services identified by the main key into a blockchain, and if the related services are successfully stored in the blockchain, the related services are sent to a distributed application; if the related business is stored unsuccessfully in the blockchain, the related business can send an unsuccessfully prompt message to the distributed application so as to remind the user that the generation of the primary key in the intelligent contract is unsuccessful. For example, pop up an unsuccessful prompt.
Referring to fig. 6, fig. 6 is a flowchart illustrating a method for generating a primary key in an intelligent contract according to another embodiment of the invention. The intelligent contract internal main key generation method of the other embodiment of the invention can be applied to the terminal. In specific implementation, the method for generating the main key inside the intelligent contract is realized through software installed on the terminal. More specifically, the method for generating the internal main key of the intelligent contract is realized through the distributed application installed on the terminal, so that the generation of the internal main key in the intelligent contract is reduced, the excessive dependence on an external system is relied on, and the development cost and complexity are further reduced. As shown in fig. 6, the method includes the following steps S51 to S55.
S51, receiving a request sent by a user for starting generation of an intelligent contract internal main key.
S52, sending a request for generating the intelligent contract internal main key to a distributed main key generation system.
S53, receiving an external primary key generated by the distributed primary key generation system.
S54, sending preset parameters required by the external main key and the internal main key of the intelligent contract to generate at least one internal main key.
S55, receiving related services which are sent by the intelligent contract and are identified by the internal main key.
In the embodiment of the invention, a distributed application installed on a terminal receives a request sent by a user for starting generation of an intelligent contract internal main key in a blockchain, and sends the request for generating the intelligent contract internal main key to a distributed main key generation system through an integrated distributed main key generation system interface; the distributed main key generation system generates an external main key and sends the external main key to the distributed application; the distributed application receives an external main key sent by the distributed main key generation system and sends the external main key and preset parameters required by generating an intelligent contract internal main key to the intelligent contract; the intelligent contract receives an external main key and preset parameters sent by the distributed application, generates a plurality of internal main keys according to a budget rule, stores related services identified by the internal main keys into a blockchain after generating the plurality of internal main keys, and sends the related services identified by the internal main keys to the distributed application; the distributed application receives the related service of the internal primary key identification and displays the related service for the user to view.
Fig. 7 is a schematic block diagram of an intelligent contract internal main key generating apparatus 60 according to an embodiment of the present invention. As shown in fig. 7, the present invention also provides an intelligent contract internal main key generation apparatus 60 corresponding to the above intelligent contract internal main key generation method. The smart contract internal master key generating apparatus 60 includes a unit for performing the smart contract internal master key generating method described above, and may be configured in a server, which may be a separate server or a server cluster composed of a plurality of servers. Specifically, referring to fig. 7, the smart contract internal main key generating apparatus 60 includes a requesting unit 61 and a generating unit 62.
The request unit 61 is configured to receive a request for generating an internal primary key sent by a distributed application, where the request for generating the internal primary key includes an external primary key generated by a distributed primary key generating system and preset parameters required for generating the internal primary key; the generating unit 62 is configured to generate at least one internal primary key according to a preset rule according to the external primary key and the preset parameter, and identify different related services based on the at least one internal primary key.
In some embodiments, for example, in the present embodiment, as shown in fig. 8, the generating unit 62 includes a determining unit 621 and a generating subunit 622.
Wherein, the determining unit 621 is configured to determine a namespace array according to the preset parameters based on the preset data table; the generating subunit 622 is configured to generate the internal primary key according to the namespace array and the external primary key.
In some embodiments, for example, in the present embodiment, as shown in fig. 9, the generating subunit 622 includes a splicing unit 6221, a calculating unit 6222, and an encoding unit 6223.
The splicing unit 6221 is configured to splice the namespace array and the external primary key into a binary array; the calculating unit 6222 is configured to calculate the binary number set by a preset algorithm to obtain a binary number; the encoding unit 6223 is configured to perform preset encoding on the binary number to obtain the internal primary key.
In some embodiments, for example, the present embodiment, as shown in fig. 10, the computing unit 6222 includes a computing subunit 62221.
The calculating subunit 62221 is configured to calculate the binary number set by using a salt hash algorithm to obtain a binary number.
In some embodiments, for example the present embodiment, as shown in fig. 11, the encoding unit 6223 includes an encoding subunit 62231.
Wherein the encoding subunit 62231 is configured to perform Hex encoding on the binary number to obtain the internal primary key.
In some embodiments, for example, referring to fig. 12, the smart contract internal master key generating apparatus 60 further includes a storage unit 63 and a judging unit 64.
The storage unit 63 is configured to store the related service identified by the internal primary key into a blockchain; the judging unit 64 is configured to judge whether the related service is successfully stored in the blockchain, and if the related service is successfully stored in the blockchain, send the related service to the distributed application.
Fig. 13 is a schematic block diagram of an intelligent contract internal master key generation apparatus 70 according to another embodiment of the present invention. The device may be configured in a terminal, such as a mobile communication terminal, e.g. a mobile phone, tablet computer, etc. The device comprises a unit corresponding to the intelligent contract internal main key generation method. As shown in fig. 13, the smart contract internal master key generating apparatus 70 includes a first receiving unit 71, a first transmitting unit 72, a second receiving unit 73, a second transmitting unit 74, and a third receiving unit 75.
The first receiving unit 71 is configured to receive a request sent by a user to start generating a primary key inside an intelligent contract; the first sending unit 72 is configured to send a request for generating the primary key inside the smart contract to a distributed primary key generating system; the second receiving unit 73 is configured to receive an external primary key generated by the distributed primary key generating system; the second sending unit 74 is configured to send preset parameters required for generating the external primary key and the internal primary key of the smart contract to generate at least one internal primary key; the third receiving unit 75 is configured to receive related services sent by the smart contract and identified by the internal primary key.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the above-mentioned smart contract internal main key generating device 60 and each unit may refer to the corresponding description in the foregoing method embodiments, and for convenience and brevity of description, the description is omitted here.
The above-described smart contract internal master key generation apparatus may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 14.
Referring to fig. 14, fig. 14 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 is a server. The server may be an independent server or a server cluster.
With reference to FIG. 14, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a smart contract internal primary key generation method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a smart contract internal key generation method.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the structure shown in fig. 14 is merely a block diagram of a portion of the structure associated with the present application and does not constitute a limitation of the computer device 500 to which the present application is applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key;
and generating at least one internal main key according to the external main key and the preset parameters and preset rules, and identifying different related services based on the at least one internal main key.
In an embodiment, when the processor 502 generates at least one internal primary key according to the external primary key and the preset parameters and the preset rule, different relevant business steps can be identified based on at least one internal primary key, which specifically includes the following steps:
determining a name space array according to the preset parameters based on the preset data table;
and generating the internal primary key according to the name space array and the external primary key.
In one embodiment, when the step of generating the internal primary key according to the namespace array and the external primary key is implemented by the processor 502, the following steps are specifically implemented:
splicing the name space array and the external primary key into a binary number array;
calculating the binary number group through a preset algorithm to obtain binary numbers;
and carrying out preset coding on the binary numbers to obtain the internal primary key.
In one embodiment, when the step of calculating the binary number set by the preset algorithm to obtain a binary number is implemented by the processor 502, the following steps are specifically implemented:
and calculating the binary number group through a salt hash algorithm to obtain a binary number.
In one embodiment, when the step of performing the preset encoding on the binary number to obtain the internal primary key is performed by the processor 502, the following steps are specifically implemented:
and performing Hex coding on the binary number to obtain the internal primary key.
In an embodiment, after the processor 502 generates at least one internal primary key according to the external primary key and the preset parameters and according to a preset rule, different relevant service steps can be identified based on at least one internal primary key, which further includes the following steps:
storing related services of the internal primary key identification into a blockchain;
judging whether the related business is successfully stored in the block chain, and if the related business is successfully stored in the block chain, sending the related business to the distributed application.
Another embodiment of the invention also provides a schematic block diagram of a computer device. In this embodiment, the computer device 500 is a terminal, and the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. Referring specifically to fig. 14, the computer device includes the same structure as the computer device shown in fig. 14. The computer device is different from the computer device shown in fig. 14 in that the computer program stored in the nonvolatile storage medium in the computer device, when executed by the processor 502, can implement the method for generating the primary key inside the intelligent contract implemented by the terminal, as shown in fig. 6.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
receiving a request sent by a user for starting generation of an intelligent contract internal main key;
sending a request for generating the intelligent contract internal main key to a distributed main key generation system;
receiving an external primary key generated by the distributed primary key generation system;
transmitting preset parameters required by the external main key and the internal main key of the intelligent contract to generate at least one internal main key;
and receiving related services sent by the intelligent contract and identified by the internal main key.
It should be appreciated that in embodiments of the present application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium that is a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, an embodiment of the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of:
receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key;
and generating at least one internal main key according to the external main key and the preset parameters and preset rules, and identifying different related services based on the at least one internal main key.
In an embodiment, when the processor executes the computer program to generate at least one internal primary key according to a preset rule according to the external primary key and the preset parameter, different relevant business steps can be identified based on the at least one internal primary key, and the following steps are specifically implemented:
determining a name space array according to the preset parameters based on the preset data table;
and generating the internal primary key according to the name space array and the external primary key.
In one embodiment, when the processor executes the computer program to implement the step of generating the internal primary key according to the namespace array and the external primary key, the processor specifically implements the following steps:
splicing the name space array and the external primary key into a binary number array;
calculating the binary number group through a preset algorithm to obtain binary numbers;
and carrying out preset coding on the binary numbers to obtain the internal primary key.
In one embodiment, when the processor executes the computer program to implement the step of calculating the binary number set by a preset algorithm to obtain a binary number, the following steps are specifically implemented:
and calculating the binary number group through a salt hash algorithm to obtain a binary number.
In one embodiment, the processor performs the following steps when executing the step of performing preset encoding on the binary number to obtain the internal primary key:
and performing Hex coding on the binary number to obtain the internal primary key.
In an embodiment, after the processor executes the computer program to implement the generating at least one internal primary key according to the external primary key and the preset parameters and the preset rule, the processor may identify different relevant service steps based on the at least one internal primary key, and then implement the following steps specifically:
storing related services of the internal primary key identification into a blockchain;
judging whether the related business is successfully stored in the block chain, and if the related business is successfully stored in the block chain, sending the related business to the distributed application.
In another embodiment of the present invention there is also provided a storage medium storing a computer program comprising program instructions which when executed by a processor implement the steps of:
receiving a request sent by a user for starting generation of an intelligent contract internal main key;
sending a request for generating the intelligent contract internal main key to a distributed main key generation system;
receiving an external primary key generated by the distributed primary key generation system;
transmitting preset parameters required by the external main key and the internal main key of the intelligent contract to generate at least one internal main key;
and receiving related services sent by the intelligent contract and identified by the internal main key.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (9)

1. An intelligent contract internal main key generation method, which is characterized by comprising the following steps:
receiving a request for generating an internal main key sent by a distributed application, wherein the request for generating the internal main key comprises an external main key generated by a distributed main key generation system and preset parameters required by generating the internal main key;
determining a name space array according to the preset parameters based on a service name space mapping table;
and generating the internal primary key according to the name space array and the external primary key.
2. The method of claim 1, wherein the generating the internal primary key from the namespace array and the external primary key comprises:
splicing the name space array and the external primary key into a binary number array;
calculating the binary number group through a preset algorithm to obtain binary numbers;
and carrying out preset coding on the binary numbers to obtain the internal primary key.
3. The method according to claim 2, wherein the calculating the binary number set by a preset algorithm to obtain a binary number comprises:
and calculating the binary number group through a salt hash algorithm to obtain a binary number.
4. The method of claim 2, wherein the pre-encoding the binary number to obtain the internal primary key comprises:
and performing Hex coding on the binary number to obtain the internal primary key.
5. The method of claim 1, wherein after generating the internal primary key according to the external primary key and the preset parameters and the preset rule, the method further comprises:
storing related services of the internal primary key identification into a blockchain;
judging whether the related business is successfully stored in the block chain or not;
and if the related service is successfully stored in the block chain, the related service is sent to the distributed application.
6. An intelligent contract internal main key generation method, which is characterized by comprising the following steps:
receiving a request sent by a user for starting generation of an intelligent contract internal main key;
sending a request for generating the intelligent contract internal main key to a distributed main key generation system;
receiving an external primary key generated by the distributed primary key generation system;
the external main key and preset parameters required for generating the internal main key of the intelligent contract are sent to the intelligent contract, so that the intelligent contract determines a naming space array according to a service naming space mapping table and the preset parameters, and generates the internal main key according to the naming space array and the external main key;
and receiving related services sent by the intelligent contract and identified by the internal main key.
7. An intelligent contract internal master key generation apparatus, characterized in that the intelligent contract internal master key generation apparatus comprises means for performing the method of any one of claims 1-5, or comprises means for performing the method of claim 6.
8. A computer device comprising a memory and a processor, the memory having stored thereon a computer program, the processor implementing the method according to any of claims 1-5 or performing the method according to claim 6 when the computer program is executed.
9. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, can implement the method of any one of claims 1-5 or perform the method of claim 6.
CN201911128079.5A 2019-11-18 2019-11-18 Method and device for generating main key inside intelligent contract, computer equipment and storage medium Active CN110930253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911128079.5A CN110930253B (en) 2019-11-18 2019-11-18 Method and device for generating main key inside intelligent contract, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911128079.5A CN110930253B (en) 2019-11-18 2019-11-18 Method and device for generating main key inside intelligent contract, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110930253A CN110930253A (en) 2020-03-27
CN110930253B true CN110930253B (en) 2023-05-23

Family

ID=69854182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911128079.5A Active CN110930253B (en) 2019-11-18 2019-11-18 Method and device for generating main key inside intelligent contract, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110930253B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949666B (en) * 2020-08-31 2023-12-05 深圳赛安特技术服务有限公司 Identification generation method and device, electronic equipment and storage medium
CN115630400B (en) * 2022-12-21 2023-05-26 中电科网络安全科技股份有限公司 Query method, device, equipment and storage medium for de-identified data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197505A (en) * 2017-12-29 2018-06-22 泰康保险集团股份有限公司 Block chain business data processing method, device and electronic equipment
WO2019111007A1 (en) * 2017-12-06 2019-06-13 Trisent Limited Personal data management
CN110019275A (en) * 2017-12-31 2019-07-16 中国移动通信集团安徽有限公司 Major key generation method, device, equipment and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019111007A1 (en) * 2017-12-06 2019-06-13 Trisent Limited Personal data management
CN108197505A (en) * 2017-12-29 2018-06-22 泰康保险集团股份有限公司 Block chain business data processing method, device and electronic equipment
CN110019275A (en) * 2017-12-31 2019-07-16 中国移动通信集团安徽有限公司 Major key generation method, device, equipment and medium

Also Published As

Publication number Publication date
CN110930253A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN109558748B (en) Data processing method and device, electronic equipment and storage medium
US11336451B2 (en) Cross-blockchain resource transmission
US11343103B2 (en) Sending cross-chain authenticatable messages
AU2013243512B2 (en) Telemetry system for a cloud synchronization system
CN107888656B (en) Calling method and calling device of server-side interface
CN110400217B (en) Rule change processing method and device for intelligent contract
CN110930253B (en) Method and device for generating main key inside intelligent contract, computer equipment and storage medium
CN109241009B (en) Method for preventing file from being repeatedly uploaded and control method and device thereof
CN110597918A (en) Account management method and device and computer readable storage medium
CN108667660B (en) Method and device for route management and service routing and routing system
CN112348596A (en) Bidding and quotation method, system, equipment and storage medium based on block chain
US8719622B2 (en) Recording and preventing crash in an appliance
CN112134908B (en) Application adaptation method, server, medium and vehicle-mounted multimedia system
CN112035763A (en) Information processing method, device and system, electronic equipment and storage medium
CN112650804B (en) Big data access method, device, system and storage medium
CN112437155B (en) Service data processing method and device and server device
CN112269915B (en) Service processing method, device, equipment and storage medium
CN111176641B (en) Flow node execution method, device, medium and electronic equipment
CN111738853A (en) Transaction optimization method and device based on block chain distributed system
CN108600255B (en) Mock service management method, device, computer equipment and storage medium
CN115514665A (en) Service expansion method and device, electronic equipment and storage medium
WO2018196613A1 (en) Application control method and device using function switches, server, and medium
CN115328509A (en) Algorithm changing method, device, computer equipment and storage medium
CN111767200B (en) Method, device and computer equipment for processing service based on service log
US11347884B2 (en) Data security tool

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
GR01 Patent grant
GR01 Patent grant