WO2020207445A1 - 一种基于区块链的事件订阅方法及装置 - Google Patents
一种基于区块链的事件订阅方法及装置 Download PDFInfo
- Publication number
- WO2020207445A1 WO2020207445A1 PCT/CN2020/084028 CN2020084028W WO2020207445A1 WO 2020207445 A1 WO2020207445 A1 WO 2020207445A1 CN 2020084028 W CN2020084028 W CN 2020084028W WO 2020207445 A1 WO2020207445 A1 WO 2020207445A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- role
- sequence
- client
- key event
- event
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2457—Query processing with adaptation to user needs
- G06F16/24578—Query processing with adaptation to user needs using ranking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2462—Approximate or statistical queries
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2474—Sequence data queries, e.g. querying versioned data
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Definitions
- the embodiment of the present invention relates to the field of technology and finance technology, and in particular to a method and device for event subscription based on blockchain.
- a blockchain is a chain composed of a series of blocks. In addition to recording the data of this block, each block also records the Hash value of the previous block. In this way, a chain is formed.
- cryptography and the other is decentralization. Based on these two concepts, the historical information on the blockchain cannot be tampered with.
- a block is composed of a block header and a block body. The block header definition includes important fields such as the block height h and the hash value of the previous block.
- the block body mainly stores transaction data.
- the producer publishes a topic through the publishing interface, the topic includes the entire sequence of events, and the successfully published events will be permanently stored on the blockchain.
- consumers subscribe to the topic, they will receive the entire sequence of events on the topic. Perhaps not every event in this topic is of concern to consumers, so some information that consumers do not pay attention to will be returned, which will waste bandwidth and affect service speed.
- the embodiment of the present invention provides a blockchain-based event subscription. Method and device.
- an embodiment of the present invention provides a blockchain-based event subscription method, including:
- the key event sequence is determined by counting historical business information of different roles, including:
- For each role acquiring historical business information of the role, where the historical business information includes historical subscription events and the sequence between historical subscription events;
- it also includes:
- it also includes:
- an embodiment of the present invention provides a blockchain-based event subscription device, including:
- the receiving module is used to receive the subscription request sent by the client;
- the processing module is used to determine the target theme according to the subscription request, and determine all the key event sequences corresponding to the target theme and the role corresponding to each key event sequence, the key event sequence is based on statistics of historical business information of different roles definite;
- a query module configured to determine the target event sequence corresponding to the client from all key event sequences corresponding to the target theme according to the role corresponding to the client;
- the sending module is used to send the target event sequence to the client.
- processing module is specifically configured to:
- For each role acquiring historical business information of the role, where the historical business information includes historical subscription events and the sequence between historical subscription events;
- processing module is further used for:
- processing module is further used for:
- an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
- a computer program stored in the memory and capable of running on the processor.
- the processor executes the program, a blockchain-based The steps of the event subscription method.
- an embodiment of the present invention provides a computer-readable storage medium that stores a computer program executable by a computer device.
- the program runs on the computer device, the computer device executes a blockchain-based The steps of the event subscription method.
- an embodiment of the present invention provides a computer program product containing instructions.
- the computer program product includes a computing program stored on a non-transitory computer-readable storage medium.
- the computer program includes program instructions. When the instructions are executed by the computer, the computer executes the steps of the blockchain-based event subscription method.
- each target topic can include key event sequences corresponding to multiple roles.
- the client in the target topic can be determined according to the role of the client Corresponding key event sequence, and then send the key event sequence to the client, instead of sending the entire event sequence of the target topic to the client, so as to avoid returning some information that consumers don’t care about. This saves bandwidth and saves bandwidth. The speed of service can also be guaranteed during a surge.
- FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present invention.
- FIG. 2 is a schematic flowchart of a blockchain-based event subscription method provided by an embodiment of the present invention
- FIG. 3 is a schematic flowchart of a method for determining a sequence of key events provided by an embodiment of the present invention
- FIG. 4 is a schematic flowchart of another blockchain-based event subscription method provided by an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of a blockchain-based event subscription device provided by an embodiment of the present invention.
- Fig. 6 is a schematic diagram of a computer-based structure provided by an embodiment of the present invention.
- Event A change in the state of an object. For example, opening a door is an event, and closing a door is also an event.
- Topic The same type of event is a topic, and the topics are independent of each other.
- Subscribe to events Receive events from a specific topic.
- Producer The main body of the publishing event.
- Smart contract A piece of open and transparent code that runs on the blockchain.
- Event ID After each event is successfully published, there will be a unique ID within the subject area.
- Block chain is a chain composed of a series of blocks. In addition to recording the data of this block, each block also records the hash value of the previous block. In this way, a chain is formed.
- a block is composed of a block header and a block body.
- the block header definition includes important fields such as the block height h and the hash value of the previous block.
- the block body mainly stores transaction data.
- Node Each participant in the network is a node, and the node participates in network formation and data exchange.
- a node refers to a participant with a unique identity.
- the node has a complete copy of the ledger and has the ability to participate in the consensus and maintenance of the blockchain network.
- the blockchain-based event subscription method in the embodiment of the present invention can be applied to a blockchain scenario.
- the scenario includes a client 101, an intermediate server 102, a blockchain 103, and
- the client 104 and the client 101 may be a producer or a consumer.
- the client 101 When the client 101 is a producer, it can publish a topic to the intermediate server 102 through the Publish interface, or publish an event on a certain topic.
- the intermediate server 102 will verify whether the topic or event published by the client 101 is legal, and if it is legal, save the topic or event published by the client 101 in the blockchain 103.
- the client 101 is a consumer, it can subscribe to a topic from the intermediate server 102 through the Subscribe interface.
- the intermediate server 102 obtains the event on the topic from the blockchain 103 and sends the event on the topic happensed to client 101.
- the intermediate server 102 sends the new event to the client 101.
- the client 101 can provide users with corresponding services. For example, when the user needs to query an event, the client 104 sends a query request to the client 101.
- the query request carries the event ID, and the client 101 obtains the corresponding event according to the event ID.
- the intermediate server 102 can obtain the historical service information of the client 101, that is, the events that the client 104 inquired from the client 101 and the sequence of the inquired events.
- the intermediate server 102 obtains the role of the client 101 and the corresponding key event sequence by performing statistics on the historical business information of the client 101.
- the intermediate server 102 may be a server or a server cluster composed of several servers or a cloud computing center.
- the user terminal 104 is an electronic device with network communication capabilities, and the electronic device may be a smart phone, a tablet computer, or a portable personal computer.
- the client 101 is connected to the intermediate server 102 through a wireless network.
- the embodiment of the present invention provides a process of a blockchain-based event subscription method.
- the process of the method can be executed by a blockchain-based event subscription device.
- the event subscription device may be the intermediate server 102 shown in FIG. 1.
- Step 201 Receive a subscription request sent by the client.
- Step 202 Determine the target topic according to the subscription request, and determine all key event sequences corresponding to the target topic and the role corresponding to each key event sequence.
- the key event sequence is determined by counting historical business information of different roles. Different roles correspond to different businesses, so the events of concern will not be the same.
- the operator of the set airport publishes a theme M
- the theme M includes 6 events, namely:
- Event 1 check-in: passengers go through the check-in procedures and check their luggage.
- Event 2 security check: passengers enter/leave the security check area.
- Event 3 baggage handling: scan baggage at the security checkpoint and load the baggage into the container.
- Event 4 cabin door operation: the cabin door is opened, boarded, finally boarded, and closed.
- Event 5 flight operations: boarding gate, loading container, departure, takeoff.
- Event 6 customer service: review baggage for new flights.
- the role can be defined as a passenger, and the corresponding business is to provide passengers with information related to taking an airplane. Therefore, the events of greater concern are event 1, event 2, and event 3 in theme M.
- the role can be defined as an airline, and the corresponding business is to provide flight information for the airline. Therefore, the more concerned events are event 4, event 5 and event 6 in theme M.
- Step 203 Determine the target event sequence corresponding to the client from all the key event sequences corresponding to the target theme according to the role corresponding to the client.
- the role corresponding to the client can be determined first, and then all the key event sequences corresponding to the target topic are queried according to the role, and then the key event sequence matching the role is regarded as the target event sequence.
- the target theme includes two key event sequences, sequence 1 and sequence 2, where the role corresponding to sequence 1 is role A, and the role corresponding to sequence 2 is role B. If the role of the client is role A, then sequence 1 is used as the client's target event sequence.
- Step 204 Send the target event sequence to the client.
- each target topic can include key event sequences corresponding to multiple roles.
- the client in the target topic can be determined according to the role of the client Corresponding key event sequence, and then send the key event sequence to the client, instead of sending the entire event sequence of the target topic to the client, so as to avoid returning some information that consumers don’t care about. This saves bandwidth and saves bandwidth. The speed of service can also be guaranteed during a surge.
- Step 301 For each role, obtain historical business information of the role.
- the historical service information includes historical subscription events and the sequence between historical subscription events.
- the background role of the passenger APP is set to passengers, and the corresponding business is to provide passengers with information related to taking the plane. Therefore, historical business information includes at least the passenger's inquiries on ticketing, security, baggage handling and other events and queries on the passenger APP The sequence of events such as check-in, security check and baggage handling.
- set the role of the airline system to airlines, and the corresponding business is to provide airlines with flight information. Therefore, historical business information includes at least the airline's inquiries about cabin operations, flight operations, and customer services on the airline system. Events and query the sequence of events such as cabin door operations, flight operations, and customer service.
- Step 302 Perform frequency statistics on the sequence of historical subscription events to determine the key event sequence of the role.
- frequency statistics are performed on the order between historical subscription events, that is, the number of times the user first queries event 1 and then queries event 2.
- the frequency statistics of candidate order A and candidate order B are performed.
- candidate order A and candidate order B include corresponding historical subscription events. It should be noted that the specific implementation is not only for the above two The order for frequency statistics can also include other candidate orders.
- the statistical value of the frequency of passengers from query event 1 to query event 2 is 5, and the statistical value of the frequency of passengers from query event 2 to query event 3 is 3. Then, by calculating the sum of the statistical values of all orders, the total frequency statistical value of candidate order A is 8.
- the statistical value of the frequency of passengers from query event 4 to query event 5 is 1, and the statistical value of the frequency of passengers from query event 5 to query event 6 is 0. Then, by calculating the sum of the statistical values of all orders, the total frequency statistical value of candidate order B is 1.
- candidate sequence A can be determined as the key event sequence of the role (passenger), and then candidate sequence A and role (passenger) Save accordingly.
- frequency statistics are performed on candidate order A and candidate order B, specifically, for candidate order A: event 1 ⁇ event 2 ⁇ event 3.
- the statistical value of the frequency from query event 1 to query event 2 of the airline is 1, and the statistical value of frequency from query event 2 to query event 3 of the airline is 1. Then, by calculating the sum of the statistical values of all orders, the total frequency statistical value of candidate order A is 2.
- the statistical value of the frequency from query event 4 to query event 5 of the airline is 6, and the statistical value of frequency from query event 5 to query event 6 of the airline is 4. Then, by calculating the sum of the statistical values of all orders, the total frequency statistical value of candidate order B is 10.
- candidate sequence B can be determined as the key event sequence of the role (airline), and then candidate sequence B and role ( Airlines) corresponding to save.
- the key event sequence corresponding to each type of role is obtained. Therefore, when the client's subscription request is received, the key event sequence of the client is returned according to the role of the client, so as to achieve rapid response to the client And the effect of increasing the throughput of the entire system.
- the intermediate server may cache the key event sequence of each role. For example, for the theme M, when the intermediate server determines that the key event sequence of the role (passenger) is the candidate sequence A, it caches the candidate sequence A and the role (passenger) correspondingly. When the intermediate server determines that the key event sequence of the role (airline) is the candidate sequence B, it caches the candidate sequence B and the role (airline) correspondingly, and the topic M includes two cached key event sequences.
- the intermediate server When receiving the subscription request sent by the client, the intermediate server obtains the target event sequence corresponding to the client from all the key event sequences corresponding to the cached target topic according to the role of the client.
- the role of the client is a passenger, from the two key event sequences corresponding to the theme M in the cache, the key event sequence corresponding to the role (passenger) is determined to be the candidate sequence A.
- the role of the client is an airline, from the two key event sequences corresponding to the topic M in the cache, the key event sequence corresponding to the role (airline) is determined to be the candidate order B.
- the key event sequence corresponding to the role is cached locally, so when subsequent subscription requests sent by the client are received, you can directly The cached key event sequence is returned to the client, so that in the case of a surge in business, business pressure can be relieved in time and the normal and stable operation of the business can be guaranteed.
- the intermediate server may save the key event sequence of each role in the blockchain. For example, for theme M, when the intermediate server determines that the key event sequence of the role (passenger) is the candidate sequence A, the candidate sequence A and the role (passenger) are correspondingly saved in the blockchain. When the intermediate server determines that the key event sequence of the role (airline) is the candidate sequence B, the candidate sequence B and the role (airline) are correspondingly saved in the blockchain.
- the intermediate server When receiving the subscription request sent by the client, the intermediate server obtains the target event sequence corresponding to the client from all the key event sequences corresponding to the target topic stored in the blockchain according to the role of the client.
- the role of the client is a passenger
- the key event sequence corresponding to the role (passenger) is obtained from the blockchain, that is, candidate sequence A
- candidate sequence A is sent to the client as the target event sequence.
- the role of the client is an airline
- the key event sequence corresponding to the role (airline) is obtained from the blockchain, that is, candidate sequence B, and then candidate sequence B is sent to the client as the target event sequence.
- the roles and corresponding key event sequences saved in the blockchain can be shared with other institutions, so that other institutions do not need to re-analyze the roles and the events that the role focuses on, but directly pull them from the blockchain according to the role of the client. Take the corresponding key event sequence to bring convenience to other institutions.
- the method consists of client 1, server 1, blockchain, and server 2. Perform interactively with client 2. As shown in Figure 4, the method includes the following steps:
- the server 1 obtains historical service information of each role.
- the historical service information includes historical subscription events and the sequence between historical subscription events.
- the roles of consumers who subscribe to the topic can be defined.
- the roles of consumers who subscribe to topic N include role A and role B. If the service provided by the role A for the user is the service P, the historical service information when the role A provides the service P for the user is acquired. If the service provided by role B for the user is service Q, then obtain the historical service information when role B provides the user with service Q.
- the events corresponding to service P and service Q are different. Therefore, the historical subscription events and history of role A The order between subscription events is also different from the historical subscription events of role B and the order between historical subscription events.
- step 402 the server 1 performs frequency statistics on the sequence of historical subscription events, and determines the key event sequence of each role.
- the set theme N includes event 1, event 2, event 3, event 4, event 5, and event 6.
- the statistical value of the frequency of the user from query event 1 to query event 2 is 1, and the statistical value of the frequency of the user from query event 2 to query event 4 is 1.
- the statistical value of frequency from 4 to 6 is 0.
- the total frequency statistical value of sequence 2 is 2.
- sequence 1 can be determined as the key event sequence of character A.
- key event sequence of character B can be determined, assuming that the statistical result is that sequence 2 is the key event sequence of character B.
- step 403 the server 1 caches the role and the corresponding key event sequence.
- step 404 the server 1 saves the role and the corresponding key event sequence in the blockchain.
- the role A and sequence 1 are correspondingly saved in the blockchain, and the role B and sequence 2 are correspondingly saved in the blockchain.
- Step 405 The client 1 sends a first subscription request to the server 1.
- step 406 the server 1 determines all key event sequences corresponding to topic N and the role corresponding to each key event sequence from the cached data.
- the server 1 determines that the target topic is topic N according to the first subscription request, all key event sequences corresponding to topic N are sequence 1 and sequence 2, the role corresponding to sequence 1 is role A, and the role corresponding to sequence 2 is role B.
- step 407 the server 1 determines the target event sequence corresponding to the client 1 from all the key event sequences corresponding to the topic N according to the role corresponding to the client 1.
- sequence 1 is acquired as the target event sequence. If the role of client 1 is role B, sequence 2 is acquired as the target event sequence.
- Step 408 The server 1 sends the target event sequence corresponding to the client 1 to the client 1.
- Step 409 The client 2 sends a second subscription request to the server 2.
- step 410 the server 2 obtains the target event sequence corresponding to the client 2 from all the key event sequences corresponding to the target theme stored in the blockchain according to the role of the client 2.
- step 411 the blockchain returns the target event sequence corresponding to the client 2 to the server 2.
- sequence 1 is acquired as the target event sequence. If the role of client 2 is role B, sequence 2 is acquired as the target event sequence.
- step 412 the server 2 sends the target event sequence corresponding to the client 2 to the client 2.
- each target topic can include key event sequences corresponding to multiple roles.
- the client in the target topic can be determined according to the role of the client Corresponding key event sequence, and then send the key event sequence to the client, instead of sending the entire event sequence of the target topic to the client, so as to avoid returning some information that consumers don’t care about. This saves bandwidth and saves bandwidth. The speed of service can also be guaranteed during a surge.
- an embodiment of the present invention provides a blockchain-based event subscription device.
- the blockchain-based event subscription device 500 includes:
- the receiving module 501 is configured to receive a subscription request sent by the client;
- the processing module 502 is configured to determine the target topic according to the subscription request, and determine all the key event sequences corresponding to the target topic and the role corresponding to each key event sequence, the key event sequence is based on statistics of historical business of different roles Information confirmed;
- the query module 503 is configured to determine the target event sequence corresponding to the client from all the key event sequences corresponding to the target theme according to the role corresponding to the client;
- the sending module 504 is configured to send the target event sequence to the client.
- processing module 502 is specifically configured to:
- For each role acquiring historical business information of the role, where the historical business information includes historical subscription events and the sequence between historical subscription events;
- processing module 502 is further configured to:
- processing module 502 is further configured to:
- an embodiment of the present invention provides a computer device. As shown in FIG. 6, it includes at least one processor 601 and a memory 602 connected to the at least one processor.
- the embodiment of the present invention does not limit the processor.
- the connection between the processor 601 and the memory 602 in FIG. 6 is taken as an example.
- the bus can be divided into address bus, data bus, control bus, etc.
- the memory 602 stores instructions that can be executed by at least one processor 601. By executing the instructions stored in the memory 602, the at least one processor 601 can execute the aforementioned blockchain-based event subscription method. A step of.
- the processor 601 is the control center of the terminal device, which can use various interfaces and lines to connect to various parts of the terminal device, and subscribe to events by running or executing instructions stored in the memory 602 and calling data stored in the memory 602 .
- the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor.
- the application processor mainly processes the operating system, user interface, and application programs, etc.
- the adjustment processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 601.
- the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
- the processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
- the general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
- the memory 602 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
- the memory 602 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
- the memory 602 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
- the memory 602 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function, for storing program instructions and/or data.
- the embodiments of the present invention provide a computer-readable storage medium that stores a computer program executable by a computer device.
- the program runs on the computer device, the computer device executes a region-based The steps of the event subscription method of the blockchain.
- the embodiments of the present application provide a computer program product containing instructions
- the embodiments of the present invention provide a computer program product containing instructions.
- the computer program product includes storage on a non-transitory computer-readable storage medium
- the computer program includes program instructions that, when executed by a computer, cause the computer to execute the steps of the blockchain-based event subscription method.
- the embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- 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.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Probability & Statistics with Applications (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Transfer Between Computers (AREA)
Abstract
一种基于区块链的事件订阅方法及装置,涉及科技金融技术领域,该方法包括:中间服务器接收客户端发送的订阅请求,根据订阅请求确定目标主题对应的所有关键事件序列和每个关键事件序列对应的角色,关键事件序列是通过统计不同角色的历史业务信息确定的;根据客户端对应的角色从目标主题对应的所有关键事件序列中确定目标事件序列并发送至客户端。由于统计不同角色的历史业务信息确定关键事件序列,故接收到订阅请求时,可以根据客户端的角色确定客户端对应的关键事件序列并发送至客户端,而不是将整个事件序列发送至客户端,从而避免返回一些消费者不关注的信息,这样既节约了带宽,在订阅暴增时也可以保证服务速度。
Description
相关申请的交叉引用
本申请要求在2019年04月09日提交中国专利局、申请号为201910280096.4、申请名称为“一种基于区块链的事件订阅方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明实施例涉及科技金融技术领域,尤其涉及一种基于区块链的事件订阅方法及装置。
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Finteh)转变,区块链技术也不例外,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。区块链是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的Hash值,通过这种方式组成一条链。区块链的核心理念有两个,一个是密码学技术,另一个是去中心化思想,基于这两个理念做到区块链上的历史信息无法被篡改。一个区块由块头和块体组成,其中块头定义包括该区块高度h,上一个区块的Hash值等重要字段,而块体主要存储交易数据。生产者通过发布接口发布一个主题,主题中包括整个序列事件,发布成功的事件将永久存储在区块链上。消费者订阅了该主题时,将收到该主题整个序列事件。可能该主题中并不是每个事件都是消费者关注的,因此会返回一些消费者不关注的信息,从而既浪费带宽,又影响服务速度。
发明内容
由于消费者订阅主题时将收到主题整个的序列事件,导致消费者收到不 关注的信息,既浪费带宽又影响服务速度的问题,本发明实施例提供了一种基于区块链的事件订阅方法及装置。
一方面,本发明实施例提供了一种基于区块链的事件订阅方法,包括:
接收客户端发送的订阅请求;
根据所述订阅请求确定目标主题,并确定所述目标主题对应的所有关键事件序列和每个关键事件序列对应的角色,所述关键事件序列是通过统计不同角色的历史业务信息确定的;
根据所述客户端对应的角色从所述目标主题对应的所有关键事件序列中确定所述客户端对应的目标事件序列;
将所述目标事件序列发送至所述客户端。
可选地,所述关键事件序列是通过统计不同角色的历史业务信息确定的,包括:
针对每个角色,获取所述角色的历史业务信息,所述历史业务信息包括历史订阅事件以及历史订阅事件之间的次序;
对所述历史订阅事件之间的次序进行频率统计,确定所述角色的关键事件序列。
可选地,还包括:
将每个角色的关键事件序列保存至区块链中。
可选地,还包括:
将每个角色的关键事件序列进行缓存。
一方面,本发明实施例提供了一种基于区块链的事件订阅装置,包括:
接收模块,用于接收客户端发送的订阅请求;
处理模块,用于根据所述订阅请求确定目标主题,并确定所述目标主题对应的所有关键事件序列和每个关键事件序列对应的角色,所述关键事件序列是通过统计不同角色的历史业务信息确定的;
查询模块,用于根据所述客户端对应的角色从所述目标主题对应的所有关键事件序列中确定所述客户端对应的目标事件序列;
发送模块,用于将所述目标事件序列发送至所述客户端。
可选地,所述处理模块具体用于:
针对每个角色,获取所述角色的历史业务信息,所述历史业务信息包括历史订阅事件以及历史订阅事件之间的次序;
对所述历史订阅事件之间的次序进行频率统计,确定所述角色的关键事件序列。
可选地,所述处理模块还用于:
将每个角色的关键事件序列保存至区块链中。
可选地,所述处理模块还用于:
将每个角色的关键事件序列进行缓存。
一方面,本发明实施例提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现基于区块链的事件订阅方法的步骤。
一方面,本发明实施例提供了一种计算机可读存储介质,其存储有可由计算机设备执行的计算机程序,当所述程序在计算机设备上运行时,使得所述计算机设备执行基于区块链的事件订阅方法的步骤。
一方面,本发明实施例提供一种包含指令的计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使得计算机执行基于区块链的事件订阅方法的步骤。
由于预先统计不同角色的历史业务信息确定关键事件序列,故每个目标主题可以包括多个角色对应的关键事件序列,当接收到客户端的订阅请求时,可以根据客户端的角色确定目标主题中客户端对应的关键事件序列,然后将关键事件序列发送至客户端,而不需要将目标主题的整个事件序列发送至客户端,从而避免返回一些消费者不关注的信息,这样既节约了带宽,在订阅暴增时也可以保证服务速度。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种应用场景示意图;
图2为本发明实施例提供的一种基于区块链的事件订阅方法的流程示意图;
图3为本发明实施例提供的一种确定关键事件序列的方法的流程示意图;
图4为本发明实施例提供的另一种基于区块链的事件订阅方法的流程示意图;
图5为本发明实施例提供的一种基于区块链的事件订阅装置的结构示意图;
图6为本发明实施例提供的一种基于计算机设备的结构示意图。
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
为了方便理解,下面对本发明实施例中涉及的名词进行解释。
事件(Event):物体状态的一个变化,比如开门是一个事件,关门也是一个事件。
主题(Topic):同一类事件是一个主题,主题之间互相独立。
发布事件(Publish):将事件发送到特定的主题上。
订阅事件(Subscribe):从特定的主题上接收事件。
生产者(Producer):发布事件的主体。
消费者(Consumer):订阅事件的主体。
智能合约(Smart contract):在区块链上运行的一段公开,透明的代码。
事件ID(Event ID):每一个事件发布成功后会有一个在主题范围内的唯一ID。
区块链:区块链是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的Hash值,通过这种方式组成一条链。区块链的核心理念有两个,一个是密码学技术,另一个是去中心化思想,基于这两个理念做到区块链上的历史信息无法被篡改。一个区块由块头和块体组成,其中块头定义包括该区块高度h,上一个区块的Hash值等重要字段,而块体主要存储交易数据。
节点:网络中的每一个参与者就是一个节点,节点参与网络组建和数据交换。在区块链网络中,一个节点是指一个具有唯一身份的参与者,该节点具有一份完整的账本拷贝,具有参与区块链网络共识和账本维护的能力。
本发明实施例中的基于区块链的事件订阅方法可以应用于区块链场景中,示例性地,如图1所示,该场景中包括客户端101、中间服务器102、区块链103以及用户端104,客户端101可以是生产者,也可以是消费者。当客户端101为生产者时,可以通过Publish接口往中间服务器102中发布一个主题,或者在某个主题上发布一个事件。中间服务器102将校验客户端101发布的主题或事件是否合法,如果合法,将客户端101发布的主题或事件保存在区块链103中。当客户端101为消费者时,可以通过Subscribe接口从中间服务器102中订阅一个主题,当订阅成功时,中间服务器102从区块链103中获取该主题上的事件,并将该主题上的事件发生至客户端101。当生产者往该主题上发布一个新的事件时,中间服务器102将新的事件发送至客户端101。客户端101可以为用户提供对应的业务,比如用户在需要查询某个事件时,用户端104向客户端101发送查询请求,查询请求中携带事件ID,客户端101根据事件ID获取对应的事件并发送至用户端104。中间服务器102可以获取客户端101的历史业务信息,即用户端104向客户端101查询的事件以及查询事件的次序。中间服务器102通过对客户端101的历史业务信息进行统计, 获得客户端101的角色以及对应的关键事件序列。中间服务器102可以是一台服务器或若干台服务器组成的服务器集群或云计算中心等。用户端104是具备网络通信能力的电子设备,该电子设备可以是智能手机、平板电脑或便携式个人计算机等等。客户端101通过无线网络与中间服务器102连接。
基于图1所示的应用场景图,本发明实施例提供了一种基于区块链的事件订阅方法的流程,该方法的流程可以由基于区块链的事件订阅装置执行,基于区块链的事件订阅装置可以是图1所示的中间服务器102。
如图2所示,包括以下步骤:
步骤201,接收客户端发送的订阅请求。
步骤202,根据订阅请求确定目标主题,并确定目标主题对应的所有关键事件序列和每个关键事件序列对应的角色。
具体地,关键事件序列是通过统计不同角色的历史业务信息确定的。不同角色对应的业务不同,故关注的事件也不会相同。
示例性地,设定飞机场的运营商发布一个主题M,主题M中包括6个事件,分别为:
事件1,办票:乘客办理登记手续、检查行李。
事件2,安检:乘客进入/离开安检区。
事件3,行李处理:在安检站扫描行李、行李装入集装箱。
事件4,舱门操作:舱门打开、登机、最后登机、关闭。
事件5,航班操作:登机口、装载集装箱、出发、起飞。
事件6,客户服务:新航班复查行李。
对于乘客APP的后台来说,角色可以定义为乘客,对应的业务是为乘客提供乘坐飞机相关的信息,因此更关注的事件是主题M中的事件1、事件2和事件3。对于航空公司系统来说,角色可以定义为航空公司,对应的业务是为航空公司提供航班信息,因此更关注的事件是主题M中的事件4、事件5和事件6。
步骤203,根据客户端对应的角色从目标主题对应的所有关键事件序列中 确定客户端对应的目标事件序列。
当接收到客户端发送的订阅请求时,可以先确定客户端对应的角色,然后根据角色查询目标主题对应的所有关键事件序列,然后将与角色匹配的关键事件序列作为目标事件序列。比如,设定目标主题包括两个关键事件序列,分别为序列1和序列2,其中序列1对应的角色为角色A,序列2对应的角色为角色B。若客户端的角色为角色A,则将序列1作为客户端的目标事件序列。
步骤204,将目标事件序列发送至客户端。
由于预先统计不同角色的历史业务信息确定关键事件序列,故每个目标主题可以包括多个角色对应的关键事件序列,当接收到客户端的订阅请求时,可以根据客户端的角色确定目标主题中客户端对应的关键事件序列,然后将关键事件序列发送至客户端,而不需要将目标主题的整个事件序列发送至客户端,从而避免返回一些消费者不关注的信息,这样既节约了带宽,在订阅暴增时也可以保证服务速度。
下面具体介绍通过统计不同角色的历史业务信息确定关键事件序列的具体过程,如图3所示,包括以下步骤:
步骤301,针对每个角色,获取角色的历史业务信息。
具体地,历史业务信息包括历史订阅事件以及历史订阅事件之间的次序。比如,设定乘客APP的后台的角色为乘客,对应的业务是为乘客提供乘坐飞机相关的信息,因此,历史业务信息至少包括乘客在乘客APP上查询办票、安检、行李处理等事件以及查询办票、安检、行李处理等事件的次序。又比如,设定航空公司系统的角色为航空公司,对应的业务是为航空公司提供航班信息,因此,历史业务信息至少包括航空公司在航空公司系统上查询舱门操作、航班操作、客户服务等事件以及查询舱门操作、航班操作、客户服务等事件的次序。
步骤302,对历史订阅事件之间的次序进行频率统计,确定角色的关键事件序列。
具体地,对历史订阅事件之间的次序进行频率统计,即统计用户先查询 事件1,接着查询事件2的次数。示例性地,角色为乘客时,对候选次序A和候选次序B进行频率统计,候选次序A和候选次序B包括对应的历史订阅事件,需要说明的是,具体实施中并不只是针对上述两个次序进行频率统计,还可以包括其他的候选次序。
具体地,针对候选次序A:事件1→事件2→事件3。
通过统计乘客在乘客APP上的历史查询记录可知,乘客从查询事件1到查询事件2的频率统计值为5,乘客从查询事件2到查询事件3的频率统计值为3。然后计算所有次序的统计值之和可得候选次序A的总频率统计值为8。
针对候选次序B:事件4→事件5→事件6。
通过统计乘客在乘客APP上的历史查询记录可知,乘客从查询事件4到查询事件5的频率统计值为1,乘客从查询事件5到查询事件6的频率统计值为0。然后计算所有次序的统计值之和可得候选次序B的总频率统计值为1。
通过比较可知,对于角色为乘客的客户端来说,更关注的次序是候选次序A,因此可以将候选次序A确定为角色(乘客)的关键事件序列,然后将候选次序A以及角色(乘客)对应保存。
示例性地,角色为航空公司时,对候选次序A和候选次序B进行频率统计,具体地,针对候选次序A:事件1→事件2→事件3。
通过统计航空公司在航空公司系统中的历史查询记录可知,航空公司从查询事件1到查询事件2的频率统计值为1,航空公司从查询事件2到查询事件3的频率统计值为1。然后计算所有次序的统计值之和可得候选次序A的总频率统计值为2。
针对候选次序B:事件4→事件5→事件6。
通过统计航空公司在航空公司系统中的历史查询记录可知,航空公司从查询事件4到查询事件5的频率统计值为6,航空公司从查询事件5到查询事件6的频率统计值为4。然后计算所有次序的统计值之和可得候选次序B的总频率统计值为10。
通过比较可知,对于角色为航空公司的客户端来说,更关注的次序是候 选次序B,因此可以将候选次序B确定为角色(航空公司)的关键事件序列,然后将候选次序B以及角色(航空公司)对应保存。
通过对每类角色关注的事件序列进行统计分析,获得每类角色对应的关键事件序列,故在接收到客户端的订阅请求时,根据客户端的角色返回客户端的关键事件序列,从而达到快速响应客户端以及增加整个系统的吞吐量的效果。
在一种可能的实施方式中,中间服务器在确定每个角色的关键事件序列后,可以将每个角色的关键事件序列进行缓存。比如,针对主题M,中间服务器在确定角色(乘客)的关键事件序列为候选次序A时,将候选次序A以及角色(乘客)对应缓存。中间服务器在确定角色(航空公司)的关键事件序列为候选次序B时,将候选次序B以及角色(航空公司)对应缓存,主题M包括两个缓存的关键事件序列。
中间服务器在接收到客户端发送的订阅请求时,根据客户端的角色从缓存的目标主题对应的所有关键事件序列中,获得客户端对应的目标事件序列。示例性地,若客户端的角色为乘客,从缓存的主题M对应的两个关键事件序列中,确定角色(乘客)对应的关键事件序列为候选次序A。若客户端的角色为航空公司,从缓存的主题M对应的两个关键事件序列中,确定角色(航空公司)对应的关键事件序列为候选次序B。
由于对每类角色关注的事件序列进行统计分析,获得每类角色对应的关键事件序列后,将角色对应的关键事件序列缓存在本地,故后续接收到客户端发送的订阅请求时,可以直接将缓存的关键事件序列返回客户端,从而在业务暴增的情况下,可以及时缓解业务压力,保证业务正常稳定的运行。
在一种可能的实施方式中,中间服务器在确定每个角色的关键事件序列后,可以将每个角色的关键事件序列保存至区块链中。比如,针对主题M,中间服务器在确定角色(乘客)的关键事件序列为候选次序A时,将候选次序A以及角色(乘客)对应保存在区块链中。中间服务器在确定角色(航空公司)的关键事件序列为候选次序B时,将候选次序B以及角色(航空公司) 对应保存在区块链中。
中间服务器在接收到客户端发送的订阅请求时,根据客户端的角色从区块链保存的目标主题对应的所有关键事件序列中,获得客户端对应的目标事件序列。示例性地,若客户端的角色为乘客,从区块链中获得角色(乘客)对应的关键事件序列,即候选次序A,然后将候选次序A作为目标事件序列发送至客户端。若客户端的角色为航空公司,从区块链中获得角色(航空公司)对应的关键事件序列,即候选次序B,然后将候选次序B作为目标事件序列发送至客户端。
另外,区块链中保存的角色以及对应的关键事件序列可以共享给其他机构,使得其他机构不需要重新对角色以及角色关注的事件进行分析,而是直接按照客户端的角色从区块链中拉取对应的关键事件序列,从而为其他机构带来便利。
为了更好的解释本发明实施例,下面结合具体的实施场景描述本发明实施例提供的一种基于区块链的事件订阅方法,该方法由客户端1、服务器1、区块链、服务器2和客户端2交互执行,如图4所示,该方法包括以下步骤:
步骤401,服务器1获取每个角色的历史业务信息,历史业务信息包括历史订阅事件以及历史订阅事件之间的次序。
具体地,针对任意一个主题,可以定义订阅该主题的消费者的角色,比如,将订阅主题N的消费者的角色包括角色A和角色B。若角色A为用户提供的业务为业务P,则获取角色A为用户提供业务P时的历史业务信息。若角色B为用户提供的业务为业务Q,则获取角色B为用户提供业务Q时的历史业务信息,业务P和业务Q对应的事件是不相同的,因此,角色A的历史订阅事件以及历史订阅事件之间的次序与角色B的历史订阅事件以及历史订阅事件之间的次序也是不同的。
步骤402,服务器1对历史订阅事件之间的次序进行频率统计,确定每个角色的关键事件序列。
示例性地,设定主题N中包括事件1、事件2、事件3、事件4、事件5、 事件6。采用角色A的历史业务信息对序列1和序列2进行频率统计。
针对序列1:事件1→事件3→事件5→事件6。
通过统计角色A为用户提供业务P的历史记录可知,用户从查询事件1到查询事件3的频率统计值为5,用户从查询事件3到查询事件5的频率统计值为3,用户从查询事件5到查询事件6的频率统计值为1。然后计算所有次序的统计值之和可得序列1的总频率统计值为9。
针对序列2:事件1→事件2→事件4→事件6。
通过统计角色A为用户提供业务P的历史记录可知,用户从查询事件1到查询事件2的频率统计值为1,用户从查询事件2到查询事件4的频率统计值为1,用户从查询事件4到查询事件6的频率统计值为0。然后计算所有次序的统计值之和可得序列2的总频率统计值为2。
通过比较可知,对于角色A来说,更关注的次序是序列1,因此可以将序列1确定为角色A的关键事件序列。基于上述同样的方法可以确定角色B的关键事件序列,假设统计结果为序列2为角色B的关键事件序列。
步骤403,服务器1将角色以及对应的关键事件序列进行缓存。
将角色A和序列1对应缓存,将角色B和序列2对应缓存。
步骤404,服务器1将角色以及对应的关键事件序列保存至区块链中。
将角色A和序列1对应保存在区块链中,将角色B和序列2对应保存的区块链中。
步骤405,客户端1发送第一订阅请求至服务器1。
步骤406,服务器1从缓存的数据中,确定主题N对应的所有关键事件序列和每个关键事件序列对应的角色。
具体地,服务器1根据第一订阅请求确定目标主题为主题N,主题N对应的所有关键事件序列为序列1和序列2,序列1对应的角色为角色A,序列2对应的角色为角色B。
步骤407,服务器1根据客户端1对应的角色,从主题N对应的所有关键事件序列中确定客户端1对应的目标事件序列。
若客户端1的角色为角色A时,获取序列1作为目标事件序列。若客户端1的角色为角色B时,获取序列2作为目标事件序列。
步骤408,服务器1将客户端1对应的目标事件序列发送至客户端1。
步骤409,客户端2发送第二订阅请求至服务器2。
步骤410,服务器2根据客户端2的角色,从区块链保存的目标主题对应的所有关键事件序列中,获得客户端2对应的目标事件序列。
步骤411,区块链返回客户端2对应的目标事件序列至服务器2。
若客户端2的角色为角色A时,获取序列1作为目标事件序列。若客户端2的角色为角色B时,获取序列2作为目标事件序列。
步骤412,服务器2将客户端2对应的目标事件序列发送至客户端2。
由于预先统计不同角色的历史业务信息确定关键事件序列,故每个目标主题可以包括多个角色对应的关键事件序列,当接收到客户端的订阅请求时,可以根据客户端的角色确定目标主题中客户端对应的关键事件序列,然后将关键事件序列发送至客户端,而不需要将目标主题的整个事件序列发送至客户端,从而避免返回一些消费者不关注的信息,这样既节约了带宽,在订阅暴增时也可以保证服务速度。
基于相同的技术构思,本发明实施例提供了一种基于区块链的事件订阅装置,如图5所示,基于区块链的事件订阅装置500包括:
接收模块501,用于接收客户端发送的订阅请求;
处理模块502,用于根据所述订阅请求确定目标主题,并确定所述目标主题对应的所有关键事件序列和每个关键事件序列对应的角色,所述关键事件序列是通过统计不同角色的历史业务信息确定的;
查询模块503,用于根据所述客户端对应的角色从所述目标主题对应的所有关键事件序列中确定所述客户端对应的目标事件序列;
发送模块504,用于将所述目标事件序列发送至所述客户端。
可选地,所述处理模块502具体用于:
针对每个角色,获取所述角色的历史业务信息,所述历史业务信息包括 历史订阅事件以及历史订阅事件之间的次序;
对所述历史订阅事件之间的次序进行频率统计,确定所述角色的关键事件序列。
可选地,所述处理模块502还用于:
将每个角色的关键事件序列保存至区块链中。
可选地,所述处理模块502还用于:
将每个角色的关键事件序列进行缓存。
基于相同的技术构思,本发明实施例提供了一种计算机设备,如图6所示,包括至少一个处理器601,以及与至少一个处理器连接的存储器602,本发明实施例中不限定处理器601与存储器602之间的具体连接介质,图6中处理器601和存储器602之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。
在本发明实施例中,存储器602存储有可被至少一个处理器601执行的指令,至少一个处理器601通过执行存储器602存储的指令,可以执行前述的基于区块链的事件订阅方法中所包括的步骤。
其中,处理器601是终端设备的控制中心,可以利用各种接口和线路连接终端设备的各个部分,通过运行或执行存储在存储器602内的指令以及调用存储在存储器602内的数据,从而订阅事件。可选的,处理器601可包括一个或多个处理单元,处理器601可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器601中。在一些实施例中,处理器601和存储器602可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。
处理器601可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。 通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器602作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器602可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器602是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器602还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
基于相同的技术构思,本发明实施例提供了一种计算机可读存储介质,其存储有可由计算机设备执行的计算机程序,当所述程序在计算机设备上运行时,使得所述计算机设备执行基于区块链的事件订阅方法的步骤。
基于同一发明构思,本申请实施例提供一种包含指令的计算机程序产品,本发明实施例提供一种包含指令的计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使得计算机执行基于区块链的事件订阅方法的步骤。
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
Claims (11)
- 一种基于区块链的事件订阅方法,其特征在于,包括:接收客户端发送的订阅请求;根据所述订阅请求确定目标主题,并确定所述目标主题对应的所有关键事件序列和每个关键事件序列对应的角色,所述关键事件序列是通过统计不同角色的历史业务信息确定的;根据所述客户端对应的角色从所述目标主题对应的所有关键事件序列中确定所述客户端对应的目标事件序列;将所述目标事件序列发送至所述客户端。
- 如权利要求1所述的方法,其特征在于,所述关键事件序列是通过统计不同角色的历史业务信息确定的,包括:针对每个角色,获取所述角色的历史业务信息,所述历史业务信息包括历史订阅事件以及历史订阅事件之间的次序;对所述历史订阅事件之间的次序进行频率统计,确定所述角色的关键事件序列。
- 如权利要求2所述的方法,其特征在于,还包括:将每个角色的关键事件序列保存至区块链中。
- 如权利要求2所述的方法,其特征在于,还包括:将每个角色的关键事件序列进行缓存。
- 一种基于区块链的事件订阅装置,其特征在于,包括:接收模块,用于接收客户端发送的订阅请求;处理模块,用于根据所述订阅请求确定目标主题,并确定所述目标主题对应的所有关键事件序列和每个关键事件序列对应的角色,所述关键事件序列是通过统计不同角色的历史业务信息确定的;查询模块,用于根据所述客户端对应的角色从所述目标主题对应的所有关键事件序列中确定所述客户端对应的目标事件序列;发送模块,用于将所述目标事件序列发送至所述客户端。
- 如权利要求5所述的装置,其特征在于,所述处理模块具体用于:针对每个角色,获取所述角色的历史业务信息,所述历史业务信息包括历史订阅事件以及历史订阅事件之间的次序;对所述历史订阅事件之间的次序进行频率统计,确定所述角色的关键事件序列。
- 如权利要求6所述的装置,其特征在于,所述处理模块还用于:将每个角色的关键事件序列保存至区块链中。
- 如权利要求6所述的装置,其特征在于,所述处理模块还用于:将每个角色的关键事件序列进行缓存。
- 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1~4任一权利要求所述方法的步骤。
- 一种计算机可读存储介质,其特征在于,其存储有可由计算机设备执行的计算机程序,当所述程序在计算机设备上运行时,使得所述计算机设备执行权利要求1~4任一所述方法的步骤。
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1~4任一所述方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910280096.4 | 2019-04-09 | ||
| CN201910280096.4A CN110110269B (zh) | 2019-04-09 | 2019-04-09 | 一种基于区块链的事件订阅方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020207445A1 true WO2020207445A1 (zh) | 2020-10-15 |
Family
ID=67483979
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/084028 Ceased WO2020207445A1 (zh) | 2019-04-09 | 2020-04-09 | 一种基于区块链的事件订阅方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110110269B (zh) |
| WO (1) | WO2020207445A1 (zh) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112667905A (zh) * | 2020-12-31 | 2021-04-16 | 深圳赛安特技术服务有限公司 | 行为事件序列生成方法、装置、设备及存储介质 |
| CN113032704A (zh) * | 2021-02-24 | 2021-06-25 | 广州虎牙科技有限公司 | 数据处理方法、装置、电子设备及介质 |
| CN113297178A (zh) * | 2021-05-31 | 2021-08-24 | 中国民航信息网络股份有限公司 | 一种航空产品数据处理方法及相关设备 |
| CN114707058A (zh) * | 2022-03-11 | 2022-07-05 | 广州市影擎电子科技有限公司 | 一种基于vr影院的远程同步观影处理方法及系统 |
| CN116662396A (zh) * | 2022-02-17 | 2023-08-29 | 腾讯科技(深圳)有限公司 | 一种处理标识信息的方法、装置、设备及存储介质 |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110110269B (zh) * | 2019-04-09 | 2023-04-18 | 深圳前海微众银行股份有限公司 | 一种基于区块链的事件订阅方法及装置 |
| CN112765514A (zh) * | 2019-11-06 | 2021-05-07 | 腾讯科技(深圳)有限公司 | 一种监测网络舆情方法、装置及存储介质 |
| CN113573282B (zh) * | 2020-04-29 | 2022-09-16 | 中国电信股份有限公司 | 订阅数据的提供/获取方法、提供/获取装置和交互系统 |
| CN112016115B (zh) * | 2020-11-02 | 2021-02-05 | 中航信移动科技有限公司 | 基于区块链的事件订阅系统 |
| CN112559637B (zh) * | 2021-02-19 | 2021-06-18 | 腾讯科技(深圳)有限公司 | 基于分布式存储的数据处理方法、装置、设备以及介质 |
| CN115482008A (zh) * | 2021-06-16 | 2022-12-16 | 中移动信息技术有限公司 | Dapp交易确认方法及装置 |
| CN113591130B (zh) * | 2021-08-17 | 2025-06-20 | 腾讯科技(深圳)有限公司 | 基于区块链的数据处理方法、装置、电子设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107017992A (zh) * | 2017-03-29 | 2017-08-04 | 杭州秘猿科技有限公司 | 一种基于双链结构的高性能联盟区块链 |
| CN108932250A (zh) * | 2017-05-24 | 2018-12-04 | 北京京东尚科信息技术有限公司 | 用于数据处理的方法、设备、系统和计算机可读存储介质 |
| WO2019042754A1 (en) * | 2017-09-04 | 2019-03-07 | Siemens Aktiengesellschaft | DATA COMMUNICATION SYSTEM BASED ON A FILTER UNIT COMPRISING A BLOCK CHAIN PLATFORM |
| CN110110269A (zh) * | 2019-04-09 | 2019-08-09 | 深圳前海微众银行股份有限公司 | 一种基于区块链的事件订阅方法及装置 |
| CN110622488A (zh) * | 2019-03-27 | 2019-12-27 | 阿里巴巴集团控股有限公司 | 用于管理用户与区块链的交互的系统和方法 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101459908B (zh) * | 2007-12-13 | 2012-04-25 | 华为技术有限公司 | 一种业务订阅方法、系统、服务器 |
| US9402104B2 (en) * | 2010-07-30 | 2016-07-26 | Avaya Inc. | System and method for subscribing to events based on tag words |
| US20140310365A1 (en) * | 2012-01-31 | 2014-10-16 | Global Relay Communications Inc. | System and Method for Tracking Messages in a Messaging Service |
| CN103729461B (zh) * | 2014-01-12 | 2017-02-01 | 中国科学院软件研究所 | 一种基于历史记录数据挖掘的发布和订阅方法 |
| US9674127B2 (en) * | 2014-09-23 | 2017-06-06 | International Business Machines Corporation | Selective message republishing to subscriber subsets in a publish-subscribe model |
-
2019
- 2019-04-09 CN CN201910280096.4A patent/CN110110269B/zh active Active
-
2020
- 2020-04-09 WO PCT/CN2020/084028 patent/WO2020207445A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107017992A (zh) * | 2017-03-29 | 2017-08-04 | 杭州秘猿科技有限公司 | 一种基于双链结构的高性能联盟区块链 |
| CN108932250A (zh) * | 2017-05-24 | 2018-12-04 | 北京京东尚科信息技术有限公司 | 用于数据处理的方法、设备、系统和计算机可读存储介质 |
| WO2019042754A1 (en) * | 2017-09-04 | 2019-03-07 | Siemens Aktiengesellschaft | DATA COMMUNICATION SYSTEM BASED ON A FILTER UNIT COMPRISING A BLOCK CHAIN PLATFORM |
| CN110622488A (zh) * | 2019-03-27 | 2019-12-27 | 阿里巴巴集团控股有限公司 | 用于管理用户与区块链的交互的系统和方法 |
| CN110110269A (zh) * | 2019-04-09 | 2019-08-09 | 深圳前海微众银行股份有限公司 | 一种基于区块链的事件订阅方法及装置 |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112667905A (zh) * | 2020-12-31 | 2021-04-16 | 深圳赛安特技术服务有限公司 | 行为事件序列生成方法、装置、设备及存储介质 |
| CN113032704A (zh) * | 2021-02-24 | 2021-06-25 | 广州虎牙科技有限公司 | 数据处理方法、装置、电子设备及介质 |
| CN113297178A (zh) * | 2021-05-31 | 2021-08-24 | 中国民航信息网络股份有限公司 | 一种航空产品数据处理方法及相关设备 |
| CN113297178B (zh) * | 2021-05-31 | 2024-04-02 | 中国民航信息网络股份有限公司 | 一种航空产品数据处理方法及相关设备 |
| CN116662396A (zh) * | 2022-02-17 | 2023-08-29 | 腾讯科技(深圳)有限公司 | 一种处理标识信息的方法、装置、设备及存储介质 |
| CN114707058A (zh) * | 2022-03-11 | 2022-07-05 | 广州市影擎电子科技有限公司 | 一种基于vr影院的远程同步观影处理方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110110269A (zh) | 2019-08-09 |
| CN110110269B (zh) | 2023-04-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020207445A1 (zh) | 一种基于区块链的事件订阅方法及装置 | |
| US10891161B2 (en) | Method and device for virtual resource allocation, modeling, and data prediction | |
| US20220207606A1 (en) | Prediction of future occurrences of events using adaptively trained artificial-intelligence processes | |
| KR101939554B1 (ko) | 일시적 거래 한도 결정 | |
| WO2021203858A1 (zh) | 数据申请的系统安全控制方法、系统和计算机设备 | |
| CA3015566C (en) | Systems and methods for expediting rule-based data processing | |
| US11550999B2 (en) | Data management using topic modeling | |
| CN111091358A (zh) | 多支付渠道的统一处理方法及系统 | |
| CN112734352A (zh) | 一种基于数据维度的单据审核方法和装置 | |
| US12554690B2 (en) | Service chain for complex configuration-driven data quality rationalization and data control | |
| DE202023100540U1 (de) | Computergestützte Plattformen und Systeme für asynchrone parallele Netzwerkoperationen | |
| CN111414427B (zh) | 一种适用于准实时服务的数据处理方法及装置 | |
| US10454779B2 (en) | Adaptive learning system with a product configuration engine | |
| CN114418577A (zh) | 一种异常请求的识别方法、装置、电子设备及存储介质 | |
| US10872369B1 (en) | Systems and methods for providing intelligent electronic communications | |
| CN113095805A (zh) | 对象识别方法、装置、计算机系统及可读存储介质 | |
| CN113076297A (zh) | 一种数据处理方法、装置及存储介质 | |
| US20240311680A1 (en) | Machine-learning-based budget utilization predictor | |
| CN114218240B (zh) | 数据变更方法、装置、设备、介质和程序产品 | |
| CN116166879A (zh) | 分享业务处理方法、装置、计算机设备和存储介质 | |
| CN116860470A (zh) | 数据传输方法、装置、计算机设备和存储介质 | |
| CN116911411A (zh) | 一种网点预约系统和方法 | |
| US20220230238A1 (en) | System and method for assessing risk | |
| US12541789B2 (en) | Structuring a multi-segment operation | |
| US11790336B2 (en) | Intelligent distributed ledger consent optimizing apparatus for asset transfer |
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: 20786774 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 1205 DATED 21/01/2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20786774 Country of ref document: EP Kind code of ref document: A1 |