WO2020211629A1 - Short link message monitoring method and apparatus based on blockchain - Google Patents

Short link message monitoring method and apparatus based on blockchain Download PDF

Info

Publication number
WO2020211629A1
WO2020211629A1 PCT/CN2020/082201 CN2020082201W WO2020211629A1 WO 2020211629 A1 WO2020211629 A1 WO 2020211629A1 CN 2020082201 W CN2020082201 W CN 2020082201W WO 2020211629 A1 WO2020211629 A1 WO 2020211629A1
Authority
WO
WIPO (PCT)
Prior art keywords
monitoring
client
event message
message
monitor
Prior art date
Application number
PCT/CN2020/082201
Other languages
French (fr)
Chinese (zh)
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 WO2020211629A1 publication Critical patent/WO2020211629A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Definitions

  • the embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a method and device for monitoring short link messages based on a blockchain (Blockchain).
  • Fetech financial technology
  • Blockchain a method and device for monitoring short link messages based on a blockchain
  • the embodiment of the present invention provides a short link message monitoring method and device based on a block chain, which is used to distinguish the state of monitoring tasks, reduce the maintenance amount of the block chain node to the monitoring client, and improve the monitoring efficiency.
  • the embodiment of the present invention provides a method for monitoring short link messages based on blockchain, including:
  • the client management contract is used to manage the client that initiates event monitoring and the subject name of the monitoring;
  • the blockchain node when the blockchain node does not include the monitoring ID in the received monitoring request, it indicates that the current monitoring task is a new monitoring task, and the monitoring ID can be generated to distinguish between subsequent monitoring requests. Whether it is a new monitoring task or the continuation of the previous monitoring task, thereby reducing the amount of maintenance of the monitoring client by the blockchain node and improving the monitoring efficiency.
  • the method further includes:
  • the method further includes:
  • the second monitoring request includes the monitored topic name, the message push address, and the monitoring ID of the client; the second monitoring request is the client After not receiving the heartbeat information periodically sent by the blockchain node;
  • a second monitoring result is sent to the client and the client storing the event message respectively, and the second monitoring result includes the event message that continues to be monitored and all The monitoring ID.
  • the second monitoring request since the second monitoring request includes the monitoring ID, it indicates that this monitoring task is to continue the previous monitoring task, and there is no need to store the topic name and the monitoring ID, thereby reducing the amount of maintenance of the monitoring client by the blockchain node , Improve monitoring efficiency.
  • the determining the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring includes:
  • the method further includes:
  • the monitoring result is sent to the client.
  • an embodiment of the present invention also provides a short link message monitoring device based on a blockchain, including:
  • the obtaining unit is configured to obtain a first monitoring request sent by the client, where the first monitoring request includes the monitored topic name and the message push address;
  • the processing unit is used to generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through a client management contract;
  • the client management contract is used to manage the client that initiates event monitoring and The name of the monitored topic;
  • an event message and a first monitor ID are determined according to the topic name, where the first monitor ID is the monitor ID of the client that stores the event message;
  • the sending unit is configured to send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event message And the monitoring ID.
  • processing unit is further configured to:
  • the sending unit Control the sending unit to periodically send heartbeat information to the client.
  • the heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival status of the blockchain node .
  • processing unit is further configured to:
  • the acquiring unit is controlled to acquire a second monitoring request sent by the client, where the second monitoring request includes the monitored topic name and the message Push address and the listening ID of the client; the second listening request is sent after the client does not receive the heartbeat information periodically sent by the blockchain node;
  • Control the sending unit to send a second monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the second monitoring result includes the continued monitoring The event message and the monitoring ID.
  • processing unit is specifically configured to:
  • processing unit is further configured to:
  • the sending unit is controlled to send the monitoring result to the client.
  • an embodiment of the present invention also provides a computing device, including:
  • At least one memory for storing program instructions
  • At least one processor is configured to call program instructions stored in the memory, and execute the above-mentioned block chain-based short link message monitoring method according to the obtained program.
  • the embodiment of the present invention also provides a computer-readable non-volatile storage medium with a computer program stored thereon.
  • the computer reads and executes the computer program, the computer executes the above-mentioned blockchain-based Short link message monitoring method.
  • FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for monitoring short link messages based on blockchain according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another method for monitoring short link messages based on blockchain according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a short link message monitoring device based on a blockchain provided by an embodiment of the present invention.
  • Fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
  • FIG. 1 exemplarily shows a system architecture to which an embodiment of the present invention is applicable.
  • the system architecture may include multiple clients 100 and a blockchain system 200.
  • the client 100 is used to communicate with the blockchain system 200, send the generated data to the blockchain system 200 for storage, and monitor event information through the blockchain system 200.
  • the blockchain system 200 is composed of multiple blockchain nodes 210 that communicate with the client 100 to store the data sent by the client 100, and after receiving the client 100's listening request, feedback the monitoring result to the client 100 .
  • the multiple blockchain nodes 210 can be connected to each other for communication, and each blockchain node includes multiple blocks, and the blocks are used to store data that the client 100 needs to monitor.
  • FIG. 1 is only an example, which is not limited in the embodiment of the present invention.
  • FIG. 2 exemplarily shows the flow of a method for monitoring short link messages based on a blockchain provided by an embodiment of the present invention.
  • the flow can be executed by a short link message monitoring device based on blockchain.
  • the device may be a blockchain node in the blockchain system 200.
  • the following describes the process of short link message monitoring based on the blockchain by monitoring the client and notifying the client to interact with the blockchain node.
  • the process specifically includes:
  • Step 201 The monitoring client sends a first monitoring request to the blockchain node.
  • a listening client is a client that monitors event information, or it can be said to be a client that subscribes to event information.
  • the first listening request sent by the listening client may include the listening topic name (topicName) and the message push address.
  • the topic name is to be able to monitor event information corresponding to the topic name, and the message push address is to make the zone
  • the block chain node determines the event information corresponding to the topic name, it sends the event message to the listening client through the message push address.
  • the message push address can be a URL (Uniform Resource Locator, Uniform Resource Locator), or other links used for message push.
  • the listening client sends the first listening request, it can be sent to the blockchain node in the form of http body, that is to say, the first listening request is sent through a short link, such as https, jsonrpc and other short link access .
  • the subject name is the subject name of the monitoring event, such as transfer, transaction, repayment, etc.
  • step 202 the blockchain node generates the monitoring ID of the monitoring client, and stores the monitoring ID of the monitoring client and the subject name through the client management contract.
  • the blockchain node can generate the monitoring ID of the monitoring client.
  • a set of random numbers can be generated, for example, a 256-bit random number is generated through the Linux system.
  • the monitoring ID here can be referred to as subscribeID.
  • the client management contract is used to manage the client that initiates event monitoring and the subject name of the monitoring, as shown in Table 1.
  • the subject name of the event that the client A needs to monitor is transfer, that is, the blockchain node needs to feed back the monitoring result of the event message related to the transfer to the client.
  • the blockchain node When the blockchain node stores the monitoring ID and topic name of the monitoring client, it can be stored in the key (subscribeID) and value (topicName) data structure. Of course, it can also be stored in the data structure of a map, which is not specifically limited in the embodiment of the present invention.
  • Step 203 The blockchain node determines the event message and the first monitoring ID according to the subject name.
  • the blockchain node After the blockchain node stores the monitoring ID and topic name of the monitoring client through the client management contract, it can execute the monitoring task and monitor the event message corresponding to the topic name. Specifically, according to the topic name, the event messages related to the topic name in the block can be polled.
  • the blockchain node can also determine the monitoring ID of the client storing the event message, that is, the first monitoring ID, that is, the monitoring ID of the notification client. After receiving the storage message request sent by the notification client, the blockchain node stores the listening ID of the notification client.
  • Step 204 The blockchain node sends the monitoring result to the monitoring client and the notification client respectively.
  • step 203 after the blockchain node determines the event message, it can send the monitoring result to the monitoring client and the notification client.
  • the monitoring result may include the event message related to the topic name and the monitoring ID of the monitoring client.
  • the purpose of sending the monitoring ID of the monitoring client to the notification client is to notify the notification client who listened to its stored event messages.
  • the blockchain node may send the monitoring result to the monitoring client according to the message push address received in step 201, and send the monitoring result to the notification client according to the first monitoring ID.
  • the blockchain node can also periodically send heartbeat information to the monitoring client, the heartbeat information includes the monitored subject name and the monitoring ID of the monitoring client, so that the monitoring client can determine the survival of the blockchain node status.
  • the period of sending heartbeat information can be set based on experience.
  • the monitoring client When the monitoring client does not receive the heartbeat information in one cycle, it indicates that there is a problem with the blockchain node. At this time, the event monitoring request can be re-initiated.
  • the process shown in Figure 3 may include:
  • Step 301 The monitoring client sends a second monitoring request to the blockchain node.
  • the second monitoring request may include the name of the monitored topic, the message push address, and the monitoring ID of the monitoring client. By monitoring the client's monitoring ID, the blockchain node can know whether the current monitoring task is a new monitoring task or a continuing monitoring task.
  • the second monitoring request is sent after the monitoring client receives the periodically sent heartbeat information.
  • Step 302 The blockchain node determines the event message to continue monitoring according to the monitoring ID of the monitoring client and the subject name of the monitoring.
  • the blockchain node will monitor the client's monitor ID and the subject name of the monitor, and match it with the client management contract. If the match is successful, it indicates that the current monitoring task is to continue the previous monitoring task, so continue to monitor the event message, confirm The event message to continue monitoring is output. If the match is unsuccessful, it is determined that the monitoring has failed.
  • Step 303 The blockchain node sends the second monitoring result to the monitoring client and the notification client respectively.
  • the second monitoring result may include the event message related to the topic name and the monitoring ID of the monitoring client.
  • the purpose of sending the monitoring ID of the monitoring client to the notification client is to notify the notification client who listened to its stored event messages.
  • the blockchain node may send the second monitoring result to the monitoring client according to the message push address received in step 301, and send the second monitoring result to the notification client according to the first monitoring ID.
  • the embodiment of the present invention shows that the first listening request sent by the client is obtained, the first listening request includes the listening topic name and the message push address, the listening ID of the client is generated, and the listening ID and topic name of the client are combined through the client management contract.
  • the client management contract is used to manage the client that initiates event monitoring and the subject name of the listener.
  • the event message and the first listener ID are determined according to the subject name.
  • the first listener ID is the listener ID of the client that stores the event message.
  • the message push address and the first monitoring ID respectively send a first monitoring result to the client and the client storing the event message, and the first monitoring result includes the event message and the monitoring ID.
  • the blockchain node When the blockchain node does not include the monitoring ID in the received monitoring request, it indicates that the current monitoring task is a new monitoring task.
  • the monitoring ID can be generated to distinguish the new monitoring task when subsequent monitoring requests are received. Continue the previous monitoring task, thereby reducing the amount of maintenance of the blockchain node on the monitoring client and improving the monitoring efficiency.
  • monitoring client and notification client in the embodiment of the present invention may be one process on one machine, or may be different processes on multiple machines.
  • FIG. 4 exemplarily shows the structure of a block chain-based short link message monitoring device provided by an embodiment of the present invention, which can execute the process of block chain-based short link message monitoring .
  • the device may be the blockchain node 210 in the above-mentioned blockchain system 200.
  • the device specifically includes:
  • the obtaining unit 401 is configured to obtain a first monitoring request sent by a client, where the first monitoring request includes the monitored topic name and message push address;
  • the processing unit 402 is configured to generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through the client management contract; the client management contract is used to manage the client that initiates event monitoring And the subject name of the monitoring; determine the event message and the first monitoring ID according to the subject name, where the first monitoring ID is the monitoring ID of the client storing the event message;
  • the sending unit 403 is configured to send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event Message and the monitoring ID.
  • processing unit 402 is further configured to:
  • the heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival of the blockchain node status.
  • processing unit 402 is further configured to:
  • the acquiring unit 401 is controlled to acquire a second monitoring request sent by the client, where the second monitoring request includes the monitored subject name, The message push address and the listening ID of the client; the second listening request is sent after the client does not receive the heartbeat information periodically sent by the blockchain node;
  • the sending unit 403 is controlled to send a second monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the second monitoring result includes the continued The monitored event message and the monitoring ID.
  • processing unit 402 is specifically configured to:
  • processing unit 402 is further configured to:
  • the sending unit 403 is controlled to send the monitoring result to the client.
  • an embodiment of the present invention also provides a computing device, as shown in FIG. 5, including: a transceiver 501, a processor 502, and a memory 503, where:
  • the transceiver 501 may include baseband processing components, radio frequency processing components and other equipment according to actual needs, for transmitting relevant information;
  • the memory 503 stores one or more executable programs and is used to configure the processor 502;
  • the processor 502 is configured with one or more executable programs, and the one or more executable programs are used to execute the foregoing blockchain-based short link message monitoring method.
  • the embodiments of the present invention also provide a computer-readable non-volatile storage medium with a computer program stored thereon.
  • the computer can execute the foregoing Short link message monitoring method based on blockchain.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Abstract

Disclosed are a short link message monitoring method and apparatus based on a blockchain. The method comprises: acquiring a first monitoring request sent by a client, wherein the first monitoring request comprises a subject name for monitoring and a message pushing address; generating a monitoring ID of the client, and storing the monitoring ID of the client and the subject name by means of a client management contract; determining an event message and a first monitoring ID according to the subject name; and respectively sending, according to the message pushing address and the first monitoring ID, a first monitoring result to the client and a client storing the event message. When a received monitoring request does not comprise a monitoring ID, which indicates that this monitoring task is a new monitoring task, a blockchain node can generate a monitoring ID for distinguishing, when a monitoring request is subsequently received, whether same is a new monitoring task or a continuation of a previous monitoring task, such that the amount of maintenance of a monitoring client by the blockchain node is reduced, and the monitoring efficiency is improved.

Description

一种基于区块链的短链接消息监听方法及装置Method and device for monitoring short link messages based on blockchain
相关申请的交叉引用Cross references to related applications
本申请要求在2019年04月16日提交中国专利局、申请号为201910302089.X、申请名称为“一种基于区块链的短链接消息监听方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910302089.X, and the application name is "a method and device for monitoring short link messages based on blockchain" on April 16, 2019. The entire content is incorporated into this application by reference.
技术领域Technical field
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种基于区块链(Block Chain)的短链接消息监听方法及装置。The embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a method and device for monitoring short link messages based on a blockchain (Blockchain).
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Finteh)转变,区块链消息订阅技术也不例外,但由于金融、支付行业的安全性、实时性要求,也对技术提出的更高的要求。目前,客户端在根据主题名称以短链接的访问形式发起监听区块链中的事件消息时,区块链无法区别本次监听任务是新的监听任务还是之前的监听任务,此时会将每次监听任务的客户端会话进行存储维护,这将导致区块链节点需要维护繁多的客户端会话信息。With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming to Finteh. The blockchain news subscription technology is no exception, but due to the security of the financial and payment industries , Real-time requirements, but also higher requirements for technology. At present, when the client initiates the monitoring of event messages in the blockchain in the form of short link access based on the subject name, the blockchain cannot distinguish whether the current monitoring task is a new monitoring task or a previous monitoring task. The client session of this monitoring task is stored and maintained, which will cause the blockchain node to maintain a large amount of client session information.
发明内容Summary of the invention
本发明实施例提供一种基于区块链的短链接消息监听方法及装置,用以实区分监听任务的状态,降低区块链节点对监听客户端的维护量,提高监听效率。The embodiment of the present invention provides a short link message monitoring method and device based on a block chain, which is used to distinguish the state of monitoring tasks, reduce the maintenance amount of the block chain node to the monitoring client, and improve the monitoring efficiency.
本发明实施例提供的一种基于区块链的短链接消息监听方法,包括:The embodiment of the present invention provides a method for monitoring short link messages based on blockchain, including:
获取客户端发送的第一监听请求,所述第一监听请求包括监听的主题名称和消息推送地址;Acquiring a first monitoring request sent by the client, where the first monitoring request includes the name of the monitored topic and the message push address;
生成所述客户端的监听ID,并通过客户端管理合约将所述客户端的监听ID和所述主题名称进行存储;所述客户端管理合约用于管理发起事件监听的客户端以及监听的主题名称;Generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through a client management contract; the client management contract is used to manage the client that initiates event monitoring and the subject name of the monitoring;
根据所述主题名称确定出事件消息以及第一监听ID,所述第一监听ID为存储所述事件消息的客户端的监听ID;Determine the event message and the first monitoring ID according to the subject name, where the first monitoring ID is the monitoring ID of the client storing the event message;
根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第一监听结果,所述第一监听结果包括所述事件消息和所述监听ID。Send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event message and the monitoring ID .
上述技术方案中,区块链节点在接收到的监听请求中不包括监听ID时,表明本次监听任务为新的监听任务,可以通过生成监听ID,以用于在后续接收到监听请求时区别是新的监听任务还是继续之前的监听任务,从而降低区块链节点对监听客户端的维护量,提高监听效率。In the above technical solution, when the blockchain node does not include the monitoring ID in the received monitoring request, it indicates that the current monitoring task is a new monitoring task, and the monitoring ID can be generated to distinguish between subsequent monitoring requests. Whether it is a new monitoring task or the continuation of the previous monitoring task, thereby reducing the amount of maintenance of the monitoring client by the blockchain node and improving the monitoring efficiency.
可选的,所述方法还包括:Optionally, the method further includes:
周期性的向所述客户端发送心跳信息,所述心跳信息包括所述监听的主题名称和所述客户端的监听ID,以使所述客户端确定区块链节点的存活状态。Periodically send heartbeat information to the client, where the heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival state of the blockchain node.
可选的,在所述周期性的向所述客户端发送心跳信息之后,还包括:Optionally, after the periodically sending the heartbeat information to the client, the method further includes:
获取所述客户端发送的第二监听请求,所述第二监听请求包括所述监听的主题名称、所述消息推送地址和所述客户端的监听ID;所述第二监听请求是所述客户端未收到区块链节点周期性发送的所述心跳信息之后发送的;Acquire a second monitoring request sent by the client, the second monitoring request includes the monitored topic name, the message push address, and the monitoring ID of the client; the second monitoring request is the client After not receiving the heartbeat information periodically sent by the blockchain node;
根据所述客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息;Determine the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring;
根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第二监听结果,所述第二监听结果包括所述继续监听的事件消息和所述监听ID。According to the message push address and the first monitoring ID, a second monitoring result is sent to the client and the client storing the event message respectively, and the second monitoring result includes the event message that continues to be monitored and all The monitoring ID.
上述技术方案中,由于第二监听请求中包括监听ID,表明本次监听任务为继续之前的监听任务,不需要将主题名称和监听ID进行存储,从而降低区块链节点对监听客户端的维护量,提高监听效率。In the above technical solution, since the second monitoring request includes the monitoring ID, it indicates that this monitoring task is to continue the previous monitoring task, and there is no need to store the topic name and the monitoring ID, thereby reducing the amount of maintenance of the monitoring client by the blockchain node , Improve monitoring efficiency.
可选的,所述根据所述客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息,包括:Optionally, the determining the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring includes:
将所述客户端的监听ID和所述监听的主题名称与所述客户端管理合约进行匹配,若匹配成功,则继续进行所述事件消息的监听,确定出所述继续监听的事件消息;否则确定监听失败。Match the monitor ID of the client and the subject name of the monitor with the client management contract. If the match is successful, continue to monitor the event message to determine the event message to continue to monitor; otherwise, confirm Failed to monitor.
可选的,所述方法还包括:Optionally, the method further includes:
若所述第一监听ID与所述客户端的监听ID相同,则将所述监听结果发送给所述客户端。If the first monitoring ID is the same as the monitoring ID of the client, the monitoring result is sent to the client.
相应的,本发明实施例还提供了一种基于区块链的短链接消息监听装置,包括:Correspondingly, an embodiment of the present invention also provides a short link message monitoring device based on a blockchain, including:
获取单元,用于获取客户端发送的第一监听请求,所述第一监听请求包括监听的主题名称和消息推送地址;The obtaining unit is configured to obtain a first monitoring request sent by the client, where the first monitoring request includes the monitored topic name and the message push address;
处理单元,用于生成所述客户端的监听ID,并通过客户端管理合约将所述客户端的监听ID和所述主题名称进行存储;所述客户端管理合约用于管理发起事件监听的客户端以及监听的主题名称;根据所述主题名称确定出事件消息以及第一监听ID,所述第一监听ID为存储所述事件消息的客户端的监听ID;The processing unit is used to generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through a client management contract; the client management contract is used to manage the client that initiates event monitoring and The name of the monitored topic; an event message and a first monitor ID are determined according to the topic name, where the first monitor ID is the monitor ID of the client that stores the event message;
发送单元,用于根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第一监听结果,所述第一监听结果包括所述事件消息和所述监听ID。The sending unit is configured to send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event message And the monitoring ID.
可选的,所述处理单元还用于:Optionally, the processing unit is further configured to:
控制所述发送单元周期性的向所述客户端发送心跳信息,所述心跳信息包括所述监听的主题名称和所述客户端的监听ID,以使所述客户端确定区块链节点的存活状态。Control the sending unit to periodically send heartbeat information to the client. The heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival status of the blockchain node .
可选的,所述处理单元还用于:Optionally, the processing unit is further configured to:
在所述周期性的向所述客户端发送心跳信息之后,控制所述获取单元获取所述客户端发送的第二监听请求,所述第二监听请求包括所述监听的主题 名称、所述消息推送地址和所述客户端的监听ID;所述第二监听请求是所述客户端未收到区块链节点周期性发送的所述心跳信息之后发送的;After the periodic sending of heartbeat information to the client, the acquiring unit is controlled to acquire a second monitoring request sent by the client, where the second monitoring request includes the monitored topic name and the message Push address and the listening ID of the client; the second listening request is sent after the client does not receive the heartbeat information periodically sent by the blockchain node;
根据所述客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息;Determine the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring;
控制所述发送单元根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第二监听结果,所述第二监听结果包括所述继续监听的事件消息和所述监听ID。Control the sending unit to send a second monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the second monitoring result includes the continued monitoring The event message and the monitoring ID.
可选的,所述处理单元具体用于:Optionally, the processing unit is specifically configured to:
将所述客户端的监听ID和所述监听的主题名称与所述客户端管理合约进行匹配,若匹配成功,则继续进行所述事件消息的监听,确定出所述继续监听的事件消息;否则确定监听失败。Match the monitor ID of the client and the subject name of the monitor with the client management contract. If the match is successful, continue to monitor the event message to determine the event message to continue to monitor; otherwise, confirm Failed to monitor.
可选的,所述处理单元还用于:Optionally, the processing unit is further configured to:
若所述第一监听ID与所述客户端的监听ID相同,则控制所述发送单元将所述监听结果发送给所述客户端。If the first monitoring ID is the same as the monitoring ID of the client, the sending unit is controlled to send the monitoring result to the client.
相应的,本发明实施例还提供了一种计算设备,包括:Correspondingly, an embodiment of the present invention also provides a computing device, including:
至少一个存储器,用于存储程序指令;At least one memory for storing program instructions;
至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述基于区块链的短链接消息监听方法。At least one processor is configured to call program instructions stored in the memory, and execute the above-mentioned block chain-based short link message monitoring method according to the obtained program.
相应的,本发明实施例还提供了一种计算机可读非易失性存储介质,其上存储有计算机程序,当计算机读取并执行所述计算机程序时,使得计算机执行上述基于区块链的短链接消息监听方法。Correspondingly, the embodiment of the present invention also provides a computer-readable non-volatile storage medium with a computer program stored thereon. When the computer reads and executes the computer program, the computer executes the above-mentioned blockchain-based Short link message monitoring method.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative work, other drawings can be obtained from these drawings.
图1为本发明实施例提供的一种系统架构的示意图;FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present invention;
图2为本发明实施例提供的一种基于区块链的短链接消息监听方法的流程示意图;2 is a schematic flowchart of a method for monitoring short link messages based on blockchain according to an embodiment of the present invention;
图3为本发明实施例提供的另一种基于区块链的短链接消息监听方法的流程示意图;3 is a schematic flowchart of another method for monitoring short link messages based on blockchain according to an embodiment of the present invention;
图4为本发明实施例提供的一种基于区块链的短链接消息监听装置的结构示意图;4 is a schematic structural diagram of a short link message monitoring device based on a blockchain provided by an embodiment of the present invention;
图5为本发明实施例提供的一种计算设备的结构示意图。Fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
图1示例性的示出了本发明实施例所适用的一种系统架构,该系统架构可以包括多个客户端100和区块链系统200。FIG. 1 exemplarily shows a system architecture to which an embodiment of the present invention is applicable. The system architecture may include multiple clients 100 and a blockchain system 200.
其中,客户端100用于与区块链系统200进行通信,将产生的数据发送给区块链系统200进行存储,以及通过区块链系统200监控事件信息。The client 100 is used to communicate with the blockchain system 200, send the generated data to the blockchain system 200 for storage, and monitor event information through the blockchain system 200.
区块链系统200由多个区块链节点210,与客户端100进行通信,用于存储客户端100发送的数据,以及在收到客户端100的监听请求后,向客户端100反馈监听结果。该多个区块链节点210可以相互连接通信,每个区块链节点中包括多个区块,区块用于存储客户端100需要监听的数据。The blockchain system 200 is composed of multiple blockchain nodes 210 that communicate with the client 100 to store the data sent by the client 100, and after receiving the client 100's listening request, feedback the monitoring result to the client 100 . The multiple blockchain nodes 210 can be connected to each other for communication, and each blockchain node includes multiple blocks, and the blocks are used to store data that the client 100 needs to monitor.
需要说明的是,上述图1所示的结构仅是一种示例,本发明实施例对此不做限定。It should be noted that the structure shown in FIG. 1 is only an example, which is not limited in the embodiment of the present invention.
基于上述描述,图2示例性的示出了本发明实施例提供的一种基于区块链的短链接消息监听方法的流程,该流程可以由基于区块链的短链接消息监 听装置执行,该装置可以为区块链系统200中的区块链节点。下面将通过监听客户端、通知客户端与区块链节点交互的方式来描述基于区块链的短链接消息监听的流程。Based on the above description, FIG. 2 exemplarily shows the flow of a method for monitoring short link messages based on a blockchain provided by an embodiment of the present invention. The flow can be executed by a short link message monitoring device based on blockchain. The device may be a blockchain node in the blockchain system 200. The following describes the process of short link message monitoring based on the blockchain by monitoring the client and notifying the client to interact with the blockchain node.
如图2所示,该流程具体包括:As shown in Figure 2, the process specifically includes:
步骤201,监听客户端向区块链节点发送第一监听请求。Step 201: The monitoring client sends a first monitoring request to the blockchain node.
在本发明实施例中。监听客户端为监听事件信息的客户端,也可以说是订阅事件信息的客户端。该监听客户端发送的第一监听请求中可以包括监听的主题名称(topicName)和消息推送地址,该主题名称是为了能够监听与该主题名称相对应的事件信息,该消息推送地址是为了使得区块链节点在确定出与该主题名称相对应的事件信息之后,将事件消息通过该消息推送地址发送给监听客户端。In the embodiment of the present invention. A listening client is a client that monitors event information, or it can be said to be a client that subscribes to event information. The first listening request sent by the listening client may include the listening topic name (topicName) and the message push address. The topic name is to be able to monitor event information corresponding to the topic name, and the message push address is to make the zone After the block chain node determines the event information corresponding to the topic name, it sends the event message to the listening client through the message push address.
需要说明的是,该消息推送地址可以为URL(Uniform Resource Locator,统一资源定位符),也可以为其它用于消息推送的链接等。监听客户端在发送第一监听请求时,可以为以http的body形式发送到区块链节点上,也就是说是通过短链接的形式发送第一监听请求,例如https、jsonrpc等短链接形式访问。主题名称为监听事件的主题名称,例如转账、交易、还款等。It should be noted that the message push address can be a URL (Uniform Resource Locator, Uniform Resource Locator), or other links used for message push. When the listening client sends the first listening request, it can be sent to the blockchain node in the form of http body, that is to say, the first listening request is sent through a short link, such as https, jsonrpc and other short link access . The subject name is the subject name of the monitoring event, such as transfer, transaction, repayment, etc.
步骤202,区块链节点生成监听客户端的监听ID,并通过客户端管理合约将监听客户端的监听ID和所述主题名称进行存储。In step 202, the blockchain node generates the monitoring ID of the monitoring client, and stores the monitoring ID of the monitoring client and the subject name through the client management contract.
在上述步骤201中,区块链节点接收到监听客户端发送的第一监听请求之后,就可以生成监听客户端的监听ID。在生成监听ID时,可以为生成一组随机数,例如通过Linux系统生成256bit随机数。这里的监听ID可以简称subscribeID。In the above step 201, after receiving the first monitoring request sent by the monitoring client, the blockchain node can generate the monitoring ID of the monitoring client. When generating the monitoring ID, a set of random numbers can be generated, for example, a 256-bit random number is generated through the Linux system. The monitoring ID here can be referred to as subscribeID.
在本发明实施例中客户端管理合约用于管理发起事件监听的客户端以及监听的主题名称,如表1所示。In the embodiment of the present invention, the client management contract is used to manage the client that initiates event monitoring and the subject name of the monitoring, as shown in Table 1.
表1Table 1
监听客户端的监听IDThe listening ID of the listening client 主题名称Subject name
客户端AClient A 转账Transfer
客户端BClient B 消费consumption
客户端CClient C 还款Repayment
……... ……...
例如,客户端A需要监听的事件的主题名称为转账,也就是说,区块链节点需要向客户端反馈与转账相关的事件消息的监听结果。For example, the subject name of the event that the client A needs to monitor is transfer, that is, the blockchain node needs to feed back the monitoring result of the event message related to the transfer to the client.
区块链节点在存储监听客户端的监听ID和主题名称时,可以以key(subscribeID)、value(topicName)数据结构方式进行存储。当然,也可以通过map(图)的数据结构方式进行存储,本发明实施例对此不做具体限制。When the blockchain node stores the monitoring ID and topic name of the monitoring client, it can be stored in the key (subscribeID) and value (topicName) data structure. Of course, it can also be stored in the data structure of a map, which is not specifically limited in the embodiment of the present invention.
步骤203,区块链节点根据所述主题名称确定出事件消息以及第一监听ID。Step 203: The blockchain node determines the event message and the first monitoring ID according to the subject name.
区块链节点通过客户端管理合约将监听客户端的监听ID和主题名称进行存储之后,就可以执行监听任务,监听与该主题名称相对应的事件消息。具体的,可以根据主题名称,轮询区块中与该主题名称的相关的事件消息。After the blockchain node stores the monitoring ID and topic name of the monitoring client through the client management contract, it can execute the monitoring task and monitor the event message corresponding to the topic name. Specifically, according to the topic name, the event messages related to the topic name in the block can be polled.
在确定出事件消息的同时,区块链节点也可以确定出存储该事件消息的客户端的监听ID,即第一监听ID,也就是通知客户端的监听ID。区块链节点在接收到通知客户端发送的存储消息请求之后,将通知客户端的监听ID进行存储。While determining the event message, the blockchain node can also determine the monitoring ID of the client storing the event message, that is, the first monitoring ID, that is, the monitoring ID of the notification client. After receiving the storage message request sent by the notification client, the blockchain node stores the listening ID of the notification client.
步骤204,区块链节点分别向监听客户端和通知客户端发送监听结果。Step 204: The blockchain node sends the monitoring result to the monitoring client and the notification client respectively.
在步骤203中,当区块链节点确定出事件消息之后,就可以向监听客户端和通知客户端发送监听结果,该监听结果可以包括该主题名称相关的事件消息和监听客户端的监听ID。向通知客户端发送监听客户端的监听ID,是为了通知该通知客户端是谁监听了其存储的事件消息。In step 203, after the blockchain node determines the event message, it can send the monitoring result to the monitoring client and the notification client. The monitoring result may include the event message related to the topic name and the monitoring ID of the monitoring client. The purpose of sending the monitoring ID of the monitoring client to the notification client is to notify the notification client who listened to its stored event messages.
区块链节点可以根据上述步骤201中接收到的消息推送地址向监听客户端发送监听结果,根据上述第一监听ID向通知客户端发送监听结果。The blockchain node may send the monitoring result to the monitoring client according to the message push address received in step 201, and send the monitoring result to the notification client according to the first monitoring ID.
需要说明的是,当上述第一监听ID与监听客户端的监听ID相同时,只需要将监听结果发送给该监听客户端即可。这种情况表明,存储事件消息的客户端为该监听客户端。It should be noted that, when the above-mentioned first monitoring ID is the same as the monitoring ID of the monitoring client, only the monitoring result needs to be sent to the monitoring client. This situation indicates that the client storing the event message is the listening client.
可选的,区块链节点还可以周期性的向监听客户端发送心跳信息,该心 跳信息包括监听的主题名称和该监听客户端的监听ID,以使该监听客户端确定区块链节点的存活状态。其中,发送心跳信息的周期可以依据经验设置。Optionally, the blockchain node can also periodically send heartbeat information to the monitoring client, the heartbeat information includes the monitored subject name and the monitoring ID of the monitoring client, so that the monitoring client can determine the survival of the blockchain node status. Among them, the period of sending heartbeat information can be set based on experience.
当监听客户端未在一个周期接收到心跳信息,表明区块链节点出现问题,此时,可以重新发起事件监听请求。具体的,可以如图3所示的流程,包括:When the monitoring client does not receive the heartbeat information in one cycle, it indicates that there is a problem with the blockchain node. At this time, the event monitoring request can be re-initiated. Specifically, the process shown in Figure 3 may include:
步骤301,监听客户端向区块链节点发送第二监听请求。Step 301: The monitoring client sends a second monitoring request to the blockchain node.
该第二监听请求中可以包括监听的主题名称、消息推送地址和监听客户端的监听ID。通过监听客户端的监听ID可以使得区块链节点知道本次监听任务是新的监听任务还是继续监听任务。该第二监听请求是监听客户端收到周期性发送的所述心跳信息之后发送的。The second monitoring request may include the name of the monitored topic, the message push address, and the monitoring ID of the monitoring client. By monitoring the client's monitoring ID, the blockchain node can know whether the current monitoring task is a new monitoring task or a continuing monitoring task. The second monitoring request is sent after the monitoring client receives the periodically sent heartbeat information.
步骤302,区块链节点根据监听客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息。Step 302: The blockchain node determines the event message to continue monitoring according to the monitoring ID of the monitoring client and the subject name of the monitoring.
区块链节点将监听客户端的监听ID和监听的主题名称,与客户端管理合约进行匹配,若匹配成功,则表明本次监听任务是继续之前的监听任务,因此继续进行事件消息的监听,确定出继续监听的事件消息。若匹配不成功,则确定监听失败。The blockchain node will monitor the client's monitor ID and the subject name of the monitor, and match it with the client management contract. If the match is successful, it indicates that the current monitoring task is to continue the previous monitoring task, so continue to monitor the event message, confirm The event message to continue monitoring is output. If the match is unsuccessful, it is determined that the monitoring has failed.
步骤303,区块链节点分别向监听客户端和通知客户端发送第二监听结果。Step 303: The blockchain node sends the second monitoring result to the monitoring client and the notification client respectively.
该第二监听结果可以包括该主题名称相关的事件消息和监听客户端的监听ID。向通知客户端发送监听客户端的监听ID,是为了通知该通知客户端是谁监听了其存储的事件消息。The second monitoring result may include the event message related to the topic name and the monitoring ID of the monitoring client. The purpose of sending the monitoring ID of the monitoring client to the notification client is to notify the notification client who listened to its stored event messages.
区块链节点可以根据上述步骤301中接收到的消息推送地址向监听客户端发送第二监听结果,根据上述第一监听ID向通知客户端发送第二监听结果。The blockchain node may send the second monitoring result to the monitoring client according to the message push address received in step 301, and send the second monitoring result to the notification client according to the first monitoring ID.
需要说明的是,当上述第一监听ID与监听客户端的监听ID相同时,只需要将第二监听结果发送给该监听客户端即可。这种情况表明,存储事件消息的客户端为该监听客户端。It should be noted that when the first monitoring ID is the same as the monitoring ID of the monitoring client, only the second monitoring result needs to be sent to the monitoring client. This situation indicates that the client storing the event message is the listening client.
本发明实施例表明,获取客户端发送的第一监听请求,第一监听请求包括监听的主题名称和消息推送地址,生成客户端的监听ID,并通过客户端管理合约将客户端的监听ID和主题名称进行存储,客户端管理合约用于管理发 起事件监听的客户端以及监听的主题名称,根据主题名称确定出事件消息以及第一监听ID,第一监听ID为存储事件消息的客户端的监听ID,根据消息推送地址以及第一监听ID分别向客户端和存储事件消息的客户端发送第一监听结果,第一监听结果包括所述事件消息和所述监听ID。区块链节点在接收到的监听请求中不包括监听ID时,表明本次监听任务为新的监听任务,可以通过生成监听ID,以用于在后续接收到监听请求时区别是新的监听任务还是继续之前的监听任务,从而降低区块链节点对监听客户端的维护量,提高监听效率。The embodiment of the present invention shows that the first listening request sent by the client is obtained, the first listening request includes the listening topic name and the message push address, the listening ID of the client is generated, and the listening ID and topic name of the client are combined through the client management contract. For storage, the client management contract is used to manage the client that initiates event monitoring and the subject name of the listener. The event message and the first listener ID are determined according to the subject name. The first listener ID is the listener ID of the client that stores the event message. The message push address and the first monitoring ID respectively send a first monitoring result to the client and the client storing the event message, and the first monitoring result includes the event message and the monitoring ID. When the blockchain node does not include the monitoring ID in the received monitoring request, it indicates that the current monitoring task is a new monitoring task. The monitoring ID can be generated to distinguish the new monitoring task when subsequent monitoring requests are received. Continue the previous monitoring task, thereby reducing the amount of maintenance of the blockchain node on the monitoring client and improving the monitoring efficiency.
需要说明的是,本发明实施例中的监听客户端及通知客户端可以是一台机器上的一个进程,也可以是多台机器上的不同进程。It should be noted that the monitoring client and notification client in the embodiment of the present invention may be one process on one machine, or may be different processes on multiple machines.
基于相同的技术构思,图4示例性的示出了本发明实施例提供的一种基于区块链的短链接消息监听装置的结构,该装置可以执行基于区块链的短链接消息监听的流程。该装置可以为上述区块链系统200中的区块链节点210。Based on the same technical concept, FIG. 4 exemplarily shows the structure of a block chain-based short link message monitoring device provided by an embodiment of the present invention, which can execute the process of block chain-based short link message monitoring . The device may be the blockchain node 210 in the above-mentioned blockchain system 200.
如图4所示,该装置具体包括:As shown in Figure 4, the device specifically includes:
获取单元401,用于获取客户端发送的第一监听请求,所述第一监听请求包括监听的主题名称和消息推送地址;The obtaining unit 401 is configured to obtain a first monitoring request sent by a client, where the first monitoring request includes the monitored topic name and message push address;
处理单元402,用于生成所述客户端的监听ID,并通过客户端管理合约将所述客户端的监听ID和所述主题名称进行存储;所述客户端管理合约用于管理发起事件监听的客户端以及监听的主题名称;根据所述主题名称确定出事件消息以及第一监听ID,所述第一监听ID为存储所述事件消息的客户端的监听ID;The processing unit 402 is configured to generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through the client management contract; the client management contract is used to manage the client that initiates event monitoring And the subject name of the monitoring; determine the event message and the first monitoring ID according to the subject name, where the first monitoring ID is the monitoring ID of the client storing the event message;
发送单元403,用于根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第一监听结果,所述第一监听结果包括所述事件消息和所述监听ID。The sending unit 403 is configured to send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event Message and the monitoring ID.
可选的,所述处理单元402还用于:Optionally, the processing unit 402 is further configured to:
控制所述发送单元403周期性的向所述客户端发送心跳信息,所述心跳信息包括所述监听的主题名称和所述客户端的监听ID,以使所述客户端确定 区块链节点的存活状态。Control the sending unit 403 to periodically send heartbeat information to the client. The heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival of the blockchain node status.
可选的,所述处理单元402还用于:Optionally, the processing unit 402 is further configured to:
在所述周期性的向所述客户端发送心跳信息之后,控制所述获取单元401获取所述客户端发送的第二监听请求,所述第二监听请求包括所述监听的主题名称、所述消息推送地址和所述客户端的监听ID;所述第二监听请求是所述客户端未收到区块链节点周期性发送的所述心跳信息之后发送的;After the periodic sending of heartbeat information to the client, the acquiring unit 401 is controlled to acquire a second monitoring request sent by the client, where the second monitoring request includes the monitored subject name, The message push address and the listening ID of the client; the second listening request is sent after the client does not receive the heartbeat information periodically sent by the blockchain node;
根据所述客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息;Determine the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring;
控制所述发送单元403根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第二监听结果,所述第二监听结果包括所述继续监听的事件消息和所述监听ID。The sending unit 403 is controlled to send a second monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the second monitoring result includes the continued The monitored event message and the monitoring ID.
可选的,所述处理单元402具体用于:Optionally, the processing unit 402 is specifically configured to:
将所述客户端的监听ID和所述监听的主题名称与所述客户端管理合约进行匹配,若匹配成功,则继续进行所述事件消息的监听,确定出所述继续监听的事件消息;否则确定监听失败。Match the monitor ID of the client and the subject name of the monitor with the client management contract. If the match is successful, continue to monitor the event message to determine the event message to continue to monitor; otherwise, determine Failed to monitor.
可选的,所述处理单元402还用于:Optionally, the processing unit 402 is further configured to:
若所述第一监听ID与所述客户端的监听ID相同,则控制所述发送单元403将所述监听结果发送给所述客户端。If the first monitoring ID is the same as the monitoring ID of the client, the sending unit 403 is controlled to send the monitoring result to the client.
基于相同的技术构思,本发明实施例还提供了一种计算设备,如图5所示,包括:收发信机501、处理器502和存储器503,其中:Based on the same technical concept, an embodiment of the present invention also provides a computing device, as shown in FIG. 5, including: a transceiver 501, a processor 502, and a memory 503, where:
收发信机501根据实际需要可以包括基带处理部件、射频处理部件等设备,用于传输相关信息;The transceiver 501 may include baseband processing components, radio frequency processing components and other equipment according to actual needs, for transmitting relevant information;
存储器503,存储一个或多个可执行程序,被用于配置处理器502;The memory 503 stores one or more executable programs and is used to configure the processor 502;
处理器502,被配置了一个或多个可执行程序,所述一个或多个可执行程序用于执行上述基于区块链的短链接消息监听方法。The processor 502 is configured with one or more executable programs, and the one or more executable programs are used to execute the foregoing blockchain-based short link message monitoring method.
基于相同的技术构思,本发明实施例还提供了一种计算机可读非易失性存储介质,其上存储有计算机程序,当计算机读取并执行所述计算机可读程 序时,使得计算机执行上述基于区块链的短链接消息监听方法。Based on the same technical concept, the embodiments of the present invention also provide a computer-readable non-volatile storage medium with a computer program stored thereon. When the computer reads and executes the computer-readable program, the computer can execute the foregoing Short link message monitoring method based on blockchain.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。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, and 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (12)

  1. 一种基于区块链的短链接消息监听方法,其特征在于,包括:A method for monitoring short link messages based on blockchain, which is characterized in that it includes:
    获取客户端发送的第一监听请求,所述第一监听请求包括监听的主题名称和消息推送地址;Acquiring a first monitoring request sent by the client, where the first monitoring request includes the name of the monitored topic and the message push address;
    生成所述客户端的监听ID,并通过客户端管理合约将所述客户端的监听ID和所述主题名称进行存储;所述客户端管理合约用于管理发起事件监听的客户端以及监听的主题名称;Generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through a client management contract; the client management contract is used to manage the client that initiates event monitoring and the subject name of the monitoring;
    根据所述主题名称确定出事件消息以及第一监听ID,所述第一监听ID为存储所述事件消息的客户端的监听ID;Determine the event message and the first monitoring ID according to the subject name, where the first monitoring ID is the monitoring ID of the client storing the event message;
    根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第一监听结果,所述第一监听结果包括所述事件消息和所述监听ID。Send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event message and the monitoring ID .
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, wherein the method further comprises:
    周期性的向所述客户端发送心跳信息,所述心跳信息包括所述监听的主题名称和所述客户端的监听ID,以使所述客户端确定区块链节点的存活状态。Periodically send heartbeat information to the client, where the heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival state of the blockchain node.
  3. 如权利要求2所述的方法,其特征在于,在所述周期性的向所述客户端发送心跳信息之后,还包括:The method according to claim 2, wherein after the periodically sending the heartbeat information to the client, the method further comprises:
    获取所述客户端发送的第二监听请求,所述第二监听请求包括所述监听的主题名称、所述消息推送地址和所述客户端的监听ID;所述第二监听请求是所述客户端未收到区块链节点周期性发送的所述心跳信息之后发送的;Acquire a second monitoring request sent by the client, the second monitoring request includes the monitored topic name, the message push address, and the monitoring ID of the client; the second monitoring request is the client After not receiving the heartbeat information periodically sent by the blockchain node;
    根据所述客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息;Determine the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring;
    根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第二监听结果,所述第二监听结果包括所述继续监听的事件消息和所述监听ID。According to the message push address and the first monitoring ID, a second monitoring result is sent to the client and the client storing the event message respectively, and the second monitoring result includes the event message that continues to be monitored and all The monitoring ID.
  4. 如权利要求3所述的方法,其特征在于,所述根据所述客户端的监听 ID和所述监听的主题名称,确定出继续监听的事件消息,包括:The method of claim 3, wherein the determining the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring comprises:
    将所述客户端的监听ID和所述监听的主题名称与所述客户端管理合约进行匹配,若匹配成功,则继续进行所述事件消息的监听,确定出所述继续监听的事件消息;否则确定监听失败。Match the monitor ID of the client and the subject name of the monitor with the client management contract. If the match is successful, continue to monitor the event message to determine the event message to continue to monitor; otherwise, confirm Failed to monitor.
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    若所述第一监听ID与所述客户端的监听ID相同,则将所述监听结果发送给所述客户端。If the first monitoring ID is the same as the monitoring ID of the client, the monitoring result is sent to the client.
  6. 一种基于区块链的短链接消息监听装置,其特征在于,包括:A block chain-based short link message monitoring device is characterized in that it comprises:
    获取单元,用于获取客户端发送的第一监听请求,所述第一监听请求包括监听的主题名称和消息推送地址;The obtaining unit is configured to obtain a first monitoring request sent by the client, where the first monitoring request includes the monitored topic name and the message push address;
    处理单元,用于生成所述客户端的监听ID,并通过客户端管理合约将所述客户端的监听ID和所述主题名称进行存储;所述客户端管理合约用于管理发起事件监听的客户端以及监听的主题名称;根据所述主题名称确定出事件消息以及第一监听ID,所述第一监听ID为存储所述事件消息的客户端的监听ID;The processing unit is used to generate the monitoring ID of the client, and store the monitoring ID of the client and the subject name through a client management contract; the client management contract is used to manage the client that initiates event monitoring and The name of the monitored topic; an event message and a first monitor ID are determined according to the topic name, where the first monitor ID is the monitor ID of the client that stores the event message;
    发送单元,用于根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第一监听结果,所述第一监听结果包括所述事件消息和所述监听ID。The sending unit is configured to send a first monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the first monitoring result includes the event message And the monitoring ID.
  7. 如权利要求6所述的装置,其特征在于,所述处理单元还用于:The device according to claim 6, wherein the processing unit is further configured to:
    控制所述发送单元周期性的向所述客户端发送心跳信息,所述心跳信息包括所述监听的主题名称和所述客户端的监听ID,以使所述客户端确定区块链节点的存活状态。Control the sending unit to periodically send heartbeat information to the client. The heartbeat information includes the monitored topic name and the client's monitoring ID, so that the client can determine the survival status of the blockchain node .
  8. 如权利要求7所述的装置,其特征在于,所述处理单元还用于:The device according to claim 7, wherein the processing unit is further configured to:
    在所述周期性的向所述客户端发送心跳信息之后,控制所述获取单元获取所述客户端发送的第二监听请求,所述第二监听请求包括所述监听的主题名称、所述消息推送地址和所述客户端的监听ID;所述第二监听请求是所述客户端未收到区块链节点周期性发送的所述心跳信息之后发送的;After the periodic sending of heartbeat information to the client, the acquiring unit is controlled to acquire a second monitoring request sent by the client, where the second monitoring request includes the monitored topic name and the message Push address and the listening ID of the client; the second listening request is sent after the client does not receive the heartbeat information periodically sent by the blockchain node;
    根据所述客户端的监听ID和所述监听的主题名称,确定出继续监听的事件消息;Determine the event message to continue monitoring according to the monitoring ID of the client and the subject name of the monitoring;
    控制所述发送单元根据所述消息推送地址以及所述第一监听ID分别向所述客户端和存储所述事件消息的客户端发送第二监听结果,所述第二监听结果包括所述继续监听的事件消息和所述监听ID。Control the sending unit to send a second monitoring result to the client and the client storing the event message according to the message push address and the first monitoring ID, and the second monitoring result includes the continued monitoring The event message and the monitoring ID.
  9. 如权利要求8所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 8, wherein the processing unit is specifically configured to:
    将所述客户端的监听ID和所述监听的主题名称与所述客户端管理合约进行匹配,若匹配成功,则继续进行所述事件消息的监听,确定出所述继续监听的事件消息;否则确定监听失败。Match the monitor ID of the client and the subject name of the monitor with the client management contract. If the match is successful, continue to monitor the event message to determine the event message to continue to monitor; otherwise, confirm Failed to monitor.
  10. 如权利要求6至9任一项所述的装置,其特征在于,所述处理单元还用于:The device according to any one of claims 6 to 9, wherein the processing unit is further configured to:
    若所述第一监听ID与所述客户端的监听ID相同,则控制所述发送单元将所述监听结果发送给所述客户端。If the first monitoring ID is the same as the monitoring ID of the client, the sending unit is controlled to send the monitoring result to the client.
  11. 一种计算设备,其特征在于,包括:A computing device, characterized by comprising:
    至少一个存储器,用于存储程序指令;At least one memory for storing program instructions;
    至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至5任一项所述的方法。At least one processor is configured to call program instructions stored in the memory, and execute the method according to any one of claims 1 to 5 according to the obtained program.
  12. 一种计算机可读非易失性存储介质,其特征在于,所述计算机可读非易失性存储介质上存储有计算机程序,当计算机读取并执行所述计算机程序时,使得计算机执行如权利要求1至5任一项所述的方法。A computer-readable non-volatile storage medium is characterized in that a computer program is stored on the computer-readable non-volatile storage medium, and when the computer reads and executes the computer program, the computer executes the The method of any one of 1 to 5 is required.
PCT/CN2020/082201 2019-04-16 2020-03-30 Short link message monitoring method and apparatus based on blockchain WO2020211629A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910302089.X 2019-04-16
CN201910302089.XA CN110098979B (en) 2019-04-16 2019-04-16 Short link message monitoring method and device based on block chain

Publications (1)

Publication Number Publication Date
WO2020211629A1 true WO2020211629A1 (en) 2020-10-22

Family

ID=67444931

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/082201 WO2020211629A1 (en) 2019-04-16 2020-03-30 Short link message monitoring method and apparatus based on blockchain

Country Status (2)

Country Link
CN (1) CN110098979B (en)
WO (1) WO2020211629A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110098979B (en) * 2019-04-16 2023-04-14 深圳前海微众银行股份有限公司 Short link message monitoring method and device based on block chain
CN111294274A (en) * 2020-01-20 2020-06-16 北京砚棋科技有限公司 Data processing method, data processing device, computer readable medium, and application of data processing method
CN111355732B (en) * 2020-02-28 2021-06-11 腾讯科技(深圳)有限公司 Link detection method and device, electronic equipment and storage medium
CN111857798B (en) * 2020-06-30 2022-09-13 厦门亿联网络技术股份有限公司 Method for notifying configuration change of embedded equipment
CN113254306B (en) * 2021-05-10 2022-03-25 支付宝(杭州)信息技术有限公司 Running state monitoring method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503053A (en) * 2016-09-26 2017-03-15 江苏通付盾科技有限公司 UTXO querying methods and device
CN106991164A (en) * 2017-03-31 2017-07-28 北京京东金融科技控股有限公司 Method, device and electronic equipment that finance data is handled are used for based on block chain
US20180121923A1 (en) * 2015-06-18 2018-05-03 Coinplug, Inc. System and method for verifying forgery of financial institution proof documents on basis of block chain
CN108366105A (en) * 2018-01-30 2018-08-03 百度在线网络技术(北京)有限公司 Data access method, device, system and the computer-readable medium of transregional piece of chain
KR20180129027A (en) * 2017-05-24 2018-12-05 라온시큐어(주) Authentification methods and system based on programmable blockchain and one-id
CN110098979A (en) * 2019-04-16 2019-08-06 深圳前海微众银行股份有限公司 A kind of short link message monitor method and device based on block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052620B (en) * 2017-12-15 2021-02-12 泰康保险集团股份有限公司 Storage system of data state, node data processing system and method of block chain
CN108848119B (en) * 2018-04-03 2020-04-28 阿里巴巴集团控股有限公司 Cross-block-chain interaction method, device, system and electronic equipment
CN109102269B (en) * 2018-06-13 2022-03-22 湖南搜云网络科技股份有限公司 Transfer method and device based on block chain, block chain node and storage medium
CN109034832A (en) * 2018-06-13 2018-12-18 湖南搜云网络科技股份有限公司 The information processing method and device of block chain, information processing node and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180121923A1 (en) * 2015-06-18 2018-05-03 Coinplug, Inc. System and method for verifying forgery of financial institution proof documents on basis of block chain
CN106503053A (en) * 2016-09-26 2017-03-15 江苏通付盾科技有限公司 UTXO querying methods and device
CN106991164A (en) * 2017-03-31 2017-07-28 北京京东金融科技控股有限公司 Method, device and electronic equipment that finance data is handled are used for based on block chain
KR20180129027A (en) * 2017-05-24 2018-12-05 라온시큐어(주) Authentification methods and system based on programmable blockchain and one-id
CN108366105A (en) * 2018-01-30 2018-08-03 百度在线网络技术(北京)有限公司 Data access method, device, system and the computer-readable medium of transregional piece of chain
CN110098979A (en) * 2019-04-16 2019-08-06 深圳前海微众银行股份有限公司 A kind of short link message monitor method and device based on block chain

Also Published As

Publication number Publication date
CN110098979B (en) 2023-04-14
CN110098979A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
WO2020211629A1 (en) Short link message monitoring method and apparatus based on blockchain
US11580165B2 (en) Event producer system of a messaging platform for delivering real-time messages
US20140115044A1 (en) Stream processing using a client-server architecture
CN106817408B (en) Distributed server cluster scheduling method and device
CN111510474B (en) Data transmission method based on message middleware and related equipment
WO2021169674A1 (en) Processing method and apparatus for service data
CN105373420B (en) Data transmission method and device
CN106302090B (en) A kind of message treatment method, apparatus and system
CN110413424B (en) Configurable third-party message callback method, device, server and storage medium
WO2017066804A1 (en) Event driven subscription matching
US9104486B2 (en) Apparatuses, systems, and methods for distributed workload serialization
US10802896B2 (en) Rest gateway for messaging
CN113342503B (en) Real-time progress feedback method, device, equipment and storage medium
US20210334185A1 (en) Task based service management platform
WO2015117365A1 (en) Method, device and system for interacting hello packets
JP5329589B2 (en) Transaction processing system and operation method of transaction processing system
US8892746B2 (en) Asynchronous invocation mechanism in session initiation protocol (SIP) server clusters
WO2017032212A1 (en) Data stream processing method and apparatus
CN111917812B (en) Data transmission control method, device, equipment and storage medium
CN106790150B (en) Session maintaining method and device
DE112012002003B4 (en) Dealing with a loss of state in a subscription dialog according to the Session Initiation Protocol
US11563823B2 (en) Systems and methods for device connectivity management
CN107222550B (en) Server cluster processing system and method
JP2017120564A (en) Distributed computing system, broadcast station, server, and distributed computing method
CN110971669A (en) Message notification method, device, server, electronic equipment and readable storage medium

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: 20791957

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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 02/02/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20791957

Country of ref document: EP

Kind code of ref document: A1