WO2020253102A1 - 线上背书签名方法、装置、设备和存储介质 - Google Patents

线上背书签名方法、装置、设备和存储介质 Download PDF

Info

Publication number
WO2020253102A1
WO2020253102A1 PCT/CN2019/120816 CN2019120816W WO2020253102A1 WO 2020253102 A1 WO2020253102 A1 WO 2020253102A1 CN 2019120816 W CN2019120816 W CN 2019120816W WO 2020253102 A1 WO2020253102 A1 WO 2020253102A1
Authority
WO
WIPO (PCT)
Prior art keywords
endorsement
node
endorsing
strategy
target
Prior art date
Application number
PCT/CN2019/120816
Other languages
English (en)
French (fr)
Inventor
褚镇飞
Original Assignee
深圳壹账通智能科技有限公司
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 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020253102A1 publication Critical patent/WO2020253102A1/zh

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • 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

Definitions

  • This application relates to the field of computer technology, in particular to online endorsement and signature methods, devices, equipment and storage media.
  • Endorsement signature is a kind of signature behavior.
  • the basic process of online endorsement signature is as follows: After the client creates a transaction, it sends an endorsement request to the server, and the server selects any endorsement from the set of endorsement nodes corresponding to the transaction according to a preset selection strategy Node, the server sends the endorsement request to the selected endorsement node, the endorsement node simulates the transaction after receiving the endorsement request, and then generates the endorsement signature.
  • the existing online endorsement and signature methods have a single strategy for selecting endorsement nodes.
  • the client has no response method, which affects the efficiency and effectiveness of endorsement and signature. reliability.
  • the main purpose of this application is to solve the technical problem of low endorsement efficiency in the existing endorsement request method due to a single node selection strategy.
  • An online endorsement and signature method, device, equipment and storage medium are proposed.
  • the method is identified by the strategy identifier
  • the client can adjust the node selection strategy according to specific scenarios to obtain a suitable target endorsement node, which improves the efficiency and reliability of the endorsement signature.
  • An online endorsement signature method including: obtaining a policy identifier selected by a client, obtaining a node selection policy corresponding to the policy identifier from a policy set; obtaining an endorsement request of the client, and determining the endorsement request Corresponding endorsement node set; use the node selection strategy to select a target endorsement node from the endorsement node set, and send the endorsement request to the target endorsement node; receive the endorsement request returned by the target endorsement node The corresponding response is sent to the client.
  • the strategy set includes at least any two of the following strategies: sequentially selecting an endorsing node in the endorsing node set, and determining the selected endorsing node as the target endorsing node; or randomly selecting from the endorsing node set An endorsement node of, determining the selected endorsing node as the target endorsing node; or identifying the endorsing node with the smallest network delay in the endorsing node set, and determining the recognized endorsing node as the target endorsing node; or Identify the endorsement node with the smallest number of pending endorsement requests in the endorsement node set, and determine the identified endorsement node as the target endorsement node; or determine all endorsement nodes in the endorsement node set as the target endorsement node node.
  • this application also provides an online endorsement and signature device, including:
  • the obtaining module is configured to obtain the policy identifier selected by the client and the endorsement request of the client.
  • the processing module is configured to retrieve the node selection strategy corresponding to the strategy identifier obtained by the obtaining module from the strategy set; determine the endorsement node set corresponding to the endorsement request obtained by the obtaining module; The node selection strategy selects a target endorsement node from the set of endorsement nodes, and sends the endorsement request to the target endorsement node; receives the response returned by the target endorsement node corresponding to the endorsement request, and sends the response Sent to the client.
  • the strategy set includes at least any two of the following strategies: sequentially selecting an endorsing node in the endorsing node set, and determining the selected endorsing node as the target endorsing node; or randomly selecting from the endorsing node set An endorsement node of, determining the selected endorsing node as the target endorsing node; or identifying the endorsing node with the smallest network delay in the endorsing node set, and determining the recognized endorsing node as the target endorsing node; or Identify the endorsement node with the smallest number of pending endorsement requests in the endorsement node set, and determine the identified endorsement node as the target endorsement node; or determine all endorsement nodes in the endorsement node set as the target endorsement node node.
  • the present application also provides a computer device, including an input and output unit, a memory, and a processor.
  • the memory stores computer-readable instructions that are executed by the processor. , Causing the processor to execute the steps in the above-mentioned online endorsement and signature method.
  • the present application also provides a computer-readable storage medium.
  • the storage medium may be volatile or nonvolatile.
  • the storage medium can be read and written by the processor.
  • the storage medium stores computer instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps in the online endorsement signature method described above.
  • the node selection strategy selected by the client is identified through the strategy identifier.
  • the client can adjust the node selection strategy according to the specific scenario to obtain a suitable target endorsement node and improve the efficiency of endorsement signature And reliability.
  • FIG. 1 is a schematic flowchart of an online endorsement signature method in an embodiment of this application.
  • Figure 2 is a schematic diagram of the mutual signaling of the client, the server, and the target endorsement node in an embodiment of the application.
  • FIG. 3 is a schematic diagram of the structure of an online endorsement and signature device in an embodiment of the application.
  • Figure 4 is a schematic structural diagram of a computer device in an embodiment of the application.
  • FIG. 1 is a flowchart of an online endorsement signature method in some embodiments of this application. As shown in FIG. 2, the online endorsement signature method is executed by the server. As shown in Figure 1, the online endorsement signature method may include The following steps S1-S4:
  • the client displays a strategy bar, which displays the names of multiple node selection strategies, and each node selection strategy corresponds to a unique strategy identifier.
  • the client sends the policy identifier corresponding to the node selection policy to the server, and the server determines the node selection policy selected by the user according to the policy identifier.
  • the strategy identifier corresponding to node selection strategy A is decimal "1”
  • the strategy identifier corresponding to node selection strategy B is decimal "2”
  • node The strategy ID corresponding to the selected strategy C is decimal "3" and so on.
  • the format of the strategy identification is an 8-bit binary number, which occupies one byte (Byte); the first to fourth bits of the 8-bit binary number are reserved bits, and the last 4 bits are identification bits;
  • the identification bit is the payload of the strategy identification; when the identification bit does not overflow, the reserved bit is not used, and the reserved bit is represented by binary "0".
  • the strategy identifier "0000 0011” the first 4 digits "0000” are the reserved digits
  • the last 4 digits "0011” are the identification digits, which are converted into decimal numbers, which are decimal "3".
  • the client terminal also stores the policy identifier sent to the server in a local memory, the memory is a non-volatile memory, and the policy identifier is not lost after power off.
  • the client when the client re-establishes a connection with the server, in the state that the user does not re-select the node selection strategy, the client sends the last stored policy identifier in the memory to the server, that is, the node selection strategy selected by the user last time Set as the current default node selection strategy to reduce user initialization operations.
  • the obtaining the node selection policy corresponding to the policy identifier from the policy set includes the following steps: recalling the configuration file corresponding to the policy identifier from the configuration file set; the configuration file includes The file information of the program file; the program file carries the program code for executing the node selection strategy; the file information includes access path information and file name information; the file information is read from the configuration file; The file information loads the program code in the program file to execute the node selection strategy.
  • Each node selection strategy runs as an independent program, and the program corresponding to the strategy identification can be loaded only through the configuration file, which is convenient for the expansion of the node selection strategy.
  • the set of endorsement nodes includes a plurality of endorsement nodes.
  • the client After creating a transaction, the client initiates an endorsement request, submits the transaction information to the specified endorsing node set, and requests any endorsing node in the endorsing node set to endorse and sign the transaction.
  • the transaction includes the following information: the client's identification (clientID), the client's signature (clientSig), the chain code (chaincodeID) to which the transaction belongs, and the transaction payload (Payload).
  • the endorsement node set B corresponding to institution b has 4 endorsement nodes b1, b2, b3, and b4. These 4 endorsement nodes can perform the same endorsement signature; that is, if transaction A1 requires institution b to perform endorsement signature , Then transaction A1 needs to obtain the endorsement signature of any endorsing node in the endorsing node set B.
  • the strategy set includes at least any 2 of the following 5 strategies:
  • Strategy 1 Select an endorsement node in the set of endorsement nodes sequentially, and determine the selected endorsement node as the target endorsement node.
  • the server centrally processes the endorsement requests sent by these clients.
  • strategy 1 each time the server receives an endorsement request (the endorsement request is initiated by any client that selects strategy 1), it sequentially selects an endorsement node in the endorsement node set, and determines the endorsement node as the current endorsement node The target endorsement node of the received endorsement request, and the currently received endorsement request is sent to the endorsement node for endorsement signature.
  • the clients that select strategy 1 include client C1, client C2, and client C3; these three clients all request endorsement signatures from endorsing node set A, and endorsing node set A includes endorsements in turn Node a1, endorsement node a2, endorsement node a3, and endorsement node a4.
  • endorsing node set A includes endorsements in turn Node a1, endorsement node a2, endorsement node a3, and endorsement node a4.
  • the endorsement node a3 is selected in order as the target endorsement node of the endorsement request q1, that is, the endorsement node a3 endorses the transaction corresponding to the endorsement request q1.
  • the server regards the endorsement node a4 as the target endorsement node of the endorsement request q2, and the endorsement node a4 pairs
  • the endorsement requests the transaction corresponding to q2 to be endorsed and signed.
  • Strategy 2 Randomly select an endorsement node in the set of endorsement nodes, and determine the selected endorsement node as the target endorsement node.
  • the server equally and randomly selects any endorsement node in the endorsement node set as the target endorsement node, and the server sends the client's endorsement request to the endorsement node to realize the endorsement signature.
  • Strategy 3 Identify the endorsement node with the smallest network delay in the endorsement node set, and determine the identified endorsement node as the target endorsement node.
  • the server sends the endorsement request of the client to the endorsement node with the smallest network delay in the endorsement node set to realize the endorsement signature. Choosing the endorsement node with the smallest network delay for endorsement and signature can reduce the overall time of the endorsement and signature process.
  • Strategy 4 Identify the endorsement node with the smallest number of endorsement requests to be processed in the endorsement node set, and determine the identified endorsement node as the target endorsement node.
  • the server sends the endorsement request from the client to the endorsement node with the smallest number of endorsement requests to be processed in the endorsement node set to realize the endorsement signature.
  • Strategy 4 can average the load of each endorsing node, avoid overloading the endorsement node, and make the high-performance endorsing node "work harder" to improve the overall endorsement and signature efficiency of the endorsement network.
  • Strategy 5 Determine all endorsement nodes in the endorsement node set as the target endorsement nodes.
  • the server sends an endorsement request to all target endorsing nodes in the endorsement node set to obtain the endorsement signature of any endorsing node.
  • the advantage of Strategy 5 is that the endorsement has a high probability of success, which is suitable for use when the endorsement network is not busy.
  • the client can select a node selection strategy by itself, select the target endorsing node from the set of endorsement nodes by using the node selection strategy, and then initiate an endorsement request to the target endorsement node.
  • the node selection strategy selected by the client that created the transaction A1 is: the endorsing node with the smallest number of actives is used as the target endorsing node.
  • the server counts the number of pending endorsement requests of each endorsement node in the endorsement node set B, takes the endorsement node with the least number of pending endorsement requests as the target endorsement node, and then sends the endorsement request to the target endorsement node.
  • the endorsement node b1 has the least number of pending endorsement requests, and the server sends the endorsement request of transaction A1 to the endorsement node b1 to request the endorsement signature.
  • the transaction may also require a joint endorsement and signature.
  • the endorsement node set C corresponding to institution c has three endorsement nodes c1, c2, and c3, and these three endorsement nodes can perform the same endorsement signature; if transaction A1 needs to obtain institution b endorsement signature At the same time, it also needs to obtain the endorsement signature of institution c, then transaction A1 also needs to obtain the endorsement of any endorsing node in the endorsing node set C.
  • the server sends the endorsement request of transaction A1 to the endorsement node c2 to request endorsement signature.
  • the method before the identifying the endorsing node with the smallest network delay in the endorsing node set, the method further includes the following steps S011-S014:
  • the first endorsement node is any endorsement node in the endorsement node set.
  • the IP address of each endorsing node in the set of endorsing nodes is obtained through a traceroute command, which includes the IP address of the first endorsing node.
  • the traceroute command is a command under the Linux system for route tracking (the tracert command under the Windows system).
  • the traceroute command uses the Internet Control Message Protocol (ICMP) to locate the data transmission path between the server and each endorsing node in the endorsement node set to obtain the IP address.
  • ICMP Internet Control Message Protocol
  • S012 Send an Internet Control Message Protocol ICMP message to the first endorsing node according to the IP address.
  • the ICMP message is initiated by the server to the first endorsing node through a ping command.
  • Ping is a command under Windows, Unix and Linux systems. Ping belongs to a communication protocol and is part of the TCP/IP protocol. It is used to detect network connectivity and network delay.
  • the response message carries time stamp information.
  • the time stamp information includes: a time stamp t1 recorded when the ICMP message is sent to the first endorsing node1, a time recorded when the first endorsing node receives the ICMP message Stamp t2, the time stamp t3 recorded when the first endorsing node sends the response message, and the time stamp t4 recorded when the response message is received.
  • the method for generating the time stamp information is as follows: when the server sends the ICMP message to the first endorsing node, the ICMP message is stamped with a timestamp t1; the first endorsing node receives the ICMP message When writing, add a timestamp t2 to the ICMP message. After receiving the ICMP message, the first endorsing node constructs the response message. The response message records a time stamp t1 and a time stamp t2; when the first endorsing node sends the response message, the response message is marked with a time stamp t3; the server receives the response message At the time, mark t4 on the response message. In this way, the response message obtained by the server carries the information of the above four timestamps.
  • S014 Calculate the network delay of the first endorsing node according to the time stamp information, and obtain the network delay of each endorsing node in the set of endorsing nodes.
  • the calculation formula of the network delay of the first endorsing node is:
  • ⁇ T (
  • ⁇ T represents the network delay of the first endorsing node.
  • the method before identifying the endorsement node with the smallest number of endorsement requests to be processed in the endorsement node set, the method further includes the following steps S021-S024:
  • a counter is set for the first endorsement node in advance, and the counter counts the number of pending endorsement requests of the first endorsement node.
  • the first endorsement node receives a new endorsement request, it adds one to the value of the counter; if the first endorsement node finishes processing one endorsement request, it decreases the value of the counter by one.
  • S023 Determine the number of pending endorsement requests of the first endorsement node according to the value of the accumulator, and determine the number of pending endorsement requests of each endorsement node in the endorsement node set.
  • the server respectively accesses the counter corresponding to each endorsement node in the endorsement node set, and obtains the value of the counter of each endorsement node.
  • the value is the current number of endorsement requests to be processed by the endorsement node; then the endorsement node with the least number of endorsement requests currently pending is selected as the target endorsement node.
  • the target endorsement node After the target endorsement node receives the endorsement request sent by the server, it will verify the signature (clientSig) and chaincode (chaincodeID) in the transaction information, and use the payload (Payload) to simulate the transaction; if the signature (clientSig) and chaincode are (chaincodeID) verification is successful and the transaction simulation result is correct, the transaction is endorsed and signed, and the endorsement signature is returned to the client through the server.
  • clientSig signature
  • chaincodeID chaincode
  • the node selection strategy selected by the client is identified through the strategy identifier.
  • the client can adjust the node selection strategy according to the specific scenario to select the appropriate target endorsement node to improve the efficiency of endorsement signature And reliable.
  • this application also provides an online endorsement and signature device, which can provide a client with multiple endorsement node selection strategies to improve the efficiency of endorsement and signature.
  • the device in the embodiment of the present application can implement the steps corresponding to the method of online endorsement and signature executed in the embodiment corresponding to FIG. 1.
  • the functions realized by the device can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions, and the modules may be software and/or hardware.
  • the device includes an acquisition module 1 and a processing module 2.
  • the processing module 2 can be used to control the information acquisition operation of the acquisition module 1.
  • the obtaining module 1 is configured to obtain the policy identifier selected by the client and obtain the endorsement request of the client.
  • the processing module 2 is configured to retrieve the node selection strategy corresponding to the strategy identifier obtained by the obtaining module 1 from the strategy set; determine the endorsement corresponding to the endorsement request obtained by the obtaining module 1 Node set; use the node selection strategy to select a target endorsement node from the endorsement node set, and send the endorsement request to the target endorsement node; receive a response corresponding to the endorsement request returned by the target endorsement node To send the response to the client.
  • the strategy set includes at least any two of the following strategies: sequentially select an endorsement node in the endorsement node set, and determine the selected endorsement node as the target endorsement node; or randomly select all endorsement nodes.
  • An endorsement node in the endorsement node set the selected endorsement node is determined as the target endorsement node; or the endorsement node with the smallest network delay in the endorsement node set is identified, and the identified endorsement node is determined as the Target endorsement node; or identify the endorsement node with the smallest number of endorsement requests to be processed in the endorsement node set, and determine the recognized endorsement node as the target endorsement node; or determine all endorsement nodes in the endorsement node set Endorses the node for the target.
  • the processing module 2 is further configured to obtain the Internet Protocol IP address of the first endorsing node; the first endorsing node is any endorsing node in the endorsing node set; The first endorsing node sends an Internet Control Message Protocol ICMP message; receives a response message corresponding to the ICMP message returned by the first endorsing node; the response message carries time stamp information; according to The time stamp information calculates the network delay of the first endorsing node to obtain the network delay of each endorsing node in the set of endorsing nodes.
  • the time stamp information includes: a time stamp t1 recorded when the ICMP message is sent to the first endorsing node1, a time recorded when the first endorsing node receives the ICMP message Stamp t2, the time stamp t3 recorded when the first endorsing node sends the response message, and the time stamp t4 recorded when the response message is received.
  • the calculation formula of the network delay of the first endorsing node is:
  • ⁇ T (
  • ⁇ T represents the network delay of the first endorsing node.
  • the processing module 2 is further configured to start a counter corresponding to the first endorsement node; if the first endorsement node receives a new endorsement request, it adds one to the value of the counter; After the first endorsement node has processed an endorsement request, the value of the counter is reduced by one; the number of pending endorsement requests of the first endorsement node is determined according to the value of the accumulator, and each endorsement node in the set of endorsement nodes is determined The number of pending endorsement requests for each endorsement node.
  • the processing module 2 is specifically configured to retrieve the configuration file corresponding to the policy identifier from the configuration file set; the configuration file includes file information of the program file; the program file carries the execution The program code of the node selection strategy; the file information includes access path information and file name information; the file information is read from the configuration file; the program code in the program file is loaded according to the file information To execute the node selection strategy.
  • the strategy identifier is composed of an 8-bit binary number.
  • the first to fourth bits of the 8-bit binary number are reserved bits, and the last 4 bits are identification bits; the identification bits are the payload of the strategy identification.
  • the processing module 2 identifies the node selection strategy selected by the client through the strategy identifier.
  • the client can adjust the node selection strategy according to specific scenarios to select a suitable target endorsement node to improve endorsement. The efficiency and reliability of the signature.
  • the present application also provides a computer device.
  • the computer device includes an input output unit 31, a processor 32, and a memory 33.
  • the memory 33 stores computer-readable instructions.
  • the processor 32 executes the steps of the online endorsement and signature method in each of the foregoing embodiments.
  • the physical device corresponding to the acquisition module 1 shown in FIG. 3 is the input output unit 31 shown in FIG. Features.
  • the physical device corresponding to the processing module 2 shown in FIG. 3 is the processor 32 shown in FIG. 4.
  • the processor 32 can implement part or all of the functions of the processing module 2, or implement the same or similar functions as the processing module 2.
  • the present application also provides a computer-readable storage medium.
  • the storage medium may be volatile or nonvolatile.
  • the storage medium can be read and written by the processor.
  • the storage medium stores computer instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the online endorsement signature method in each of the foregoing embodiments.
  • the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium (such as ROM/RAM), including Several instructions are used to make a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present application.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种线上背书签名方法、装置、设备和存储介质,涉及区块链技术领域,该方法包括:获取客户端所选定的策略标识,从策略集合中获取与策略标识对应的节点选择策略(S1);获取客户端的背书请求,确定与背书请求对应的背书节点集合(S2);采用节点选择策略从背书节点集合中选择目标背书节点,将背书请求发送至目标背书节点(S3);接收目标背书节点返回的与背书请求对应的响应,将响应发送至所述客户端(S4)。节点选择策略有多种,客户端可以根据具体场景调整节点选择策略,以得到适合的目标背书节点,提高背书签名的效率和可靠性。

Description

线上背书签名方法、装置、设备和存储介质
本申请要求于2019年06月21日提交中国专利局、申请号为201910541031.0、发明名称为“线上背书签名方法、装置、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及线上背书签名方法、装置、设备和存储介质。
背景技术
背书签名是一种签章行为,线上背书签名的基本流程如下:客户端创建交易后,向服务器发送背书请求,服务器按照预设的选择策略从与交易对应的背书节点集合中选中任一背书节点,服务器将背书请求发送至所选中的背书节点,背书节点接收到背书请求后模拟交易,然后生成背书签名。
然而,现有的线上背书签名方法选择背书节点的策略单一,在被选中的背书节点的负载量过大或者网络时延过长的状态下,客户端无应对方式,影响背书签名的效率和可靠性。
发明内容
本申请的主要目的在于解决现有的背书请求方法因节点选择策略单一导致背书效率低的的技术问题,提出了一种线上背书签名方法、装置、设备和存储介质,该方法通过策略标识识别客户端所选择的节点选择策略,节点选择策略有多种,客户端可以根据具体场景调整节点选择策略,以得到适合的目标背书节点,提高背书签名的效率和可靠性。
一种线上背书签名方法,包括:获取客户端所选定的策略标识,从策略集合中获取与所述策略标识对应的节点选择策略;获取所述客户端的背书请求,确定与所述背书请求对应的背书节点集合;采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端。
所述策略集合至少包括以下策略中的任意两项:顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背 书节点确定为所述目标背书节点;或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;或将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
基于相同的技术构思,本申请还提供了一种线上背书签名装置,包括:
获取模块,设置为获取客户端所选定的策略标识,以及获取所述客户端的背书请求。
处理模块,设置为从策略集合中调取与所述获取模块所获取的所述策略标识对应的节点选择策略;确定与所述获取模块所获取的所述背书请求对应的背书节点集合;采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端。
所述策略集合至少包括以下策略中的任意两项:顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点;或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;或将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
基于相同的技术构思,本申请还提供了一种计算机设备,包括输入输出单元、存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如上述的线上背书签名方法中的步骤。
基于相同的技术构思,本申请还提供了一种计算机可读存储介质,该存储介质可以为易失性的,也可以是非易失性的,所述存储介质可被处理器读写,所述存储介质存储有计算机指令,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如上述的线上背书签名方法中的步骤。
本申请的有益效果:通过策略标识识别客户端所选择的节点选择策略,节点选择策略有多种,客户端可以根据具体场景调整节点选择策略,以得到适合的目标背书节点,提高背书签名的效率和可靠性。
附图说明
图1为本申请实施例中线上背书签名方法的流程示意图。
图2为本申请实施例中客户端、服务器以及目标背书节点之间的信令互交示意图。
图3为本申请实施例中线上背书签名装置的结构示意图。
图4为本申请实施例中计算机设备的结构示意图。
具体实施方式
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可以包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、程序、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、程序、步骤、操作、元件、组件和/或它们的组。
图1为本申请一些实施方式中一种线上背书签名方法的流程图,结合图2所示,该线上背书签名方法由服务器执行,如图1所示,该线上背书签名方法可以包括以下步骤S1-S4:
S1、获取客户端所选定的策略标识,从策略集合中获取与所述策略标识对应的节点选择策略。
一些实施方式中,客户端显示策略栏,该策略栏显示多项节点选择策略的名称,每项节点选择策略分别对应唯一的策略标识,当用户点击策略栏中的任一节点选择策略的名称后,客户端将与节点选择策略对应的策略标识发送至服务器,服务器根据策略标识确定用户所选择的节点选择策略。
可选地,采用不同的数字来设置各节点选择策略对应的策略标识,例如,节点选择策略A对应的策略标识为十进制“1”、节点选择策略B对应的策略标识为十进制“2”以及节点选择策略C对应的策略标识为十进制“3”等。所述策略标识的格式为8位(bit)二进制数,即占用一个字节(Byte);所述8位二进制数的第1至第4位为预留位,末4位为标识位;所述标识位为所述策略标识的有效载荷;在所述标识位未溢出的状态下,所述预留位不被使用,所述预留位用二进制“0”表示。例如,策略标识“0000 0011”,其前4位“0000”为所述预留位,后4位“0011”为所述标识位,转化为十进制数后,即为十进制“3”。
此外,客户端还将发送至服务器的策略标识存储在本地的存储器中,所述存储器为非易失性存储器,断电后,策略标识不丢失。这样,客户端重新与服 务器建立连接时,在用户未重新选择节点选择策略的状态下,客户端将所述存储器中上一次存储的策略标识发送至服务器,即将用户上一次所选择的节点选择策略设定为当前的默认节点选择策略,以减少用户的初始化操作。
一些实施方式中,所述从策略集合中获取与所述策略标识对应的节点选择策略,包括以下步骤:从配置文件集合中调取与所述策略标识对应的配置文件;所述配置文件中包括程序文件的文件信息;所述程序文件中携带执行所述节点选择策略的程序代码;所述文件信息包括访问路径信息以及文件名信息;从所述配置文件中读取所述文件信息;根据所述文件信息加载所述程序文件中的所述程序代码,以执行所述节点选择策略。
各项节点选择策略分别以独立的程序运行,只需通过配置文件即可加载与策略标识对应的程序,便于节点选择策略的拓展。
S2、获取所述客户端的背书请求,确定与所述背书请求对应的背书节点集合。
所述背书节点集合包括多个背书节点。
客户端创建一个交易后发起背书请求,将交易信息提交给所指定的背书节点集合,请求背书节点集合内的任一背书节点对交易进行背书签名。交易包括以下信息:客户端的标识(clientID)、客户端的签名(clientSig)、交易所属的链码(chaincodeID)以及交易的有效载荷(Payload)等。
例如,假设机构b所对应的背书节点集合B有4个背书节点b1、b2、b3和b4,这4个背书节点可执行相同的背书签名;也就是说,如果交易A1需要机构b进行背书签名,那么交易A1需要获取背书节点集合B中的任意一个背书节点的背书签名。
S3、采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点。
一些实施方式中,所述策略集合至少包括以下5项策略中的任意2项:
策略1:顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点。
在背书网络中,可能会有多个客户端选择策略1对同一个背书节点集合进行背书签名,服务器对这些客户端发送的背书请求集中进行处理。在策略1下,服务器每次接收到背书请求后(该背书请求由选择策略1的任一客户端发起),顺序的选择所述背书节点集合中的一个背书节点,将该背书节点确定为当前所 接收到的背书请求的目标背书节点,并将当前所接收到的背书请求发至该背书节点,进行背书签名。
例如,在背书网络中,选择策略1的客户端有客户端C1、客户端C2和客户端C3;这个3个客户端均向背书节点集合A请求背书签名,背书节点集合A中顺次包括背书节点a1、背书节点a2、背书节点a3以及背书节点a4。假设,服务器上一次接收到的背书请求q1来自客户端C2,并且按顺序选中背书节点a3作为背书请求q1的目标背书节点,即由背书节点a3对背书请求q1对应的交易进行背书签名。并且假设,服务器当前接收到的背书请求q2来自客户端C1,服务器当前按照顺序选中的背书节点应该为背书节点a4,即服务器将背书节点a4作为背书请求q2的目标背书节点,由背书节点a4对背书请求q2对应的交易进行背书签名。
策略2:随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点。
策略2下,服务器等概率地且随机地选中背书节点集合中的任一背书节点作为目标背书节点,服务器将客户端的背书请求发送至该背书节点,以实现背书签名。
策略3:识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点。
策略3下,服务器将客户端的背书请求发送至背书节点集合中网络时延最小的背书节点,以实现背书签名。选择网络时延最小的背书节点进行背书签名,能够减小背书签名过程的整体时间。
策略4:识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点。
策略4下,服务器将客户端的背书请求发送至背书节点集合中待处理背书请求的数量最少的背书节点,以实现背书签名。策略4能够平均各背书节点的负载,避免背书节点的负载过重,还能使得性能高的背书节点“能者多劳”,以提高背书网络整体的背书签名效率。
策略5:将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
策略5下,服务器向背书节点集合中所有的目标背书节点发送背书请求,以获取任一背书节点的背书签名。策略5的优点是背书的成功概率高,适合在背书网络不忙碌的情况下使用。
客户端可以自行选择节点选择策略,采用节点选择策略从所述背书节点集合中选择所述目标背书节点,然后向所述目标背书节点发起背书请求。仍以前述交易A1为例,假设创建交易A1的客户端所选择的节点选择策略为:将活跃数最小的背书节点作为所述目标背书节点。那么,服务器统计背书节点集合B中的各背书节点的待处理背书请求的数量,将待处理背书请求的数量最少的背书节点作为所述目标背书节点,然后向所述目标背书节点发送背书请求。例如,背书节点b1待处理背书请求的数量最少,服务器则将交易A1的背书请求发送至背书节点b1,请求背书签名。
通常,交易还可能需要联合背书签名。仍以前述交易A1为例,假设机构c所对应的背书节点集合C有3个背书节点c1、c2和c3,这3个背书节点可执行相同的背书签名;如果交易A1需要获得机构b背书签名的同时,还需要获得机构c的背书签名,那么交易A1还需要获取背书节点集合C中的任意一个背书节点的背书。假设背书节点c2待处理背书请求的数量最少,由于客户端选择向活跃数最小的背书节点发起背书请求,所以服务器将交易A1的背书请求发送至背书节点c2,请求背书签名。
一些实施方式中,在所述识别所述背书节点集合中网络时延最小的背书节点之前,所述方法还包括以下步骤S011-S014:
S011、获取第一背书节点的互联网协议IP地址。
所述第一背书节点为所述背书节点集合中的任一背书节点。
可选地,通过traceroute命令获取到所述背书节点集合中的每个背书节点的IP地址,其中,包括所述第一背书节点的IP地址。
traceroute命令是Linux系统下的指令,用于路由跟踪(Windows系统下是tracert命令)。在本申请中,traceroute命令利用网间控制报文协议(Internet Control Message Protocol,ICMP)定位服务器与所述背书节点集合中的每个背书节点之间的数据传输路径,以得到每个背书节点的IP地址。
S012、根据所述IP地址向所述第一背书节点发送网间控制报文协议ICMP报文。
所述ICMP报文由服务器通过ping命令向所述第一背书节点发起。Ping是Windows、Unix和Linux系统下的一个命令。ping属于一个通信协议,是TCP/IP协议的一部分,用于检测网络是否连通以及网络时延。
S013、接收所述第一背书节点所返回的与所述ICMP报文对应的回应报文。
所述回应报文内携带时间戳信息。
一些实施方式中,所述时间戳信息包括:向所述第一背书节点发送所述ICMP报文时所记录的时间戳t1、所述第一背书节点接收所述ICMP报文时所记录的时间戳t2、所述第一背书节点发送所述回应报文时所记录的时间戳t3以及接收所述回应报文时所记录的时间戳t4。
所述时间戳信息的生成方式如下:服务器向所述第一背书节点发送所述ICMP报文时,在所述ICMP报文上打上时间戳t1;所述第一背书节点接收到所述ICMP报文时,在所述ICMP报文上打上时间戳t2。所述第一背书节点接收到所述所述ICMP报文后,构造所述回应报文。所述回应报文中记载时间戳t1和间戳t2;所述第一背书节点发送所述回应报文时,在所述回应报文上打上间戳t3;服务器在接收到所述回应报文时,在所述回应报文上打上间戳t4。这样,服务器获取的所述回应报文就携带了上述4个时间戳的信息。
S014、根据所述时间戳信息计算所述第一背书节点的网络时延,得到所述背书节点集合中的每个背书节点的网络时延。
一些实施方式中,所述第一背书节点的网络时延的计算式为:
ΔT=(|t4-t1|-|t3-t2|)/2;
其中,ΔT表示所述第一背书节点的网络时延。
一些实施方式中,在所述识别所述背书节点集合中待处理背书请求的数量最少的背书节点之前,所述方法还包括以下步骤S021-S024:
S021、启动所述第一背书节点对应的计数器。
预先为所述第一背书节点设置计数器,计数器对所述第一背书节点的待处理背书请求的数量进行统计。
S022、若所述第一背书节点接收到新的背书请求,则对所述计数器的值加一;若所述第一背书节点处理完一个背书请求,则对所述计数器的值减一。
S023、根据所述累加器的值确定所述第一背书节点待处理背书请求的数量,确定所述背书节点集合中每个背书节点待处理背书请求的数量。
若用户选择待处理背书请求的数量最少的背书节点为所述目标背书节点时,服务器分别访问所述背书节点集合中每个背书节点对应的计数器,得到每个背书节点的计数器的值,计数器的值即为背书节点当前待处理背书请求的数量;然后选出当前待处理背书请求的数量最少的背书节点,作为所述目标背书节点。
S4、接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端。
所述目标背书节点接收到服务器发送来的背书请求后,会验证交易信息中的签名(clientSig)以及链码(chaincodeID),并利用有效载荷(Payload)模拟交易;如果签名(clientSig)以及链码(chaincodeID)验证均成功且交易模拟结果无误,则对交易进行背书签名,并将背书签名通过服务器返回至客户端。
上述实施例中,通过策略标识识别客户端所选择的节点选择策略,节点选择策略有多种,客户端可以根据具体场景调整节点选择策略,从而选择合适的目标背书节点,以提高背书签名的效率和可靠。
基于相同的技术构思,本申请还提供了一种线上背书签名装置,其可为客户端提供多种背书节点选择策略,以提高背书签名的效率。本申请实施例中的装置能够实现对应于上述图1所对应的实施例中所执行的线上背书签名的方法的步骤。该装置实现的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块,所述模块可以是软件和/或硬件。如图3所示,该装置包括获取模块1和处理模块2。所述处理模块2和获取模块2的功能实现可参考图1所对应的实施例中所执行的操作,此处不作赘述。所述处理模块2可用于控制所述获取模块1的信息获取操作。
所述获取模块1,设置为获取客户端所选定的策略标识,以及获取所述客户端的背书请求。
所述处理模块2,设置为从策略集合中调取与所述获取模块1所获取的所述策略标识对应的节点选择策略;确定与所述获取模块1所获取的所述背书请求对应的背书节点集合;采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端。
一些实施方式中,所述策略集合至少包括以下策略中的任意两项:顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点;或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;或将所述背书节点集合中所有的背书节点确定为所述目标背书节 点。
一些实施方式中,所述处理模块2还设置为获取第一背书节点的互联网协议IP地址;所述第一背书节点为所述背书节点集合中的任一背书节点;根据所述IP地址向所述第一背书节点发送网间控制报文协议ICMP报文;接收所述第一背书节点所返回的与所述ICMP报文对应的回应报文;所述回应报文内携带时间戳信息;根据所述时间戳信息计算所述第一背书节点的网络时延,得到所述背书节点集合中的每个背书节点的网络时延。
一些实施方式中,所述时间戳信息包括:向所述第一背书节点发送所述ICMP报文时所记录的时间戳t1、所述第一背书节点接收所述ICMP报文时所记录的时间戳t2、所述第一背书节点发送所述回应报文时所记录的时间戳t3以及接收所述回应报文时所记录的时间戳t4。
所述第一背书节点的网络时延的计算式为:
ΔT=(|t4-t1|-|t3-t2|)/2;
其中,ΔT表示所述第一背书节点的网络时延。
一些实施方式中,所述处理模块2还设置为启动所述第一背书节点对应的计数器;若所述第一背书节点接收到新的背书请求,则对所述计数器的值加一;若所述第一背书节点处理完一个背书请求,则对所述计数器的值减一;根据所述累加器的值确定所述第一背书节点待处理背书请求的数量,确定所述背书节点集合中每个背书节点待处理背书请求的数量。
一些实施方式中,所述处理模块2具体设置为从配置文件集合中调取与所述策略标识对应的配置文件;所述配置文件中包括程序文件的文件信息;所述程序文件中携带执行所述节点选择策略的程序代码;所述文件信息包括访问路径信息以及文件名信息;从所述配置文件中读取所述文件信息;根据所述文件信息加载所述程序文件中的所述程序代码,以执行所述节点选择策略。
一些实施方式中,所述策略标识由8位二进制数组成。所述8位二进制数的第1至第4位为预留位,末4位为标识位;所述标识位为所述策略标识的有效载荷。
上述实施例中,处理模块2通过策略标识识别客户端所选择的节点选择策略,节点选择策略有多种,客户端可以根据具体场景调整节点选择策略,从而选择合适的目标背书节点,以提高背书签名的效率和可靠。
基于相同的技术构思,本申请还提供了一种计算机设备,如图4所示,该 计算机设备包括输入输出单元31、处理器32和存储器33,所述存储器33中存储有计算机可读指令,所述计算机可读指令被所述处理器32执行时,使得所述处理器执行上述各实施方式中的所述的线上背书签名方法的步骤。
图3中所示的获取模块1对应的实体设备为图4所示的输入输出单元31,该输入输出单元31能够实现获取模块1部分或全部的功能,或者实现与获取模块1相同或相似的功能。
图3中所示的处理模块2对应的实体设备为图4所示的处理器32,该处理器32能够实现处理模块2部分或全部的功能,或者实现与处理模块2相同或相似的功能。
基于相同的技术构思,本申请还提供了一种计算机可读存储介质,该存储介质可以为易失性的,也可以是非易失性的,所述存储介质可被处理器读写,所述存储介质存储有计算机指令,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述各实施方式中的所述的线上背书签名方法的步骤。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,这些均属于本申请的保护之内。

Claims (20)

  1. 一种线上背书签名方法,包括:
    获取客户端所选定的策略标识,从策略集合中获取与所述策略标识对应的节点选择策略;
    获取所述客户端的背书请求,确定与所述背书请求对应的背书节点集合;
    采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;
    接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端;
    所述策略集合至少包括以下策略中的任意两项:
    顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
  2. 根据权利要求1所述的线上背书签名方法,其中,
    在所述识别所述背书节点集合中网络时延最小的背书节点之前,所述方法还包括:
    获取第一背书节点的互联网协议IP地址;所述第一背书节点为所述背书节点集合中的任一背书节点;
    根据所述IP地址向所述第一背书节点发送网间控制报文协议ICMP报文;
    接收所述第一背书节点所返回的与所述ICMP报文对应的回应报文;所述回应报文内携带时间戳信息;
    根据所述时间戳信息计算所述第一背书节点的网络时延,得到所述背书节点集合中的每个背书节点的网络时延。
  3. 根据权利要求2所述的线上背书签名方法,其中,
    所述时间戳信息包括:向所述第一背书节点发送所述ICMP报文时所记录的时间戳t1、所述第一背书节点接收所述ICMP报文时所记录的时间戳t2、所 述第一背书节点发送所述回应报文时所记录的时间戳t3以及接收所述回应报文时所记录的时间戳t4;
    所述第一背书节点的网络时延的计算式为:
    ΔT=(|t4-t1|-|t3-t2|)/2;
    其中,ΔT表示所述第一背书节点的网络时延。
  4. 根据权利要求2所述的线上背书签名方法,其中,
    在所述识别所述背书节点集合中待处理背书请求的数量最少的背书节点之前,所述方法还包括:
    启动所述第一背书节点对应的计数器;
    若所述第一背书节点接收到新的背书请求,则对所述计数器的值加一;若所述第一背书节点处理完一个背书请求,则对所述计数器的值减一;
    根据所述累加器的值确定所述第一背书节点待处理背书请求的数量,确定所述背书节点集合中每个背书节点待处理背书请求的数量。
  5. 根据权利要求1所述的线上背书签名方法,其中,
    所述从策略集合中获取与所述策略标识对应的节点选择策略,包括:
    从配置文件集合中调取与所述策略标识对应的配置文件;所述配置文件中包括程序文件的文件信息;所述程序文件中携带执行所述节点选择策略的程序代码;所述文件信息包括访问路径信息以及文件名信息;
    从所述配置文件中读取所述文件信息;
    根据所述文件信息加载所述程序文件中的所述程序代码,以执行所述节点选择策略。
  6. 根据权利要求1所述的线上背书签名方法,其中,
    所述策略标识由8位二进制数组成;所述8位二进制数的第1至第4位为预留位,末4位为标识位;所述标识位为所述策略标识的有效载荷。
  7. 一种线上背书签名装置,包括:
    获取模块,设置为获取客户端所选定的策略标识,以及获取所述客户端的背书请求;
    处理模块,设置为从策略集合中调取与所述获取模块所获取的所述策略标识对应的节点选择策略;确定与所述获取模块所获取的所述背书请求对应的背书节点集合;采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;接收所述目标背书节点返回的与所 述背书请求对应的响应,将所述响应发送至所述客户端;
    所述策略集合至少包括以下策略中的任意两项:
    顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
  8. 根据权利要求7所述的线上背书签名装置,其中,
    所述处理模块,还设置为获取第一背书节点的互联网协议IP地址;所述第一背书节点为所述背书节点集合中的任一背书节点;根据所述IP地址向所述第一背书节点发送网间控制报文协议ICMP报文;接收所述第一背书节点所返回的与所述ICMP报文对应的回应报文;所述回应报文内携带时间戳信息;根据所述时间戳信息计算所述第一背书节点的网络时延,得到所述背书节点集合中的每个背书节点的网络时延。
  9. 根据权利要求8所述的线上背书签名装置,其中,所述处理模块,还设置为所述时间戳信息包括:向所述第一背书节点发送所述ICMP报文时所记录的时间戳t1、所述第一背书节点接收所述ICMP报文时所记录的时间戳t2、所述第一背书节点发送所述回应报文时所记录的时间戳t3以及接收所述回应报文时所记录的时间戳t4;
    所述第一背书节点的网络时延的计算式为:
    ΔT=(|t4-t1|-|t3-t2|)/2;
    其中,ΔT表示所述第一背书节点的网络时延。
  10. 根据权利要求8所述的线上背书签名装置,其中,所述处理模块,包括:
    启动单元,设置为启动所述第一背书节点对应的计数器;
    计算单元,设置为若所述第一背书节点接收到新的背书请求,则对所述计数器的值加一;若所述第一背书节点处理完一个背书请求,则对所述计数器的 值减一;
    输出单元,设置为根据所述累加器的值确定所述第一背书节点待处理背书请求的数量,确定所述背书节点集合中每个背书节点待处理背书请求的数量。
  11. 根据权利要求8所述的线上背书签名装置,其中,所述处理模块,包括:
    调取单元,设置为从配置文件集合中调取与所述策略标识对应的配置文件;所述配置文件中包括程序文件的文件信息;所述程序文件中携带执行所述节点选择策略的程序代码;所述文件信息包括访问路径信息以及文件名信息;
    读取单元,设置为从所述配置文件中读取所述文件信息;
    加载单元,设置为根据所述文件信息加载所述程序文件中的所述程序代码,以执行所述节点选择策略。
  12. 根据权利要求8所述的线上背书签名装置,其中,所述处理模块,还设置为所述策略标识由8位二进制数组成;所述8位二进制数的第1至第4位为预留位,末4位为标识位;所述标识位为所述策略标识的有效载荷。
  13. 一种计算机设备,包括输入输出单元、存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
    获取客户端所选定的策略标识,从策略集合中获取与所述策略标识对应的节点选择策略;
    获取所述客户端的背书请求,确定与所述背书请求对应的背书节点集合;
    采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;
    接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端;
    所述策略集合至少包括以下策略中的任意两项:
    顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
  14. 根据权利要求13所述的计算机设备,其中,所述计算机可读指令被所述处理器执行时,使得所述处理器执行所述识别所述背书节点集合中网络时延最小的背书节点的步骤之前,还执行以下步骤:
    获取第一背书节点的互联网协议IP地址;所述第一背书节点为所述背书节点集合中的任一背书节点;
    根据所述IP地址向所述第一背书节点发送网间控制报文协议ICMP报文;
    接收所述第一背书节点所返回的与所述ICMP报文对应的回应报文;所述回应报文内携带时间戳信息;
    根据所述时间戳信息计算所述第一背书节点的网络时延,得到所述背书节点集合中的每个背书节点的网络时延。
  15. 根据权利要求14所述的计算机设备,其中,所述计算机可读指令被所述处理器执行时,使得所述处理器执行所述识别所述背书节点集合中待处理背书请求的数量最少的背书节点之前,还执行以下步骤:
    启动所述第一背书节点对应的计数器;
    若所述第一背书节点接收到新的背书请求,则对所述计数器的值加一;若所述第一背书节点处理完一个背书请求,则对所述计数器的值减一;
    根据所述累加器的值确定所述第一背书节点待处理背书请求的数量,确定所述背书节点集合中每个背书节点待处理背书请求的数量。
  16. 根据权利要求13所述的计算机设备,其中,所述计算机可读指令被所述处理器执行时,使得所述处理器执行所述从策略集合中获取与所述策略标识对应的节点选择策略时,还执行以下步骤:
    所述从策略集合中获取与所述策略标识对应的节点选择策略,包括:
    从配置文件集合中调取与所述策略标识对应的配置文件;所述配置文件中包括程序文件的文件信息;所述程序文件中携带执行所述节点选择策略的程序代码;所述文件信息包括访问路径信息以及文件名信息;
    从所述配置文件中读取所述文件信息;
    根据所述文件信息加载所述程序文件中的所述程序代码,以执行所述节点选择策略。
  17. 一种计算机可读存储介质,所述存储介质可被处理器读写,所述存储介质存储有计算机指令,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
    获取客户端所选定的策略标识,从策略集合中获取与所述策略标识对应的节点选择策略;
    获取所述客户端的背书请求,确定与所述背书请求对应的背书节点集合;
    采用所述节点选择策略从所述背书节点集合中选择目标背书节点,将所述背书请求发送至所述目标背书节点;
    接收所述目标背书节点返回的与所述背书请求对应的响应,将所述响应发送至所述客户端;
    所述策略集合至少包括以下策略中的任意两项:
    顺序选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或随机选择所述背书节点集合中的一背书节点,将所选择的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中网络时延最小的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或识别所述背书节点集合中待处理背书请求的数量最少的背书节点,将所识别的背书节点确定为所述目标背书节点;
    或将所述背书节点集合中所有的背书节点确定为所述目标背书节点。
  18. 根据权利要求17所述的存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述识别所述背书节点集合中网络时延最小的背书节点的步骤之前,还执行以下步骤:
    获取第一背书节点的互联网协议IP地址;所述第一背书节点为所述背书节点集合中的任一背书节点;
    根据所述IP地址向所述第一背书节点发送网间控制报文协议ICMP报文;
    接收所述第一背书节点所返回的与所述ICMP报文对应的回应报文;所述回应报文内携带时间戳信息;
    根据所述时间戳信息计算所述第一背书节点的网络时延,得到所述背书节点集合中的每个背书节点的网络时延。
  19. 根据权利要求18所述的存储介质,其中,所述计算机可读指令被一个 或多个处理器执行时,使得一个或多个处理器执行所述识别所述背书节点集合中待处理背书请求的数量最少的背书节点之前,还执行以下步骤:
    启动所述第一背书节点对应的计数器;
    若所述第一背书节点接收到新的背书请求,则对所述计数器的值加一;若所述第一背书节点处理完一个背书请求,则对所述计数器的值减一;
    根据所述累加器的值确定所述第一背书节点待处理背书请求的数量,确定所述背书节点集合中每个背书节点待处理背书请求的数量。
  20. 根据权利要求17所述的存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述从策略集合中获取与所述策略标识对应的节点选择策略时,还执行以下步骤:
    所述从策略集合中获取与所述策略标识对应的节点选择策略,包括:
    从配置文件集合中调取与所述策略标识对应的配置文件;所述配置文件中包括程序文件的文件信息;所述程序文件中携带执行所述节点选择策略的程序代码;所述文件信息包括访问路径信息以及文件名信息;
    从所述配置文件中读取所述文件信息;
    根据所述文件信息加载所述程序文件中的所述程序代码,以执行所述节点选择策略。
PCT/CN2019/120816 2019-06-21 2019-11-26 线上背书签名方法、装置、设备和存储介质 WO2020253102A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910541031.0 2019-06-21
CN201910541031.0A CN110414979A (zh) 2019-06-21 2019-06-21 线上背书签名方法、装置、设备和存储介质

Publications (1)

Publication Number Publication Date
WO2020253102A1 true WO2020253102A1 (zh) 2020-12-24

Family

ID=68359568

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/120816 WO2020253102A1 (zh) 2019-06-21 2019-11-26 线上背书签名方法、装置、设备和存储介质

Country Status (2)

Country Link
CN (1) CN110414979A (zh)
WO (1) WO2020253102A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414979A (zh) * 2019-06-21 2019-11-05 深圳壹账通智能科技有限公司 线上背书签名方法、装置、设备和存储介质
CN111629039B (zh) * 2020-05-20 2023-04-18 中国银联股份有限公司 一种区块链共识方法及客户端、背书节点、排序节点
CN111988188A (zh) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 交易背书方法、装置及存储介质
CN114531490A (zh) * 2020-11-04 2022-05-24 中国移动通信有限公司研究院 背书请求处理方法、区块链系统及电子设备
CN114938706B (zh) * 2022-01-28 2024-05-03 香港应用科技研究院有限公司 一种在区块链系统与非区块链系统之间进行数据交换的方法和设备
CN115065526A (zh) * 2022-06-10 2022-09-16 网络通信与安全紫金山实验室 基于区块链的动态背书方法、装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9886701B1 (en) * 2013-12-06 2018-02-06 Google Llc Endorsement abuse detection via social interactions
CN108009917A (zh) * 2017-10-13 2018-05-08 中国银联股份有限公司 数字货币的交易验证和登记方法及系统
CN108376368A (zh) * 2018-03-07 2018-08-07 物数(上海)信息科技有限公司 背书策略确定方法、装置、电子设备、存储介质
CN109493204A (zh) * 2018-10-16 2019-03-19 平安科技(深圳)有限公司 基于区块链的业务记账方法及终端设备
CN110414979A (zh) * 2019-06-21 2019-11-05 深圳壹账通智能科技有限公司 线上背书签名方法、装置、设备和存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2721769B1 (en) * 2011-06-17 2018-08-08 Telefonaktiebolaget LM Ericsson (publ) Quality of service for serving node and corresponding method
CN105704064A (zh) * 2014-11-24 2016-06-22 华为技术有限公司 一种用于选取服务节点的方法及装置、应用引擎
WO2019015755A1 (en) * 2017-07-20 2019-01-24 Telefonaktiebolaget Lm Ericsson (Publ) METHODS AND NODES FOR PROVIDING OR SELECTING USER TRAFFIC NODE

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9886701B1 (en) * 2013-12-06 2018-02-06 Google Llc Endorsement abuse detection via social interactions
CN108009917A (zh) * 2017-10-13 2018-05-08 中国银联股份有限公司 数字货币的交易验证和登记方法及系统
CN108376368A (zh) * 2018-03-07 2018-08-07 物数(上海)信息科技有限公司 背书策略确定方法、装置、电子设备、存储介质
CN109493204A (zh) * 2018-10-16 2019-03-19 平安科技(深圳)有限公司 基于区块链的业务记账方法及终端设备
CN110414979A (zh) * 2019-06-21 2019-11-05 深圳壹账通智能科技有限公司 线上背书签名方法、装置、设备和存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Non-official translation: Fabric endorsement policy-related concepts and validation process", CSDN BLOG <HTTPS://BLOG.CSDN.NET/GREEDYSTAR/ARTICLE/DETAILS/80593761>, 6 June 2018 (2018-06-06), DOI: 20https://blog.csdn.net/greedystar/article/details/80593761 *

Also Published As

Publication number Publication date
CN110414979A (zh) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2020253102A1 (zh) 线上背书签名方法、装置、设备和存储介质
JP7186862B2 (ja) ブロック処理方法、ブロックチェーンノード、ブロック処理システム及びコンピュータプログラム
US11303528B2 (en) Communications connection detection method and apparatus
KR102047585B1 (ko) 프록시 ip 어드레스를 식별하는 방법 및 장치
EP3211852A1 (en) Ssh protocol-based session parsing method and system
JP6686033B2 (ja) メッセージをプッシュするための方法および装置
WO2019174523A1 (zh) 一种传输应用程序编程接口api请求的方法及装置
CN107395559B (zh) 基于redis的数据处理方法及设备
US20080028034A1 (en) Method for mapping an iscsi target name to a storage resource based on an initiator hardware class identifier
WO2021128927A1 (zh) 报文的处理方法及装置、存储介质和电子装置
US20180013610A1 (en) File delivery method, apparatus and system
CN104811392A (zh) 用于处理网络中的资源访问请求的方法和系统
CN103685213A (zh) 一种减少针对dns的攻击的装置、系统和方法
WO2017000790A1 (zh) 网关设备响应网络连通性方法和装置
WO2018024176A1 (zh) 一种防止同一用户重复登录的装置和方法
KR20190130933A (ko) 블록체인 기반의 데이터 구성 방법 및 장치
CN107995233B (zh) 建立连接的方法及相应的设备
JP5304674B2 (ja) データ変換装置、データ変換方法及びプログラム
CN108768849A (zh) 报文处理方法及装置
US10445080B2 (en) Methods for adaptive placement of applications and devices thereof
CN109818912B (zh) 防范泛洪攻击的方法、装置、负载均衡设备和存储介质
CN104396216A (zh) 用于识别网络流量特征以关联和管理一个或多个后续流的方法及其装置
CN112235363B (zh) 数据处理方法、装置、电子设备、存储介质及系统
US9742927B2 (en) Online charging method for always on IP connectivity
WO2017063589A1 (zh) 数据传输的方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19934302

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19934302

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31/03/2022)