Grayscale switch switching method and device
By receiving and verifying grayscale switch maintenance requests in the blockchain network and executing smart contracts for switching, the problem of low link-long transaction switching in the banking system is solved, and more efficient grayscale switch switching is achieved.
Patent Information
- Application Number
- CN202110472402.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-29
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-04-29
AI Technical Summary
There is opacity and dependency in the switching of transaction grayscale switches with long links in the banking system, which leads to operation and maintenance personnel going through a lengthy approval process, which has high communication costs and low switching efficiency.
Receive the grayscale switch maintenance request of the terminal device in the blockchain network, conduct legality verification and identity verification, and if passed, execute the preset smart contract to switch to avoid the approval process.
It improves the efficiency of grayscale switch switching, reduces communication costs and approval process, and achieves faster switching operations.
Smart Images

Figure CN113177234B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a grayscale switch switching method and device. Background Art
[0002] The banking system is huge, including many different business systems. Completing a transaction often requires the cooperation of multiple applications, and the transaction chain involved is long.
[0003] At present, various business systems in the banking system are gradually migrating from the original host system to the distributed system. In order to ensure the reliability of business transactions, the host system and the distributed system are usually operated in dual systems, and the switching of applications is controlled by gray switches. However, for transactions with long links, the gray switches of each application are not transparent, and there are some dependencies. The emergency switching of the gray switches of applications is maintained by production and operation and maintenance personnel, and needs to be sorted out and submitted to the approval parties at all levels for approval and confirmation in turn. Only after the approval and confirmation is passed can the operation and maintenance personnel implement the switching, which has a high communication cost and low switching efficiency. Summary of the invention
[0004] In view of the problems in the prior art, an embodiment of the present invention provides a grayscale switch switching method and device, which can at least partially solve the problems in the prior art.
[0005] In one aspect, the present invention provides a grayscale switch switching method, comprising:
[0006] Receiving a grayscale switch maintenance request sent by a terminal device, wherein the grayscale switch maintenance request includes an identifier of a grayscale switch to be maintained and an identifier of a smart contract;
[0007] Broadcasting the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device;
[0008] If the terminal device passes the legitimacy verification, an identity verification request is broadcast in the blockchain network to verify the local authority;
[0009] If the local authority passes the verification, the corresponding smart contract is obtained according to the smart contract identifier, and the smart contract is executed to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0010] In another aspect, the present invention provides a grayscale switch switching device, comprising:
[0011] A receiving module, configured to receive a grayscale switch maintenance request sent by a terminal device, wherein the grayscale switch maintenance request includes an identifier of a grayscale switch to be maintained and an identifier of a smart contract;
[0012] A first broadcast module, used to broadcast the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device;
[0013] A second broadcast module is used to broadcast an identity verification request in the blockchain network to verify local permissions after the terminal device passes the legitimacy verification;
[0014] An execution module is used to obtain the corresponding smart contract according to the smart contract identifier after the local authority is verified, and execute the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0015] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the grayscale switch switching method described in any of the above embodiments when executing the program.
[0016] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the grayscale switch switching method described in any of the above embodiments.
[0017] The grayscale switch switching method and device provided by the embodiments of the present invention can receive a grayscale switch maintenance request sent by a terminal device, broadcast the grayscale switch maintenance request in a blockchain network to verify the legitimacy of the terminal device, and if the terminal device passes the legitimacy verification, broadcast an identity verification request in the blockchain network to verify the local authority; if the local authority passes the verification, obtain the corresponding smart contract according to the smart contract identifier, and execute the smart contract to switch the grayscale switch, thereby avoiding the lengthy approval process for grayscale switch switching and improving the switching efficiency of the grayscale switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1 It is a structural schematic diagram of the grayscale switch switching system provided by the first embodiment of the present invention.
[0020] Figure 2 It is a flowchart of the grayscale switch switching method provided by the second embodiment of the present invention.
[0021] Figure 3 It is a flowchart of the grayscale switch switching method provided by the third embodiment of the present invention.
[0022] Figure 4 It is a flowchart of the grayscale switch switching method provided by the fourth embodiment of the present invention.
[0023] Figure 5 It is a flowchart of the grayscale switch switching method provided by the fifth embodiment of the present invention.
[0024] Figure 6 It is a schematic diagram of the structure of a rights management node provided by the sixth embodiment of the present invention.
[0025] Figure 7 It is a schematic diagram of the structure of a rights management node provided by the seventh embodiment of the present invention.
[0026] Figure 8 It is a schematic diagram of the structure of the grayscale switch switching device provided in the eighth embodiment of the present invention.
[0027] Fig. 9 It is a schematic diagram of the structure of a grayscale switch switching device provided in the ninth embodiment of the present invention.
[0028] Fig.10 4 is a schematic diagram of the structure of a grayscale switch switching device provided in the tenth embodiment of the present invention.
[0029] Fig.11 It is a schematic diagram of the structure of the grayscale switch switching device provided in the eleventh embodiment of the present invention.
[0030] Fig.12 It is a schematic diagram of the physical structure of an electronic device provided in the twelfth embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.
[0032] Figure 1 is a schematic diagram of the structure of the grayscale switch switching system provided by the first embodiment of the present invention. Figure 1 As shown, the grayscale switch switching system provided by the embodiment of the present invention includes multiple transaction application system nodes 1, authority management nodes 2, supervision nodes 3 and terminal devices 4, wherein:
[0033] Each transaction application system node 1 corresponds to at least one terminal device 4 and is connected in communication with the corresponding terminal device 4. Each transaction application system node 1 is connected in communication with the authority management node 2 and the supervision node 3 respectively, and the authority management node 2 is connected in communication with the supervision node 3. The terminal device 4 can also be connected in communication with the supervision node 3. Among them, the terminal device 4 includes but is not limited to desktop computers, laptops, smart phones, tablet computers and other devices. The transaction application system node 1 can use a server. The authority management node 2 can use a server. The supervision node 3 can use a server.
[0034] A plurality of transaction application system nodes 1, authority management nodes 2 and supervision nodes 3 constitute a blockchain network. The transaction application system node 1 is used to execute the grayscale switch switching method provided in the embodiment of the present invention to complete the rapid switching of the grayscale switch.
[0035] Among them, the transaction application system node 1 can correspond to the development department, branch technology, business department, etc., and set the maintenance authority of the application, with functions such as gray switch maintenance and transaction link query. The supervision node 3 is used for operational compliance monitoring and abnormal monitoring of the blockchain, and the supervision node 3 corresponds to production organizations such as the operation and maintenance center. The authority management node 2 is used for authority management and control in various dimensions to realize functions such as registration, security authentication and authorization. The authority management node 2 is also used to configure smart contracts and consensus algorithms. For example, in some embodiments, the authority management node 2 implements access and exit control for each transaction application system node 1 in the blockchain network. The authority management node 2 corresponds to management organizations such as the head office.
[0036] The following takes the transaction application system node as an example of the execution subject to illustrate the specific implementation process of the grayscale switch switching method provided by the embodiment of the present invention.
[0037] Figure 2 is a flow chart of a grayscale switch switching method provided by a second embodiment of the present invention. Figure 2 As shown, the grayscale switch switching method provided by the embodiment of the present invention includes:
[0038] S201. Receive a grayscale switch maintenance request sent by a terminal device, where the grayscale switch maintenance request includes an identifier of a grayscale switch to be maintained and an identifier of a smart contract;
[0039] Specifically, when it is necessary to switch the grayscale switch of an application, the operation and maintenance personnel can send a grayscale switch maintenance request to the transaction application system node through the terminal device, and the transaction application system node will receive the grayscale switch maintenance request. Among them, the grayscale switch maintenance request includes information such as the transaction application system node identifier, user identifier, grayscale switch identifier, smart contract identifier, grayscale range, planned grayscale date, transaction retrieval number, transaction time and application expiration time, which are set according to actual needs and are not limited in the embodiments of the present invention. It is understandable that the grayscale switch identifier to be maintained may include one grayscale switch identifier, or may include two or more grayscale switch identifiers. The smart contract identifier corresponds one-to-one to the smart contract.
[0040] S202, broadcasting the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device;
[0041] Specifically, after receiving the gray switch maintenance request, the transaction application system node will broadcast the gray switch maintenance request in the blockchain network, so that other nodes in the blockchain network can verify the legitimacy of the terminal device that sends the gray switch maintenance request based on the consensus mechanism, and return the legitimacy verification result to the transaction application system node. Among them, other nodes in the blockchain network refer to each node in the blockchain network except the transaction application system node, which may include other transaction application system nodes, monitoring nodes and authority management nodes. The consensus mechanism used for verifying the legitimacy of the terminal device can be a Practical Byzantine Fault Tolerance (PBFT) algorithm, a Zero-Knowledge Proof (ZKP) algorithm, a Proof of Authority (PoA) consensus algorithm, etc., which can be selected according to actual needs, and the embodiment of the present invention does not limit it.
[0042] S203. If the terminal device passes the legitimacy verification, an identity verification request is broadcast in the blockchain network to verify the local authority;
[0043] Specifically, the transaction application system node can obtain the legitimacy verification result of the terminal device. If the legitimacy verification result of the terminal device is a pass, then the terminal device passes the legitimacy verification. The transaction application system node will broadcast an identity verification request in the blockchain network so that other nodes in the blockchain network can verify local permissions based on a consensus mechanism, that is, verify whether the transaction application system node has the maintenance authority for the grayscale switch. Other nodes in the blockchain network will feedback the verification result of the local permissions to the transaction application system node. Among them, the local permissions are preset, that is, the grayscale switch maintenance permissions of which the transaction application system node has are pre-set. The identity verification request may include a transaction application system node identifier and a grayscale switch identifier. The consensus mechanism used to verify local permissions can be a Byzantine fault-tolerant PBFT algorithm, a ZKP algorithm, a Proof of Authority consensus algorithm, etc., which can be selected according to actual needs, and the embodiment of the present invention does not limit it.
[0044] S204. If the local authority passes the verification, the corresponding smart contract is obtained according to the smart contract identifier, and the smart contract is executed to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0045] Specifically, the transaction application system node can obtain the verification result of the local authority. If the verification result of the local authority is passed, then the local authority passes the verification. The transaction application system node can obtain the smart contract corresponding to the smart contract identifier according to the smart contract identifier, and then execute the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained. Among them, the smart contract is preset, and the smart contract corresponds to the smart contract identifier one by one.
[0046] For example, the smart contract sets which approval nodes need to be approved for the switching of the grayscale switch corresponding to the grayscale switch identifier to be maintained, and can send an approval request to each approval node. If each approval node feeds back information agreeing to the switch, then the transaction application system node can switch the grayscale switch corresponding to the grayscale switch identifier to be maintained. The specific method of switching can be pre-set in the smart contract.
[0047] The grayscale switch switching method provided by the embodiment of the present invention can receive a grayscale switch maintenance request sent by a terminal device, broadcast the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device, and if the terminal device passes the legitimacy verification, broadcast an identity verification request in the blockchain network to verify the local authority; if the local authority passes the verification, obtain the corresponding smart contract according to the smart contract identifier, and execute the smart contract to switch the grayscale switch, thereby avoiding the lengthy approval process for grayscale switch switching and improving the switching efficiency of the grayscale switch.
[0048] Figure 3 is a flow chart of a grayscale switch switching method provided by a third embodiment of the present invention. Figure 3 As shown, on the basis of the above embodiments, further, executing the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained includes:
[0049] S301, sending an approval request to the approval node corresponding to the grayscale switch identifier to be maintained based on the smart contract; wherein the smart contract includes the approval node corresponding to the grayscale switch identifier to be maintained;
[0050] Specifically, the transaction application system node obtains the approval node corresponding to the gray switch identifier to be maintained from the smart contract, and then sends an approval request to the approval node corresponding to the gray switch identifier to be maintained, requesting consent to switch the gray switch corresponding to the gray switch identifier to be maintained. Among them, the approval node is a node in the blockchain network, which is set according to actual needs and is not limited by the embodiment of the present invention. The smart contract includes the approval node corresponding to the gray switch identifier to be maintained. The approval node corresponding to the gray switch identifier to be maintained can be one node, or two or more approval nodes, which are set according to actual needs and are not limited by the embodiment of the present invention.
[0051] S302. Switch the grayscale switch to be maintained based on the approval result returned by the approval node corresponding to the grayscale switch identifier to be maintained and the switch switching rule; wherein the smart contract includes the switch switching rule.
[0052] Specifically, after receiving the approval request, each approval node corresponding to the grayscale switch identifier to be maintained may return an approval result to the transaction application system node, wherein the approval result is approval of the switch or disapproval of the switch. After obtaining the approval result returned by the approval node corresponding to the grayscale switch identifier to be maintained, the transaction application system node obtains the switch switching rule from the smart contract, and determines whether to switch the grayscale switch and how to switch the grayscale switch based on the approval result returned by the approval node corresponding to the grayscale switch identifier to be maintained and the switch switching rule. Among them, the smart contract includes the switch switching rule, and the switch switching rule is set according to actual needs, which is not limited in the embodiment of the present invention.
[0053] For example, the switch switching rule includes that if the approval result returned by the approval node A is approval for switching, the gray switch a is changed from the on state to the off state, and the gray switch b is changed from the off state to the on state. The transaction application system node will send an approval request to the approval node A and receive the approval result returned by the approval node A. If the approval result returned by the approval node A is approval for switching, then according to the gray switch identifier to be maintained, it is determined that the gray switch a and the gray switch b need to be switched, and the gray switch a is changed from the on state to the off state, and the gray switch b is changed from the off state to the on state. Among them, the gray switch is in the on state, indicating that the application corresponding to the gray switch is enabled, and the gray switch is in the off state, indicating that the application corresponding to the gray switch is disabled.
[0054] For example, the switch switching rule includes changing the gray switch c and gray switch d from the closed state to the open state if at least two of the three approval results returned by the approval node B, the approval node C, and the approval node D are in agreement with the switch. The transaction application system node will send approval requests to the approval node B, the approval node C, and the approval node D, respectively, and receive the three approval results returned by the approval node B, the approval node C, and the approval node D. If two of the three approval results are in agreement with the switch, the transaction application system node determines that the gray switch c and the gray switch d need to be switched according to the gray switch identifier to be maintained, and will change the gray switch c from the closed state to the open state, and change the gray switch d from the closed state to the open state.
[0055] Figure 4 is a flow chart of a grayscale switch switching method provided by a fourth embodiment of the present invention. Figure 4 As shown, based on the above embodiments, further, the gray switch maintenance request includes a transaction application system node identifier and a user identifier; accordingly, if the terminal device passes the legitimacy verification, it includes:
[0056] S401, receiving the legitimacy result returned by other nodes in the blockchain network; wherein the legitimacy result is obtained based on the transaction application system node identifier and the user identifier;
[0057] Specifically, the gray switch maintenance request includes a transaction application system node identifier and a user identifier. After the transaction application system node broadcasts the gray switch maintenance request in the blockchain network, other nodes in the blockchain network can obtain the transaction application system node identifier and the user identifier after receiving the gray switch maintenance request, and query whether the user corresponding to the user identifier has access rights to the transaction application system node corresponding to the transaction application system node identifier. If the transaction application system node identifier corresponding to the user identifier is found to include the transaction application system node identifier in the gray switch maintenance request, it means that the user corresponding to the user identifier has access rights to the transaction application system node corresponding to the transaction application system node identifier, and the legitimacy result is verification passed; if the transaction application system node identifier corresponding to the user identifier is found to not include the transaction application system node identifier in the gray switch maintenance request, it means that the user corresponding to the user identifier does not have access rights to the transaction application system node corresponding to the transaction application system node identifier, and the legitimacy result is verification failed. The transaction application system node can receive the legitimacy results returned by other nodes in the blockchain network. Among them, the transaction application system node identifier corresponds to the transaction application system node one-to-one. The user identifier corresponds to the user one-to-one. The user's access rights to the transaction application system nodes are preset.
[0058] S402: If more than a preset number of the legitimacy verification results returned by other nodes are passed, it is determined that the terminal device has passed the legitimacy verification.
[0059] Specifically, the legality verification results returned by other nodes of the transaction application system node are counted, and the number x of legality verification results that have passed the verification is counted. If the number x is greater than a preset number, it can be determined that the terminal device has passed the legality verification. If the number x is less than or equal to the preset number, it can be determined that the terminal device has not passed the legality verification. The preset number is set according to actual needs and is not limited in the embodiment of the present invention.
[0060] Figure 5 is a flowchart of a grayscale switch switching method provided by a fifth embodiment of the present invention. Figure 5 As shown, based on the above embodiments, further, the identity verification request includes the transaction application system node identifier and the grayscale switch identifier to be maintained; accordingly, if the local authority passes the verification, it includes:
[0061] S501, receiving the verification result of the local authority returned by other nodes in the blockchain network; wherein the verification result of the local authority is obtained based on the node identifier of the transaction application system and the grayscale switch identifier to be maintained;
[0062] Specifically, the identity verification request includes a transaction application system node identifier and the grayscale switch identifier to be maintained. After the transaction application system node broadcasts the identity verification request in the blockchain network, other nodes in the blockchain network can obtain the transaction application system node identifier and the grayscale switch identifier to be maintained after receiving the identity verification request, and query whether the transaction application system node corresponding to the transaction application system node identifier has the maintenance authority for the grayscale switch corresponding to the grayscale switch identifier to be maintained. If it is found that the grayscale switch identifier corresponding to the transaction application system node identifier includes the grayscale switch identifier to be maintained, it means that the transaction application system node corresponding to the transaction application system node identifier has the maintenance authority for the grayscale switch corresponding to the grayscale switch identifier to be maintained, and the verification result of the local authority is verification passed; if the grayscale switch identifier corresponding to the transaction application system node identifier does not include the grayscale switch identifier to be maintained, it means that the transaction application system node corresponding to the transaction application system node identifier does not have the maintenance authority for the grayscale switch corresponding to the grayscale switch identifier to be maintained, and the verification result of the local authority is verification failed. The transaction application system node may receive the verification result of the local authority returned by other nodes in the blockchain network, wherein the transaction application system node identifier corresponds to the transaction application system node one by one.
[0063] S502: If more than a preset number of identity verification results returned by other nodes are verified as passed, it is determined that the local authority has passed the verification.
[0064] Specifically, the verification results of the local permissions returned by other nodes of the transaction application system node are counted, and the verification results of the local permissions are counted as the number y of the verification results of the local permissions that have passed the verification. If the number y is greater than the preset number, it can be determined that the local permissions have passed the verification. If the number y is less than or equal to the preset number, it can be determined that the local permissions have not passed the verification. Among them, the preset number is set according to actual needs and is not limited in the embodiment of the present invention.
[0065] On the basis of the above embodiments, further, the grayscale switch switching method provided by the embodiment of the present invention also includes:
[0066] The processing result of the grayscale switch maintenance request is stored on the chain.
[0067] Specifically, after executing the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained, the transaction application system node will obtain the processing result of the grayscale switch maintenance request, and then broadcast the processing result of the grayscale switch maintenance request in the blockchain network, so that other nodes in the blockchain network can perform storage consensus on the processing result of the grayscale switch maintenance request based on the storage consensus mechanism. If the processing result of the grayscale switch maintenance request passes the storage consensus, the transaction application system node will create a new block for the processing result of the grayscale switch maintenance request, and store the created new block on the blockchain, so as to realize the on-chain storage of the processing result of the grayscale switch maintenance request. Among them, the storage consensus mechanism is preset, for example, a Byzantine fault tolerance algorithm, a zero-knowledge proof or an authority proof consensus algorithm can be used, which is set according to actual needs, and the embodiment of the present invention does not limit it.
[0068] On the basis of the above embodiments, further, the grayscale switch switching method provided by the embodiment of the present invention also includes:
[0069] If the terminal device fails the legality verification, illegal prompt information is returned to the terminal device.
[0070] Specifically, if the transaction application system node determines that the terminal device has not passed the legality verification, the transaction application system node may return illegal prompt information to the terminal device to prompt that the terminal device does not have the authority to access the transaction application system node.
[0071] On the basis of the above embodiments, further, the grayscale switch switching method provided by the embodiment of the present invention also includes:
[0072] The processing result of the grayscale switch maintenance request is returned to the terminal device.
[0073] Specifically, after executing the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained, the transaction application system node will obtain the processing result of the grayscale switch maintenance request, and can return the processing result of the grayscale switch maintenance request to the terminal device for maintenance personnel to view.
[0074] Figure 6 is a schematic diagram of the structure of a rights management node provided by a sixth embodiment of the present invention. Figure 6 As shown, on the basis of the above embodiments, further, the authority management node 2 includes a blockchain node access module 21, a terminal device access module 22, a smart contract signing module 23 and a new node joining module 24, wherein:
[0075] The blockchain node access module 21 is used to verify the newly added nodes on the blockchain. After the verification is passed, a unique identifier and an exclusive private key are generated for the node, and the unique identifier and private key are returned to the newly added node together with the system public key. The newly added node is qualified to receive and process the grayscale switch maintenance request.
[0076] The terminal device admission module 22 is used to perform authorization authentication on a newly connected terminal device.
[0077] The smart contract signing module 23 is used to sign smart contracts with newly added nodes that have passed verification and newly connected terminal devices that have passed authorization and authentication.
[0078] The new node joining module 24 is used to broadcast the new member joining information in the blockchain network, and the original nodes in the blockchain network will receive the new member joining information and record the new member joining information. The new member joining information includes but is not limited to the node identification, maintenance authority and other information of the newly joined node.
[0079] Figure 7 is a schematic diagram of the structure of a rights management node provided by the seventh embodiment of the present invention, such as Figure 7 As shown, on the basis of the above embodiments, further, the rights management node provided by the embodiment of the present invention also includes a user management module 25, wherein:
[0080] The user management module 25 includes a new user admission unit 251 , a rights allocation unit 252 and a broadcast publishing unit 253 .
[0081] The new user admission unit 251 is used to perform identity verification on the new user. If the verification passes, a new user is created and a unique corresponding user identifier is configured for the new user.
[0082] The authority allocation unit 252 is used to allocate operation permissions to newly created users, such as access permissions to transaction application system nodes, transaction link query permissions, etc.
[0083] The broadcast publishing unit 253 is used to broadcast new user information in the blockchain network. Each node in the blockchain network will receive the new user information. The new user information may include user identification, user authority information and other content. It is set according to actual needs and is not limited in the embodiment of the present invention.
[0084] Figure 8 is a schematic diagram of the structure of a grayscale switch switching device provided by an eighth embodiment of the present invention. Figure 8 As shown, the grayscale switch switching device provided by the embodiment of the present invention includes a receiving module 801, a first broadcasting module 802, a second broadcasting module 803 and an execution module 804, wherein:
[0085] The receiving module 801 is used to receive a grayscale switch maintenance request sent by a terminal device, wherein the grayscale switch maintenance request includes a grayscale switch identifier to be maintained and a smart contract identifier; the first broadcast module 802 is used to broadcast the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device; the second broadcast module 803 is used to broadcast an identity verification request in the blockchain network after the terminal device passes the legitimacy verification to verify local permissions; the execution module 804 is used to obtain a corresponding smart contract according to the smart contract identifier after the local permissions are verified, and execute the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0086] Specifically, when it is necessary to switch the grayscale switch of the application, the operation and maintenance personnel can send a grayscale switch maintenance request to the receiving module 801 through the terminal device, and the receiving module 801 will receive the grayscale switch maintenance request. Among them, the grayscale switch maintenance request includes information such as the transaction application system node identifier, user identifier, grayscale switch identifier, smart contract identifier, grayscale range, planned grayscale date, transaction retrieval number, transaction time and application expiration time, which are set according to actual needs and are not limited in the embodiment of the present invention. It is understandable that the grayscale switch identifier to be maintained may include one grayscale switch identifier, or may include two or more grayscale switch identifiers. The smart contract identifier corresponds one-to-one to the smart contract.
[0087] After receiving the gray switch maintenance request, the first broadcast module 802 broadcasts the gray switch maintenance request in the blockchain network, so that other nodes in the blockchain network can verify the legitimacy of the terminal device that sent the gray switch maintenance request based on the consensus mechanism and return the legitimacy verification result. The consensus mechanism used to verify the legitimacy of the terminal device can be a PBFT algorithm, a ZKP algorithm, a PoA consensus algorithm, etc., which can be selected according to actual needs and is not limited in the embodiment of the present invention.
[0088] The second broadcast module 803 can obtain the legitimacy verification result of the terminal device. If the legitimacy verification result of the terminal device is passed, then the terminal device passes the legitimacy verification. The second broadcast module 803 will broadcast the identity verification request in the blockchain network, so that other nodes in the blockchain network can verify the local authority based on the consensus mechanism, that is, verify whether the local has the maintenance authority of the gray switch. Other nodes in the blockchain network will feedback the verification results of the local authority. Among them, the local authority is preset, that is, which gray switch maintenance authority the local has is pre-set. The identity verification request may include the transaction application system node identifier and the gray switch identifier. The consensus mechanism used to verify the local authority can be the Byzantine Fault Tolerant PBFT algorithm, the ZKP algorithm, the Proof of Authority consensus algorithm, etc., which can be selected according to actual needs, and the embodiment of the present invention is not limited.
[0089] The execution module 804 can obtain the verification result of the local authority. If the verification result of the local authority is passed, then the local authority passes the verification. The execution module 804 can obtain the smart contract corresponding to the smart contract identifier according to the smart contract identifier, and then execute the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained. Among them, the smart contract is preset, and the smart contract corresponds to the smart contract identifier one by one.
[0090] The grayscale switch switching device provided by the embodiment of the present invention can receive a grayscale switch maintenance request sent by a terminal device, broadcast the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device, and if the terminal device passes the legitimacy verification, broadcast an identity verification request in the blockchain network to verify the local authority; if the local authority passes the verification, obtain the corresponding smart contract according to the smart contract identifier, and execute the smart contract to switch the grayscale switch, thereby avoiding the lengthy approval process for grayscale switch switching and improving the switching efficiency of the grayscale switch.
[0091] Fig. 9 is a schematic diagram of the structure of a grayscale switch switching device provided by a ninth embodiment of the present invention. Fig. 9 As shown, the execution module 804 includes a sending unit 8041 and a switching unit 8042, wherein:
[0092] The sending unit 8041 is used to send an approval request to the approval node corresponding to the grayscale switch identifier to be maintained based on the smart contract; wherein the smart contract includes the approval node corresponding to the grayscale switch identifier to be maintained; the switching unit 8042 switches the grayscale switch to be maintained based on the approval result returned by the approval node corresponding to the grayscale switch identifier to be maintained and the switch switching rule; wherein the smart contract includes the switch switching rule.
[0093] Fig.10 is a schematic diagram of the structure of a grayscale switch switching device provided by the tenth embodiment of the present invention. Fig.10 As shown, based on the above embodiments, further, the gray switch maintenance request includes a transaction application system node identifier and a user identifier; accordingly, the second broadcast module 803 includes a first receiving unit 8031 and a first determining unit 8032, wherein:
[0094] The first receiving unit 8031 is used to receive the legitimacy results returned by other nodes in the blockchain network; the first determining unit 8032 is used to determine that the terminal device has passed the legitimacy verification after more than a preset number of legitimacy verification results among the legitimacy verification results returned by other nodes are verified as passed.
[0095] Fig.11 is a schematic diagram of the structure of the grayscale switch switching device provided by the eleventh embodiment of the present invention. Fig.11 As shown, on the basis of the above embodiments, further, the identity verification request includes the transaction application system node identifier and the grayscale switch identifier to be maintained; accordingly, the execution module 804 includes a second receiving unit 8043 and a second determining unit 8044, wherein:
[0096] The second receiving unit 8043 is used to receive identity verification results returned by other nodes in the blockchain network; the second determining unit 8044 is used to determine that the local authority has passed the verification after more than a preset number of identity verification results returned by other nodes are verified as passed.
[0097] On the basis of the above embodiments, further, the grayscale switch switching device provided in the embodiment of the present invention further includes an uplink module, wherein:
[0098] The uplink module is used for uplinking and storing the processing result of the grayscale switch maintenance request.
[0099] On the basis of the above embodiments, further, the grayscale switch switching device provided by the embodiment of the present invention further includes a first return module, wherein:
[0100] The returning module is used for returning illegal prompt information to the terminal device after the terminal device fails the legality verification.
[0101] On the basis of the above embodiments, further, the grayscale switch switching device provided by the embodiment of the present invention further includes a second return module, wherein:
[0102] The second returning module is used to return the processing result of the grayscale switch maintenance request to the terminal device.
[0103] The embodiments of the apparatus provided in the embodiments of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments, and its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.
[0104] Fig.12 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Fig.12 As shown, the electronic device may include: a processor 1201, a communication interface 1202, a memory 1203 and a communication bus 1204, wherein the processor 1201, the communication interface 1202 and the memory 1203 complete mutual communication through the communication bus 1204. The processor 1201 may call the logic instructions in the memory 1203 to execute the following method: receiving a grayscale switch maintenance request sent by a terminal device, wherein the grayscale switch maintenance request includes a grayscale switch identifier to be maintained and a smart contract identifier; broadcasting the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device; if the terminal device passes the legitimacy verification, broadcasting an identity verification request in the blockchain network to verify the local authority; if the local authority passes the verification, obtaining the corresponding smart contract according to the smart contract identifier, and executing the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0105] In addition, the logic instructions in the above-mentioned memory 1203 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0106] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: receiving a grayscale switch maintenance request sent by a terminal device, the grayscale switch maintenance request including a grayscale switch identifier to be maintained and a smart contract identifier; broadcasting the grayscale switch maintenance request in a blockchain network to verify the legitimacy of the terminal device; if the terminal device passes the legitimacy verification, broadcasting an identity verification request in the blockchain network to verify local permissions; if the local permissions pass the verification, obtaining a corresponding smart contract according to the smart contract identifier, and executing the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0107] The present embodiment provides a computer-readable storage medium, which stores a computer program, and the computer program enables the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: receiving a grayscale switch maintenance request sent by a terminal device, the grayscale switch maintenance request including a grayscale switch identifier to be maintained and a smart contract identifier; broadcasting the grayscale switch maintenance request in a blockchain network to verify the legitimacy of the terminal device; if the terminal device passes the legitimacy verification, broadcasting an identity verification request in the blockchain network to verify local permissions; if the local permissions pass the verification, obtaining a corresponding smart contract according to the smart contract identifier, and executing the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset.
[0108] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0109] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0110] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0113] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A grayscale switch switching method, characterized in that: include: Receiving a grayscale switch maintenance request sent by a terminal device, wherein the grayscale switch maintenance request includes an identifier of a grayscale switch to be maintained and an identifier of a smart contract; Broadcasting the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device; If the terminal device passes the legitimacy verification, an identity verification request is broadcast in the blockchain network to verify the local authority and whether the local device has the maintenance authority with grayscale switch; If the local authority passes the verification, the corresponding smart contract is obtained according to the smart contract identifier, and the smart contract is executed to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset; The executing of the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained includes: Sending an approval request to the approval node corresponding to the grayscale switch identifier to be maintained based on the smart contract; wherein the smart contract includes the approval node corresponding to the grayscale switch identifier to be maintained; The grayscale switch to be maintained is switched based on the approval result returned by the approval node corresponding to the grayscale switch identifier to be maintained and the switch switching rule; wherein the smart contract includes the switch switching rule.
2. The method according to claim 1, characterized in that: The grayscale switch maintenance request includes a transaction application system node identifier and a user identifier; accordingly, if the terminal device passes the legitimacy verification, it includes: Receiving the legitimacy result returned by other nodes in the blockchain network; wherein the legitimacy result is obtained based on the transaction application system node identifier and the user identifier; If more than a preset number of the legitimacy verification results returned by other nodes are verified as passed, it is determined that the terminal device has passed the legitimacy verification.
3. The method according to claim 1, characterized in that The identity verification request includes the transaction application system node identifier and the grayscale switch identifier to be maintained; accordingly, if the local authority passes the verification, it includes: Receiving the verification result of the local authority returned by other nodes in the blockchain network; wherein the verification result of the local authority is obtained based on the node identifier of the transaction application system and the grayscale switch identifier to be maintained; If more than a preset number of identity verification results returned by other nodes are verified as passed, it is determined that the local authority has passed the verification.
4. The method according to claim 1, characterized in that: Also includes: The processing result of the grayscale switch maintenance request is stored on the chain.
5. The method according to claim 1, characterized in that Also includes: If the terminal device fails the legality verification, illegal prompt information is returned to the terminal device.
6. The method according to any one of claims 1 to 5, characterized in that: Also includes: The processing result of the grayscale switch maintenance request is returned to the terminal device.
7. A grayscale switch switching device, characterized in that: include: A receiving module, configured to receive a grayscale switch maintenance request sent by a terminal device, wherein the grayscale switch maintenance request includes an identifier of a grayscale switch to be maintained and an identifier of a smart contract; A first broadcast module, used to broadcast the grayscale switch maintenance request in the blockchain network to verify the legitimacy of the terminal device; A second broadcast module is used to broadcast an identity verification request in the blockchain network after the terminal device passes the legitimacy verification, so as to verify the local authority and whether the local has the maintenance authority with grayscale switch; an execution module, configured to obtain a corresponding smart contract according to the smart contract identifier after the local authority is verified, and execute the smart contract to switch the grayscale switch corresponding to the grayscale switch identifier to be maintained; wherein the smart contract is preset; Wherein, the execution module includes a sending unit and a switching unit, the sending unit is used to send an approval request to the approval node corresponding to the grayscale switch identifier to be maintained based on the smart contract; wherein, the smart contract includes the approval node corresponding to the grayscale switch identifier to be maintained; the switching unit switches the grayscale switch to be maintained based on the approval result returned by the approval node corresponding to the grayscale switch identifier to be maintained and the switch switching rule; wherein, the smart contract includes the switch switching rule.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
State machine maintenance method and device based on block chain, electronic equipment and storage medium
CN110458538A
Method and device for processing data request in blockchain network
CN110535872A
Electronic certificate management method, system and device based on blockchain network, and medium
CN110661779A
Data verification method and device based on block chain, storage medium and electronic device
CN110675153A
Block chain transaction processing method, transaction node and block chain system
CN111275555A
