WO2021022714A1 - Message processing method for cross-block chain node, device, apparatus and medium - Google Patents

Message processing method for cross-block chain node, device, apparatus and medium Download PDF

Info

Publication number
WO2021022714A1
WO2021022714A1 PCT/CN2019/118085 CN2019118085W WO2021022714A1 WO 2021022714 A1 WO2021022714 A1 WO 2021022714A1 CN 2019118085 W CN2019118085 W CN 2019118085W WO 2021022714 A1 WO2021022714 A1 WO 2021022714A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
message
message queue
request
current
Prior art date
Application number
PCT/CN2019/118085
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 WO2021022714A1 publication Critical patent/WO2021022714A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to a message processing method across blockchain nodes, a message processing device across blockchain nodes, electronic equipment, and computer-readable storage media.
  • Blockchain technology distributed ledger technology
  • distributed ledger technology is a decentralized distributed database technology with many characteristics such as openness, transparency, non-tampering, and trustworthiness.
  • a blockchain node when a blockchain node processes a message queue, it usually starts a long connection process for processing. When a pending message is detected in the message queue, the message is processed. When a large number of messages enter the message queue at the same time, the messages in the message queue can be processed one by one through the long connection process.
  • the startup blockchain node will be set as the "current node” by default, and the input/output program (input/output, referred to as IO program) will use the "current node” to update the file
  • IO program input/output program
  • the node label field that is, regardless of the blockchain node that initiates the request message to the front-end server, the node label of the blockchain node that initiated the persistent connection process is always marked when the file is updated. Therefore, this MQ (message The queue) persistent connection scheme is only applicable to those cases where the requesting blockchain node that initiates the message is consistent with the blockchain node that initiates the persistent connection process.
  • the purpose of the embodiments of the present disclosure is to provide a cross-blockchain node message processing method and related equipment, so as to overcome at least to a certain extent the nodes in the prior art that request nodes to change and cannot update files when the long connection process processes the message queue.
  • the label field and node handle capacity is limited.
  • a message processing method across blockchain nodes includes: starting a message queue monitoring process according to a starting node in the blockchain, and creating a corresponding node index area through the message queue monitoring process; Obtain the current message in the message queue of the blockchain node through the message queue monitoring process; obtain the target parameter of the current message according to the node index area, so as to obtain the target parameter according to the target parameter and the corresponding current message
  • the request node configures the node attributes of the message queue monitoring process; the node label field of the target file corresponding to the request node is updated through the node attributes of the message queue monitoring process, so as to process the request node through the message queue monitoring process The current message in.
  • a message processing device across blockchain nodes including: a startup unit configured to start a message queue monitoring process according to the startup node in the blockchain, and create a corresponding message queue monitoring process through the message queue monitoring process The node index area of the node; an obtaining unit configured to obtain the current message in the message queue of the blockchain node through the message queue monitoring process; a modification unit configured to obtain the target of the current message according to the node index area Parameter to configure the node attribute of the message queue monitoring process according to the target parameter and the request node corresponding to the current message; the processing unit is configured to update the node attribute of the request node through the node attribute of the message queue monitoring process The node label field of the target file is used to process the current message in the requesting node through the message queue monitoring process.
  • an electronic device including: a processor; and a memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the above-mentioned cross-blockchain is implemented The node's message processing method.
  • a computer non-volatile readable storage medium on which a computer program is stored, and the computer program, when executed by a processor, realizes the message processing across blockchain nodes according to any one of the above method.
  • the technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: through the method of the present disclosure, on the one hand, the target parameter of the current message is obtained in the node index area and the corresponding system interface is called through the target parameter to pass the request node corresponding to the current message
  • the node attribute configuration of the startup node avoids the problem that the requested blockchain node and the blockchain node that initiates the long connection process must be consistent, and improves the efficiency of processing the message queue in the long connection process; on the other hand, it realizes the processing of the long connection process In the message queue, the node label field of the file can be updated correctly even if the requesting node changes; on the other hand, by creating a node index area to store nodes and node handles, the node handles of the same node can be reused, which solves the limited capacity of node handles The problem.
  • Fig. 1 schematically shows a schematic diagram of a cross-blockchain interaction system according to some embodiments of the present disclosure
  • Fig. 2 shows a schematic diagram of a message processing method across blockchain nodes according to some embodiments of the present disclosure
  • Figure 3 shows a schematic diagram of a message processing flow across blockchain nodes according to some embodiments of the present disclosure
  • Fig. 4 shows a schematic diagram of a message processing device across blockchain nodes according to some embodiments of the present disclosure
  • Fig. 5 shows a schematic structural diagram of a computer system of an electronic device according to some embodiments of the present disclosure
  • Fig. 6 schematically shows a schematic diagram of a computer non-volatile readable storage medium according to some embodiments of the present disclosure.
  • Fig. 1 shows a schematic diagram of a cross-blockchain interaction system according to some embodiments of the present disclosure.
  • the subscription client corresponds to a blockchain node in the first blockchain, and is used to maintain a message queue corresponding to the blockchain node, and the message queue contains messages subscribed by the blockchain node.
  • the publishing client corresponds to the second blockchain and is used to obtain and publish messages generated by the second blockchain.
  • the cross-chain interaction terminal (cross-chain interaction terminal 1, cross-chain interaction terminal 2) is used to obtain the subscription conditions of the blockchain nodes in the first blockchain, and when the end of the message queue contains messages that meet the subscription conditions, the The publishing client requests a message that meets the subscription condition and sends it to the subscribing client to update it in the message queue, so that the blockchain node in the first blockchain can pull the message from the message queue.
  • the blockchain node subscribing to the client processes the message queue (MQ), it usually starts a long connection process for processing.
  • MQ message queue
  • the message is processed.
  • the messages in the message queue can be processed one by one through the long connection process.
  • the startup blockchain node is set as the "current node” by default when the persistent connection process is started, the input/output program (Input/Output, referred to as IO program) will use the "current node” to update the node label field of the file , That is, regardless of the blockchain node that initiates the request message to the front-end server, it is always set to the node label of the blockchain node that initiated the long connection process when the file is updated. Therefore, this message queue long connection scheme is only suitable for configuration The case where the requesting blockchain node that initiates the message is consistent with the blockchain node that initiated the long connection process.
  • the method for processing messages across blockchain nodes may include the following steps:
  • step S210 a message queue monitoring process is started according to the start node in the blockchain, and a corresponding node index area is created through the message queue monitoring process.
  • the startup node may refer to the node corresponding to the message queue monitoring process in the blockchain.
  • the startup node may be a client in the blockchain.
  • the blockchain node may correspond to the first zone.
  • the message queue monitoring process can refer to a process configured to monitor and process messages in the message queue.
  • the message queue monitoring process can be a long connection process.
  • starting a message queue monitoring process can be a long connection process corresponding to the message queue. .
  • the long connection process is relative to the short connection process, that is, the long connection process can continuously monitor the message queue. Once unprocessed messages are found, they will be taken out and processed until the messages in the message queue are processed. .
  • the message queue monitoring process may also be a short connection process, and a message queue monitoring process to be started may be one or more short connection processes corresponding to the message queue.
  • the short connection process is a processing process generated separately for a certain message, and it terminates after processing the message.
  • the node index area is used to store the correspondence between the request node of the message in the message queue and the node handle corresponding to the request node.
  • the node index area can be understood as a memory area.
  • step S210 includes: obtaining a preset system interface based on the message queue monitoring process; creating a corresponding node index area according to the system interface, wherein the node index area is configured to store the current message in the message queue The corresponding relationship between the request node and the node handle of the request node.
  • the system interface can be pre-stored in the storage device of the client corresponding to the startup node, or can be configured by the developer. After the system starts the message queue monitoring process on the node, it calls the system interface through the message queue monitoring process and creates a node index area through the system interface.
  • Requesting node A can create a node handle A
  • the requesting node B can create a node handle B correspondingly, and the corresponding relations between the requesting node A and the node handle A, and the requesting node B and the node handle B are respectively stored in the node index area.
  • step S220 the current message in the message queue of the blockchain node is obtained through the message queue monitoring process.
  • the current message refers to the message to be processed with the logical position at the top in the message queue, that is, the current message is not a fixed message, but changes dynamically.
  • a message queue has messages to be processed A, message B to be processed, and message C to be processed in order of priority.
  • the logical position of message A to be processed in the message queue is at the top. Therefore, it is considered that message A to be processed is Current message;
  • pending message C is at the top of the logical position in the message queue, so it is considered pending message C Is the current message.
  • Step S220 further includes: sorting the messages to be processed in the message queue according to preset rules to generate a sequence list; and obtaining the current messages in the message queue in sequence according to the sequence list through the message queue monitoring process.
  • the preset rule may refer to a rule set by the user in advance for sorting messages to be processed, such as the priority of messages to be processed in a message queue, or the order in which messages enter the message queue.
  • the messages to be processed in the message queue are sorted and processed according to preset rules (the persistent connection process can only process the messages in the message queue one by one), for example, the messages to be processed are processed according to the priority of the message to be processed. Of course, you can also directly process the messages one by one according to the order in which the messages to be processed enter the message queue.
  • the message queue monitoring process obtains the current message in the generated sequence list or obtains the current message according to the time sequence when the message to be processed enters the message queue.
  • step S230 the target parameter of the current message is obtained according to the node index area, and the corresponding system interface is called according to the target parameter to configure the startup node through the node attribute of the request node corresponding to the current message.
  • the target parameter refers to the input parameter that is associated with the current message and is configured to call the system interface, such as the node handle corresponding to the request node of the current message, or the request node of the current message (get it through the request node of the current message in the node index Corresponding node handle, and then take the node handle as the input parameter of calling the system interface).
  • the node attributes include at least one attribute information such as the name of the node, the value of the node, and the type of the node.
  • the system can allocate computing resources and other services to the node according to the node attribute.
  • the message queue monitoring process calls the corresponding system interface according to the target parameter, and the system interface configures the startup node through the node attribute of the request node corresponding to the current message.
  • the system uses the startup node in the blockchain to start a long connection process for message processing.
  • the messages in the message queue can be processed one by one through the long connection process.
  • the persistent connection process will set the startup node as the "current node” by default when the startup node is started, the IO program will use the "current node” to update the node label field of the file.
  • the persistent connection process will process the current message of the requesting node at the start node. Due to inconsistent node attributes, the persistent connection process may fail to process the current message or reduce the efficiency of processing the message.
  • the node attribute of the node updates the node label field in the target file corresponding to the request node to process the current message in the request node by starting the message queue monitoring process in the node.
  • the previous message may refer to a message that has been processed by the message queue monitoring process and is adjacent to the position of the current message in the message queue. For example, a message queue has pending message A, pending message B, and pending message C arranged in priority order. At this time, pending message A is the current message.
  • the target file may refer to the compiled code corresponding to the requested node, and the node label field is stored in the target file.
  • the node label field can include node attribute value, node label name, etc. According to the node attribute of the message queue monitoring process, changing the node label field of the target file of the request node can enable the start node and current message of the persistent connection process started by the message queue monitoring process. The request nodes are kept consistent, so that the long connection process can better process the current message.
  • the node attribute of the current node is considered to be the same as the node attribute of the previous message, so there is no need to monitor the message queue
  • the node attribute of the starting node corresponding to the process is updated, the node label field in the target file corresponding to the request node is directly updated through the node attribute of the starting node, and the current message in the request node is processed through the message queue monitoring process in the starting node.
  • the message queue monitoring process determines that the request node of the current message and the request node of the previous message in the message queue are not the same node, then it is considered that the node attributes of the request node of the current message and the request node of the previous message are different, Therefore, when processing the current message, it is first necessary to update the node attributes corresponding to the startup node corresponding to the message queue monitoring process. Therefore, the message queue monitoring process takes the request node of the current message as the target parameter (input parameter), calls the corresponding system interface to access the node index area to obtain the node handle of the current message request node, and calls the corresponding system interface according to the node handle.
  • the target parameter input parameter
  • Get the node attribute of the request node of the current message and configure the startup node through the node attribute of the request node, and then update the node label field in the target file corresponding to the request node through the node attribute of the startup node to pass the message queue in the startup node
  • the monitoring process processes the current message in the request node.
  • the message queue monitoring process determines whether there is a node handle corresponding to the request node of the current message in the node index area; if it is determined that there is a node handle corresponding to the request node of the current message in the node index area, the current message is directly obtained from the node index area.
  • the node handle corresponding to the request node of the message, and the request node of the current message (which may include node attributes) according to the node handle corresponding to the request node of the current message, and configure the message queue monitoring process corresponding to the node attribute of the request node of the current message Start the node so that the message queue monitoring process can correctly process the current messages in the message queue, and improve the efficiency of message processing.
  • the request node of the current message is used as the target parameter (input parameter), and the corresponding system interface is called to create a request for the current message.
  • the node handle corresponding to the node, and the node handle is stored in the node index area. Create a node handle corresponding to the request node of the current message that does not exist in the original node index area by calling the corresponding system interface in the node index area, and continuously improve the node index area to facilitate subsequent processing of messages of the same request node, and further improve the message processing effectiveness.
  • step S240 the node label field in the target file corresponding to the requesting node is updated by the node attribute of the initiating node to process the current message in the requesting node through the message queue monitoring process in the initiating node.
  • the node label field can include node attribute value, node label name, etc. According to the node attribute of the message queue monitoring process, changing the node label field of the target file of the request node can enable the start node and current message of the persistent connection process started by the message queue monitoring process.
  • the request nodes are kept consistent, so that the long connection process can better process the current message.
  • the target file refers to the compiled code corresponding to the requested node, and the node label field is stored in the target file.
  • the message queue monitoring process can determine whether there are still messages to be processed in the message queue, and if there are still messages to be processed in the message queue, then determine whether it is allowed to obtain messages in the message queue: if the messages to be processed are allowed, then The pending messages in the message queue are processed; if acquisition is not allowed, the message queue monitoring process is terminated; if there are no messages to be processed, the message queue monitoring process can enter an infinite waiting mode until messages to be processed appear in the message queue.
  • the target parameter of the current message is obtained in the node index area and the corresponding system interface is called through the target parameter to configure the startup node through the node attribute of the request node corresponding to the current message, which breaks the request block of the prior art
  • the chain node and the blockchain node that initiates the long connection process must be defined consistently, which improves the efficiency of the long connection process in processing the message queue;
  • the file can be updated correctly even if the requesting node changes
  • the node handles of the same node can be reused, which solves the problem of limited node handle capacity.
  • FIG. 3 schematically shows a schematic diagram of a message processing flow across blockchain nodes according to some embodiments of the present disclosure, including: step S301, initiating a message queue monitoring process at the startup node in the blockchain.
  • Step S302 After the message queue monitoring process is started, the message queue monitoring process calls the corresponding system interface to create a node index area, which can be stored in the storage area of the client corresponding to the blockchain node.
  • the message queue monitoring process can determine whether there are still messages to be processed in the message queue. If there are still messages to be processed in the message queue, it is determined whether it is allowed to obtain the messages in the message queue. If the messages to be processed are allowed to be obtained, then proceed to step S304: If acquisition is not allowed, end the message queue monitoring process.
  • Step S304 the message queue monitoring process reads the current message from the message queue.
  • Step S305 The message queue monitoring process judges whether the request node of the current message and the request node of the previous message in the message queue are the same node, if it is determined that the request node of the current message and the request node of the previous message in the message queue are the same node , Proceed to step S312; if it is determined that the request node of the current message and the request node of the previous message in the message queue are not the same node, proceed to step S306.
  • the message queue monitoring process takes the request node of the current message as an input parameter, and calls the corresponding system interface to access the node index area to obtain the node attribute of the current message request node.
  • Step S307 The message queue monitoring process determines whether there is a node handle corresponding to the requesting node of the current message in the node index area; if it is determined that there is a node handle corresponding to the requesting node of the current message in the node index area, proceed to step S308; if the node index is determined If there is no node handle corresponding to the request node of the current message in the area, step S309 is performed.
  • Step S308 The message queue monitoring process obtains the node handle corresponding to the current message request node from the node index area.
  • step S309 the message queue monitoring process calls the corresponding system interface with the request node of the current message as an input parameter, and creates a node handle corresponding to the request node of the current message according to the system interface.
  • step S310 the message queue monitoring process calls the corresponding system interface to store the message node and the created node handle in the node index area.
  • step S311 the message queue monitoring process uses the node handle as an input parameter, calls the corresponding system interface to obtain the node attribute of the request node corresponding to the current message, and configures the startup node through the node attribute of the request node.
  • step S312 the system calls the message queue monitoring process to process the message, and changes the node label field of the file according to the node attribute of the startup node corresponding to the message queue monitoring process.
  • the cross-blockchain node message processing device 400 includes: the activation unit 410 is configured to activate a message queue monitoring process according to the activation node in the blockchain, and create a corresponding node index through the message queue monitoring process
  • the obtaining unit 420 is configured to obtain the current message in the message queue of the blockchain node through the message queue monitoring process;
  • the modification unit 430 is configured to obtain the target parameter of the current message according to the node index area, so as to obtain the target parameter of the current message according to the target parameter and the current message
  • the request node configures the node attributes of the message queue monitoring process;
  • the processing unit 440 is configured to update the node label field of the target file corresponding to the request node through the node attributes of the message queue monitoring process, so as to process the current message in the request node through the message queue monitoring process.
  • the obtaining unit 420 is configured to: sort the messages to be processed in the message queue according to preset rules to generate a sequence list; and obtain the current messages in the message queue in sequence according to the sequence list through the message queue monitoring process.
  • the starting unit 410 is configured to: obtain a preset system interface based on the message queue monitoring process; create a node index area according to the system interface; the node index area is configured to store the request node and request of the current message in the message queue Correspondence between node and node handle.
  • the modification unit 430 includes: a judging unit configured to judge whether the request node of the current message and the request node of the previous message in the message queue are the same node; the node attribute modification unit is configured to determine whether the request node of the current message The request node and the request node of the previous message in the message queue are the same node, and the node label field in the target file corresponding to the request node is directly updated through the node attribute of the starting node to process the request through the message queue monitoring process in the starting node The current message in the node.
  • the node attribute modification unit includes: an access unit configured to, if it is determined that the request node of the current message and the request node of the previous message in the message queue are not the same node, call the corresponding system according to the request node of the current message
  • the interface accesses the node index area to obtain the node handle corresponding to the request node; calls the corresponding system interface according to the node handle to configure the startup node through the node attributes of the request node of the current message, and update the target file corresponding to the request node through the node attributes of the startup node
  • the node label field in the node to process the current message in the requesting node by starting the message queue monitoring process in the node.
  • the cross-blockchain node message processing device 400 is configured to: determine whether there is a node handle corresponding to the request node of the current message in the node index area; if there is a node handle corresponding to the request node of the current message in the node index area Node handle, the node handle of the requesting node of the current message is obtained from the node index area to call the corresponding system interface according to the node handle to configure the startup node through the node attribute configuration of the requesting node corresponding to the current message; if there is no current message in the node index area The node handle corresponding to the request node of the current message is called by the request node of the current message to call the corresponding system interface to create the node handle corresponding to the request node of the current message and store it in the node index area.
  • the processing unit 440 is configured to determine whether there is a current message to be processed in the message queue based on the message queue monitoring process; if there is a current message in the message queue, process the current message; if there is no current message in the message queue Message, the message queue monitoring process is ended.
  • modules or units of the message processing device across blockchain nodes are mentioned in the above detailed description, this division is not mandatory.
  • the features and functions of two or more modules or units described above may be embodied in one module or unit.
  • the features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.
  • the present disclosure also provides an electronic device capable of implementing the above-mentioned cross-blockchain node message processing method.
  • the electronic device 500 according to such an embodiment of the present disclosure will be described below with reference to FIG. 5.
  • the electronic device 500 shown in FIG. 5 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 500 is represented in the form of a general-purpose computing device.
  • the components of the electronic device 500 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, a bus 530 connecting different system components, and a display unit 540.
  • the storage unit stores program code, and the program code can be executed by the processing unit 510, so that the processing unit 510 executes the method in the foregoing method embodiment.
  • the processing unit 510 may perform steps S210-S240 as shown in FIG. 2.
  • the storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 521 and/or a cache storage unit 522, and may further include a read-only storage unit (ROM) 523.
  • the storage unit 520 may also include a program/utility tool 524 having a set of (at least one) program module 525.
  • program module 525 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 530 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the electronic device 500 may also communicate with one or more external devices 570 (such as keyboards, pointing devices, Bluetooth devices, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 500, and/or communicate with Any device (such as a router, modem, etc.) that enables the electronic device 500 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 550.
  • the electronic device 500 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 560.
  • the network adapter 560 communicates with other modules of the electronic device 500 through the bus 530.
  • the exemplary embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored in a computer non-volatile readable storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) Or on the network, several instructions are included to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
  • a computing device which may be a personal computer, a server, a terminal device, or a network device, etc.
  • a computer non-volatile readable storage medium on which is stored a program product capable of implementing the above-mentioned method in this specification.
  • various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code.
  • the program product runs on a terminal device, the program code is used to make the terminal device execute the foregoing ⁇ Example of the method.
  • Figure 6 shows a program product 600 for implementing the above-mentioned cross-blockchain node message processing method, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be used in terminal devices, such as personal On the computer, run.
  • the program product of the present disclosure is not limited thereto, and the computer non-volatile readable storage medium may also be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the program product can adopt any combination of one or more computer non-volatile readable storage media.
  • the computer non-volatile readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages-such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service providers Internet service providers
  • the exemplary embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
  • a computing device which may be a personal computer, a server, a touch terminal, or a network device, etc.

Abstract

The present disclosure provides a message processing method for cross-block chain node, a device, an apparatus and a medium, relating to the technical field of computers. The method comprises: starting a message queue monitoring process according to a starting node in a block chain, and creating a node index area through the message queue monitoring process; acquiring a current message in a message queue of the block chain node through the message queue monitoring process; acquiring a target parameter of the current message according to the node index area, and calling a system interface according to the target parameter so as to configure the starting node according to node attribute of a request node corresponding to the current message; updating a node label field in a target file corresponding to the request node through the node attribute of the starting node, so as to process the current message in the request node through the message queue monitoring process in the starting node. The technical solution of the embodiment of the present disclosure can correctly update the node label field of the file when the request node is changed, improving the message processing efficiency of the long connection process.

Description

跨区块链节点的消息处理方法及装置、设备、介质Method, device, equipment and medium for processing messages across blockchain nodes 技术领域Technical field
本申请要求2019年8月2日递交、发明名称为“跨区块链节点的消息处理方法及装置、设备、介质”的中国专利申请CN 201910713843.9的优先权,在此通过引用将其全部内容合并于此。This application claims the priority of the Chinese patent application CN 201910713843.9 filed on August 2, 2019 with the title of "message processing method and device, equipment and medium across blockchain nodes", and the entire contents of which are incorporated herein by reference Here.
本公开涉及计算机技术领域,具体而言,涉及一种跨区块链节点的消息处理方法、跨区块链节点的消息处理装置、电子设备以及计算机可读存储介质。The present disclosure relates to the field of computer technology, and in particular, to a message processing method across blockchain nodes, a message processing device across blockchain nodes, electronic equipment, and computer-readable storage media.
背景技术Background technique
随着科技的迅速发展,区块链技术越来越受到重视。区块链技术(分布式账本技术)是一种去中心化的分布式数据库技术,具有公开透明、不可篡改、可信任等多种特点。With the rapid development of technology, blockchain technology has received more and more attention. Blockchain technology (distributed ledger technology) is a decentralized distributed database technology with many characteristics such as openness, transparency, non-tampering, and trustworthiness.
目前,区块链节点在处理消息队列时,通常是开启一长连接进程来进行处理,当检测到消息队列中出现待处理消息时,对该消息进行处理。当同时有大量消息进入消息队列中时,可通过该长连接进程对消息队列中的消息逐一地进行处理。发明人意识到:由于长连接进程启动时,会默认设定其启动区块链节点为其“当前节点”,输入输出程序(input/output,简称IO程序)会使用该“当前节点”更新文件的节点标签字段,即不管向前端服务器发起请求消息的区块链节点是哪个,在文件更新时总是标记了启动长连接进程的那个区块链节点的节点标签,因此,这种MQ(消息队列)长连接方案仅适用于那些发起消息的请求区块链节点与启动长连接进程的区块链节点一致的情况。At present, when a blockchain node processes a message queue, it usually starts a long connection process for processing. When a pending message is detected in the message queue, the message is processed. When a large number of messages enter the message queue at the same time, the messages in the message queue can be processed one by one through the long connection process. The inventor realized that: when the long connection process is started, the startup blockchain node will be set as the "current node" by default, and the input/output program (input/output, referred to as IO program) will use the "current node" to update the file The node label field, that is, regardless of the blockchain node that initiates the request message to the front-end server, the node label of the blockchain node that initiated the persistent connection process is always marked when the file is updated. Therefore, this MQ (message The queue) persistent connection scheme is only applicable to those cases where the requesting blockchain node that initiates the message is consistent with the blockchain node that initiates the persistent connection process.
发明概述Summary of the invention
技术问题technical problem
问题的解决方案The solution to the problem
技术解决方案Technical solutions
本公开实施例的目的在于提供一种跨区块链节点的消息处理方法及相关设备,进而至少在一定程度上克服现有技术中长连接进程处理消息队列时请求节点发 生变更不能更新文件的节点标签字段以及节点句柄容量有限的问题。The purpose of the embodiments of the present disclosure is to provide a cross-blockchain node message processing method and related equipment, so as to overcome at least to a certain extent the nodes in the prior art that request nodes to change and cannot update files when the long connection process processes the message queue. The label field and node handle capacity is limited.
第一方面,提供了一种跨区块链节点的消息处理方法,包括:根据区块链中的启动节点启动一消息队列监控进程,并通过所述消息队列监控进程创建对应的节点索引区;通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息;根据所述节点索引区获取所述当前消息的目标参数,以根据所述目标参数以及所述当前消息对应的请求节点配置所述消息队列监控进程的节点属性;通过所述消息队列监控进程的节点属性更新所述请求节点对应的目标文件的节点标签字段,以通过所述消息队列监控进程处理所述请求节点中的所述当前消息。In a first aspect, a message processing method across blockchain nodes is provided, which includes: starting a message queue monitoring process according to a starting node in the blockchain, and creating a corresponding node index area through the message queue monitoring process; Obtain the current message in the message queue of the blockchain node through the message queue monitoring process; obtain the target parameter of the current message according to the node index area, so as to obtain the target parameter according to the target parameter and the corresponding current message The request node configures the node attributes of the message queue monitoring process; the node label field of the target file corresponding to the request node is updated through the node attributes of the message queue monitoring process, so as to process the request node through the message queue monitoring process The current message in.
第二方面,提供了一种跨区块链节点的消息处理装置,包括:启动单元,配置为根据区块链中的启动节点启动一消息队列监控进程,并通过所述消息队列监控进程创建对应的节点索引区;获取单元,配置为通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息;更改单元,配置为根据所述节点索引区获取所述当前消息的目标参数,以根据所述目标参数以及所述当前消息对应的请求节点配置所述消息队列监控进程的节点属性;处理单元,配置为通过所述消息队列监控进程的节点属性更新所述请求节点对应的目标文件的节点标签字段,以通过所述消息队列监控进程处理所述请求节点中的所述当前消息。In a second aspect, a message processing device across blockchain nodes is provided, including: a startup unit configured to start a message queue monitoring process according to the startup node in the blockchain, and create a corresponding message queue monitoring process through the message queue monitoring process The node index area of the node; an obtaining unit configured to obtain the current message in the message queue of the blockchain node through the message queue monitoring process; a modification unit configured to obtain the target of the current message according to the node index area Parameter to configure the node attribute of the message queue monitoring process according to the target parameter and the request node corresponding to the current message; the processing unit is configured to update the node attribute of the request node through the node attribute of the message queue monitoring process The node label field of the target file is used to process the current message in the requesting node through the message queue monitoring process.
第三方面,提供了一种电子设备,包括:处理器;以及存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时实现上述的跨区块链节点的消息处理方法。In a third aspect, an electronic device is provided, including: a processor; and a memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the above-mentioned cross-blockchain is implemented The node's message processing method.
第四方面,提供一种计算机非易失性可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现根据上述任意一项所述的跨区块链节点的消息处理方法。In a fourth aspect, a computer non-volatile readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, realizes the message processing across blockchain nodes according to any one of the above method.
本公开实施例提供的技术方案可以包括以下有益效果:通过本公开的方法,一方面,在节点索引区获取当前消息的目标参数并通过目标参数调用对应的系统接口以通过当前消息对应的请求节点的节点属性配置启动节点,避免请求区块链节点与启动长连接进程的区块链节点必须一致的问题,提高了长连接进程处 理消息队列的效率;另一方面,实现在使用长连接进程处理消息队列时,即使请求节点发生变更也能正确更新文件的节点标签字段;再一方面,通过创建节点索引区存储节点和节点句柄,使得同一节点的节点句柄可以重复使用,解决了节点句柄容量有限的问题。The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: through the method of the present disclosure, on the one hand, the target parameter of the current message is obtained in the node index area and the corresponding system interface is called through the target parameter to pass the request node corresponding to the current message The node attribute configuration of the startup node avoids the problem that the requested blockchain node and the blockchain node that initiates the long connection process must be consistent, and improves the efficiency of processing the message queue in the long connection process; on the other hand, it realizes the processing of the long connection process In the message queue, the node label field of the file can be updated correctly even if the requesting node changes; on the other hand, by creating a node index area to store nodes and node handles, the node handles of the same node can be reused, which solves the limited capacity of node handles The problem.
发明的有益效果The beneficial effects of the invention
对附图的简要说明Brief description of the drawings
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起配置为解释本公开的原理。下面的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments conforming to the disclosure, and are configured together with the specification to explain the principle of the disclosure. The following drawings are only some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained from these drawings without creative work.
图1示意性示出了根据本公开的一些实施例的跨区块链交互系统的示意图;Fig. 1 schematically shows a schematic diagram of a cross-blockchain interaction system according to some embodiments of the present disclosure;
图2示出了根据本公开的一些实施例的跨区块链节点的消息处理方法的示意图;Fig. 2 shows a schematic diagram of a message processing method across blockchain nodes according to some embodiments of the present disclosure;
图3示出了根据本公开的一些实施例的跨区块链节点的消息处理流程的示意图;Figure 3 shows a schematic diagram of a message processing flow across blockchain nodes according to some embodiments of the present disclosure;
图4示出了根据本公开的一些实施例的跨区块链节点的消息处理装置的示意图;Fig. 4 shows a schematic diagram of a message processing device across blockchain nodes according to some embodiments of the present disclosure;
图5示出了根据本公开的一些实施例的电子设备的计算机系统的结构示意图;Fig. 5 shows a schematic structural diagram of a computer system of an electronic device according to some embodiments of the present disclosure;
图6示意性示出了根据本公开的一些实施例的计算机非易失性可读存储介质的示意图。Fig. 6 schematically shows a schematic diagram of a computer non-volatile readable storage medium according to some embodiments of the present disclosure.
发明实施例Invention embodiment
本发明的实施方式Embodiments of the invention
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms, and should not be construed as being limited to the examples set forth herein; on the contrary, the provision of these embodiments makes the present disclosure more comprehensive and complete, and fully conveys the concept of the example embodiments To those skilled in the art.
图1示出了根据本公开的一些实施例的跨区块链交互系统的示意图。其中,订阅客户端对应于第一区块链内的区块链节点,用于维护区块链节点对应的消息队列,消息队列包含区块链节点订阅的消息。发布客户端对应于第二区块链,用于获取并发布第二区块链产生的消息。跨链交互端(跨链交互端1、跨链交互端2)用于获取第一区块链内的区块链节点的订阅条件,并在消息队列的末尾包含满足订阅条件的消息时,向发布客户端请求满足订阅条件的消息并发送至订阅客户端,以更新至消息队列中,从而第一区块链内的区块链节点可以从该消息队列中拉取消息。Fig. 1 shows a schematic diagram of a cross-blockchain interaction system according to some embodiments of the present disclosure. Among them, the subscription client corresponds to a blockchain node in the first blockchain, and is used to maintain a message queue corresponding to the blockchain node, and the message queue contains messages subscribed by the blockchain node. The publishing client corresponds to the second blockchain and is used to obtain and publish messages generated by the second blockchain. The cross-chain interaction terminal (cross-chain interaction terminal 1, cross-chain interaction terminal 2) is used to obtain the subscription conditions of the blockchain nodes in the first blockchain, and when the end of the message queue contains messages that meet the subscription conditions, the The publishing client requests a message that meets the subscription condition and sends it to the subscribing client to update it in the message queue, so that the blockchain node in the first blockchain can pull the message from the message queue.
订阅客户端的区块链节点在处理消息队列(MQ)时,通常是开启一长连接进程进行处理,当检测到消息队列中出现待处理消息时,对该消息进行处理。当同时有大量消息进入消息队列中时,可通过该长连接进程对消息队列中的消息逐一地进行处理。但是,由于长连接进程启动时会默认设定其启动区块链节点为其“当前节点”,输入输出程序(Input/Output,简称IO程序)会使用该“当前节点”更新文件的节点标签字段,即无论向前端服务器发起请求消息的区块链节点是哪个,在文件更新时总是设置为启动长连接进程的区块链节点的节点标签,因此这种消息队列长连接方案仅适配置为那些发起消息的请求区块链节点与启动长连接进程的区块链节点一致的情况。When the blockchain node subscribing to the client processes the message queue (MQ), it usually starts a long connection process for processing. When a pending message is detected in the message queue, the message is processed. When a large number of messages enter the message queue at the same time, the messages in the message queue can be processed one by one through the long connection process. However, since the startup blockchain node is set as the "current node" by default when the persistent connection process is started, the input/output program (Input/Output, referred to as IO program) will use the "current node" to update the node label field of the file , That is, regardless of the blockchain node that initiates the request message to the front-end server, it is always set to the node label of the blockchain node that initiated the long connection process when the file is updated. Therefore, this message queue long connection scheme is only suitable for configuration The case where the requesting blockchain node that initiates the message is consistent with the blockchain node that initiated the long connection process.
基于此,首先提供了一种跨区块链节点的消息处理方法,参考图2所示,该跨区块链节点的消息处理方法可以包括以下步骤:Based on this, a method for message processing across blockchain nodes is first provided. Referring to Figure 2, the method for processing messages across blockchain nodes may include the following steps:
在步骤S210中,根据区块链中的启动节点启动一消息队列监控进程,并通过消息队列监控进程创建对应的节点索引区。In step S210, a message queue monitoring process is started according to the start node in the blockchain, and a corresponding node index area is created through the message queue monitoring process.
启动节点可以是指区块链中用于启动消息队列监控进程对应的节点,该启动节点可以是一区块链中的客户端,例如参考图1,区块链节点可以是对应于第一区块链的订阅客户端。消息队列监控进程可以是指配置为监控并处理消息队列中消息的进程,例如消息队列监控进程可以是长连接进程,具体的,启动一消息队列监控进程可以是启动消息队列对应的一长连接进程。本实施例中,长连接进程是相对于短连接进程的,即长连接进程可以持续监控消息队列,一旦发现有未处理的消息立即将其取出处理,直到将上述消息队列中的消息处理完毕为 止。当然消息队列监控进程还可以是短连接进程,所启动一消息队列监控进程可以是启动消息队列对应的一个或多个短连接进程。短连接进程是为了某一消息单独生成的一个处理进程,其处理完该消息即终止。节点索引区用于存储消息队列中的消息的请求节点及请求节点对应节点句柄的对应关系,该节点索引区可以理解为一片内存区。The startup node may refer to the node corresponding to the message queue monitoring process in the blockchain. The startup node may be a client in the blockchain. For example, referring to Figure 1, the blockchain node may correspond to the first zone. The subscription client of the blockchain. The message queue monitoring process can refer to a process configured to monitor and process messages in the message queue. For example, the message queue monitoring process can be a long connection process. Specifically, starting a message queue monitoring process can be a long connection process corresponding to the message queue. . In this embodiment, the long connection process is relative to the short connection process, that is, the long connection process can continuously monitor the message queue. Once unprocessed messages are found, they will be taken out and processed until the messages in the message queue are processed. . Of course, the message queue monitoring process may also be a short connection process, and a message queue monitoring process to be started may be one or more short connection processes corresponding to the message queue. The short connection process is a processing process generated separately for a certain message, and it terminates after processing the message. The node index area is used to store the correspondence between the request node of the message in the message queue and the node handle corresponding to the request node. The node index area can be understood as a memory area.
在一实施例中,步骤S210包括:基于消息队列监控进程,获取预设的系统接口;根据系统接口创建对应的节点索引区,其中,节点索引区配置为存储所述消息队列中所述当前消息的请求节点与所述请求节点对节点句柄的对应关系。该系统接口可以是预先存储在启动节点对应的客户端的存储装置中,也可以是开发人员自行配置的。系统在启动节点启动消息队列监控进程后,通过消息队列监控进程调用系统接口并通过系统接口创建节点索引区。举例而言,假设消息队列中当前有2个待处理的消息A、消息B,分别对应发起消息A的请求节点甲以及发起消息B的请求节点乙,请求节点甲可对应创建一节点句柄甲、请求节点乙可对应创建一节点句柄乙,在上述节点索引区中分别存储请求节点甲与节点句柄甲、请求节点乙与节点句柄乙的对应关系。In one embodiment, step S210 includes: obtaining a preset system interface based on the message queue monitoring process; creating a corresponding node index area according to the system interface, wherein the node index area is configured to store the current message in the message queue The corresponding relationship between the request node and the node handle of the request node. The system interface can be pre-stored in the storage device of the client corresponding to the startup node, or can be configured by the developer. After the system starts the message queue monitoring process on the node, it calls the system interface through the message queue monitoring process and creates a node index area through the system interface. For example, suppose there are currently two pending messages A and B in the message queue, corresponding to the requesting node A that initiates message A and the requesting node B that initiates message B. Requesting node A can create a node handle A, The requesting node B can create a node handle B correspondingly, and the corresponding relations between the requesting node A and the node handle A, and the requesting node B and the node handle B are respectively stored in the node index area.
在步骤S220中,通过消息队列监控进程获取区块链节点的消息队列中的当前消息。In step S220, the current message in the message queue of the blockchain node is obtained through the message queue monitoring process.
在一实施例中,当前消息是指消息队列中逻辑位置在最前面的待处理消息,即该当前消息并不是某一个固定的消息,而是动态变化的。例如,一消息队列中按优先级排列有待处理消息A、待处理消息B以及待处理消息C,此时待处理消息A在该消息队列中的逻辑位置在最前面,因此认为待处理消息A为当前消息;按进入消息队列的先后顺序排列有待处理消息C、待处理消息A以及待处理消息B,此时待处理消息C在该消息队列中的逻辑位置在最前面,因此认为待处理消息C为当前消息。In one embodiment, the current message refers to the message to be processed with the logical position at the top in the message queue, that is, the current message is not a fixed message, but changes dynamically. For example, a message queue has messages to be processed A, message B to be processed, and message C to be processed in order of priority. At this time, the logical position of message A to be processed in the message queue is at the top. Therefore, it is considered that message A to be processed is Current message; In the order of entering the message queue, there are pending message C, pending message A, and pending message B. At this time, pending message C is at the top of the logical position in the message queue, so it is considered pending message C Is the current message.
步骤S220进一步包括:根据预设规则对消息队列中的待处理消息进行排序生成顺序列表;通过消息队列监控进程按照顺序列表依次获取消息队列中的当前消息。预设规则可以是指用户提前设置好的对待处理消息进行排序的规则,例如消息队列中的待处理消息的优先级,也可以是根据消息进入消息队列的先后顺 序。根据预设规则对消息队列中的待处理消息进行排序后进行处理(长连接进程对消息队列中的消息只能逐一地进行处理),例如根据待处理消息的优先级对待处理消息进行处理。当然,也可以直接根据待处理消息进入消息队列的时间先后顺序逐一处理。消息队列监控进程在生成的顺序列表中获取当前消息或者根据待处理消息进入消息队列的时间先后顺序获取当前消息。Step S220 further includes: sorting the messages to be processed in the message queue according to preset rules to generate a sequence list; and obtaining the current messages in the message queue in sequence according to the sequence list through the message queue monitoring process. The preset rule may refer to a rule set by the user in advance for sorting messages to be processed, such as the priority of messages to be processed in a message queue, or the order in which messages enter the message queue. The messages to be processed in the message queue are sorted and processed according to preset rules (the persistent connection process can only process the messages in the message queue one by one), for example, the messages to be processed are processed according to the priority of the message to be processed. Of course, you can also directly process the messages one by one according to the order in which the messages to be processed enter the message queue. The message queue monitoring process obtains the current message in the generated sequence list or obtains the current message according to the time sequence when the message to be processed enters the message queue.
在步骤S230中,根据节点索引区获取当前消息的目标参数,并根据目标参数调用对应的系统接口以通过当前消息对应的请求节点的节点属性配置启动节点。In step S230, the target parameter of the current message is obtained according to the node index area, and the corresponding system interface is called according to the target parameter to configure the startup node through the node attribute of the request node corresponding to the current message.
目标参数是指与当前消息关联的、配置为调用系统接口的输入参数,例如当前消息的请求节点对应的节点句柄,也可以是当前消息的请求节点(通过当前消息的请求节点在节点索引去获取对应的节点句柄,再将节点句柄作为调用系统接口的输入参数)。节点属性包括节点的名称、节点的值以及节点的类型等至少一属性信息,系统能够根据节点属性为节点分配运算资源等服务。消息队列监控进程根据该目标参数调用相应的系统接口,该系统接口通过当前消息对应的请求节点的节点属性配置启动节点。The target parameter refers to the input parameter that is associated with the current message and is configured to call the system interface, such as the node handle corresponding to the request node of the current message, or the request node of the current message (get it through the request node of the current message in the node index Corresponding node handle, and then take the node handle as the input parameter of calling the system interface). The node attributes include at least one attribute information such as the name of the node, the value of the node, and the type of the node. The system can allocate computing resources and other services to the node according to the node attribute. The message queue monitoring process calls the corresponding system interface according to the target parameter, and the system interface configures the startup node through the node attribute of the request node corresponding to the current message.
在处理消息队列时,系统通过区块链中的启动节点开启一长连接进程来进行消息处理,当消息队列中有大量消息进入消息队列时,可通过该长连接进程对消息队列中的消息逐一地进行处理。但是,由于长连接进程在启动节点启动时,会默认设定启动节点为其“当前节点”,IO程序会使用该“当前节点”更新文件的节点标签字段。此时长连接进程会在启动节点处理请求节点的当前消息,由于节点属性不一致,可能导致长连接进程处理当前消息失败或者处理消息效率降低。因此需要通过节点句柄根据当前消息对应的请求节点的节点属性配置启动节点,以使IO程序能够根据启动节点的节点属性正确更新请求节点对应的节点标签字段,让启动节点中的长连接进程能够准确地、快速地处理请求节点中的当前消息。When processing the message queue, the system uses the startup node in the blockchain to start a long connection process for message processing. When a large number of messages in the message queue enter the message queue, the messages in the message queue can be processed one by one through the long connection process. To deal with it. However, since the persistent connection process will set the startup node as the "current node" by default when the startup node is started, the IO program will use the "current node" to update the node label field of the file. At this time, the persistent connection process will process the current message of the requesting node at the start node. Due to inconsistent node attributes, the persistent connection process may fail to process the current message or reduce the efficiency of processing the message. Therefore, it is necessary to configure the startup node according to the node attributes of the request node corresponding to the current message through the node handle, so that the IO program can correctly update the node label field corresponding to the request node according to the node attributes of the startup node, so that the persistent connection process in the startup node can be accurate Process the current message in the requesting node quickly and accurately.
具体的,判断当前消息的请求节点与消息队列中的前一消息的请求节点是否为同一节点;如果确定当前消息的请求节点与消息队列中的前一消息的请求节点是同一节点,则通过启动节点的节点属性更新请求节点对应的目标文件中的节点标签字段,以通过启动节点中的消息队列监控进程处理请求节点中的当前消 息。前一消息可以是指消息队列监控进程已处理的与当前消息在消息队列中的位置相邻的消息。举例而言,一消息队列中按优先级排列有待处理消息A、待处理消息B以及待处理消息C,此时待处理消息A为当前消息,消息队列监控进程将待处理消息A处理完毕后,则待处理消息B为当前消息,则已处理消息A为前一消息。目标文件可以是指请求节点对应的编译代码,节点标签字段存储在目标文件中。节点标签字段可以包括节点属性值、节点标签名等,根据消息队列监控进程的节点属性更改请求节点的目标文件的节点标签字段,能够使消息队列监控进程启动的长连接进程的启动节点和当前消息的请求节点保持一致,以便于长连接进程更好的处理当前消息。Specifically, it is judged whether the request node of the current message and the request node of the previous message in the message queue are the same node; if it is determined that the request node of the current message and the request node of the previous message in the message queue are the same node, start The node attribute of the node updates the node label field in the target file corresponding to the request node to process the current message in the request node by starting the message queue monitoring process in the node. The previous message may refer to a message that has been processed by the message queue monitoring process and is adjacent to the position of the current message in the message queue. For example, a message queue has pending message A, pending message B, and pending message C arranged in priority order. At this time, pending message A is the current message. After the message queue monitoring process has processed pending message A, Then the pending message B is the current message, and the processed message A is the previous message. The target file may refer to the compiled code corresponding to the requested node, and the node label field is stored in the target file. The node label field can include node attribute value, node label name, etc. According to the node attribute of the message queue monitoring process, changing the node label field of the target file of the request node can enable the start node and current message of the persistent connection process started by the message queue monitoring process. The request nodes are kept consistent, so that the long connection process can better process the current message.
消息队列监控进程判定当前消息的请求节点与消息队列中的前一消息的请求节点是同一节点时,此时认为当前节点的节点属性与前一消息的节点属性相同,因此不需要对消息队列监控进程对应的启动节点的节点属性更新,则直接通过启动节点的节点属性更新请求节点对应的目标文件中的节点标签字段,并通过启动节点中的消息队列监控进程处理请求节点中的当前消息。When the message queue monitoring process determines that the request node of the current message and the request node of the previous message in the message queue are the same node, the node attribute of the current node is considered to be the same as the node attribute of the previous message, so there is no need to monitor the message queue The node attribute of the starting node corresponding to the process is updated, the node label field in the target file corresponding to the request node is directly updated through the node attribute of the starting node, and the current message in the request node is processed through the message queue monitoring process in the starting node.
可选的,如果消息队列监控进程确定当前消息的请求节点与消息队列中的前一消息的请求节点不是同一节点,此时认为当前消息的请求节点与前一消息的请求节点的节点属性不同,因此在处理当前消息时首先需要对消息队列监控进程对应的启动节点对应的节点属性进行更新。因此消息队列监控进程以当前消息的请求节点为目标参数(输入参数),调用相应的系统接口访问节点索引区获取当前消息请求节点的节点句柄,根据该节点句柄调用对应的系统接口,该系统接口获取当前消息的请求节点的节点属性,并通过该请求节点的节点属性配置启动节点,然后通过启动节点的节点属性更新请求节点对应的目标文件中的节点标签字段,以通过启动节点中的消息队列监控进程处理请求节点中的当前消息。Optionally, if the message queue monitoring process determines that the request node of the current message and the request node of the previous message in the message queue are not the same node, then it is considered that the node attributes of the request node of the current message and the request node of the previous message are different, Therefore, when processing the current message, it is first necessary to update the node attributes corresponding to the startup node corresponding to the message queue monitoring process. Therefore, the message queue monitoring process takes the request node of the current message as the target parameter (input parameter), calls the corresponding system interface to access the node index area to obtain the node handle of the current message request node, and calls the corresponding system interface according to the node handle. Get the node attribute of the request node of the current message, and configure the startup node through the node attribute of the request node, and then update the node label field in the target file corresponding to the request node through the node attribute of the startup node to pass the message queue in the startup node The monitoring process processes the current message in the request node.
进一步的,消息队列监控进程判断节点索引区中是否存在当前消息的请求节点对应的节点句柄;如果确定节点索引区中存在当前消息的请求节点对应的节点句柄,则直接从节点索引区中获取当前消息的请求节点对应的节点句柄,并根据当前消息的请求节点对应的节点句柄获取当前消息的请求节点(可以包含节 点属性),并通过当前消息的请求节点的节点属性配置消息队列监控进程对应的启动节点,以使消息队列监控进程能够正确的处理消息队列中的当前消息,提高消息处理的效率。Further, the message queue monitoring process determines whether there is a node handle corresponding to the request node of the current message in the node index area; if it is determined that there is a node handle corresponding to the request node of the current message in the node index area, the current message is directly obtained from the node index area. The node handle corresponding to the request node of the message, and the request node of the current message (which may include node attributes) according to the node handle corresponding to the request node of the current message, and configure the message queue monitoring process corresponding to the node attribute of the request node of the current message Start the node so that the message queue monitoring process can correctly process the current messages in the message queue, and improve the efficiency of message processing.
可选的,消息队列监控进程如果确定节点索引区不存在当前消息的请求节点对应的节点句柄,则以当前消息的请求节点为目标参数(输入参数),调用对应的系统接口创建当前消息的请求节点对应的节点句柄,并将该节点句柄存储到节点索引区中。通过调用对应的系统接口在节点索引区创建原节点索引区中不存在的当前消息的请求节点对应的节点句柄,不断完善节点索引区,以便于后续处理相同请求节点的消息,进一步提高消息处理的效率。Optionally, if the message queue monitoring process determines that the node handle corresponding to the request node of the current message does not exist in the node index area, the request node of the current message is used as the target parameter (input parameter), and the corresponding system interface is called to create a request for the current message. The node handle corresponding to the node, and the node handle is stored in the node index area. Create a node handle corresponding to the request node of the current message that does not exist in the original node index area by calling the corresponding system interface in the node index area, and continuously improve the node index area to facilitate subsequent processing of messages of the same request node, and further improve the message processing effectiveness.
在步骤S240中,通过启动节点的节点属性更新请求节点对应的目标文件中的节点标签字段,以通过启动节点中的消息队列监控进程处理请求节点中的当前消息。In step S240, the node label field in the target file corresponding to the requesting node is updated by the node attribute of the initiating node to process the current message in the requesting node through the message queue monitoring process in the initiating node.
节点标签字段可以包括节点属性值、节点标签名等,根据消息队列监控进程的节点属性更改请求节点的目标文件的节点标签字段,能够使消息队列监控进程启动的长连接进程的启动节点和当前消息的请求节点保持一致,以便于长连接进程更好的处理当前消息。目标文件是指请求节点对应的编译代码,节点标签字段存储在目标文件中。The node label field can include node attribute value, node label name, etc. According to the node attribute of the message queue monitoring process, changing the node label field of the target file of the request node can enable the start node and current message of the persistent connection process started by the message queue monitoring process. The request nodes are kept consistent, so that the long connection process can better process the current message. The target file refers to the compiled code corresponding to the requested node, and the node label field is stored in the target file.
可选的,消息队列监控进程可以判断消息队列中是否还有消息待处理,如果消息队列中还有消息待处理,则判断是否允许获取消息队列中的消息:如果允许获取待处理消息,则对消息队列中的待处理消息进行处理;如果不允许获取,则结束消息队列监控进程;如果没有消息待处理,则消息队列监控进程可以进入无限等待模式,直到消息队列中出现待处理消息。Optionally, the message queue monitoring process can determine whether there are still messages to be processed in the message queue, and if there are still messages to be processed in the message queue, then determine whether it is allowed to obtain messages in the message queue: if the messages to be processed are allowed, then The pending messages in the message queue are processed; if acquisition is not allowed, the message queue monitoring process is terminated; if there are no messages to be processed, the message queue monitoring process can enter an infinite waiting mode until messages to be processed appear in the message queue.
通过本公开的方法,首先,在节点索引区获取当前消息的目标参数并通过目标参数调用对应的系统接口以通过当前消息对应的请求节点的节点属性配置启动节点,打破了现有技术请求区块链节点与启动长连接进程的区块链节点必须一致的限定,提高了长连接进程处理消息队列的效率;其次,在使用长连接进程处理消息队列时,即使请求节点发生变更也能正确更新文件的节点标签字段;而且,通过创建节点索引区存储节点和节点句柄,使得同一节点的节点句柄可 以重复使用,解决了节点句柄容量有限的问题。Through the method of the present disclosure, first, the target parameter of the current message is obtained in the node index area and the corresponding system interface is called through the target parameter to configure the startup node through the node attribute of the request node corresponding to the current message, which breaks the request block of the prior art The chain node and the blockchain node that initiates the long connection process must be defined consistently, which improves the efficiency of the long connection process in processing the message queue; secondly, when the long connection process is used to process the message queue, the file can be updated correctly even if the requesting node changes Moreover, by creating a node index area to store nodes and node handles, the node handles of the same node can be reused, which solves the problem of limited node handle capacity.
图3示意性示出了根据本公开的一些实施例的跨区块链节点的消息处理流程的示意图,包括:步骤S301,在区块链中的启动节点启动一消息队列监控进程。步骤S302,在启动消息队列监控进程后,消息队列监控进程调用相应的系统接口创建一节点索引区,该节点索引区可以存储在区块链节点对应客户端的存储区域中。步骤S303,消息队列监控进程可以判断消息队列中是否还有消息待处理,如果消息队列中还有消息待处理,则判断是否允许获取消息队列中的消息,如果允许获取待处理消息,则进行步骤S304;如果不允许获取,则结束消息队列监控进程。步骤S304,消息队列监控进程从消息队列中读取当前消息。步骤S305,消息队列监控进程判断当前消息的请求节点与消息队列中的前一消息的请求节点是否是同一节点,如果确定当前消息的请求节点与消息队列中的前一消息的请求节点是同一节点,则进行步骤S312;如果确定当前消息的请求节点与消息队列中的前一消息的请求节点不是同一节点,则进行步骤S306。步骤S306,消息队列监控进程以当前消息的请求节点为输入参数,调用相应的系统接口访问节点索引区以获取当前消息请求节点的节点属性。步骤S307,消息队列监控进程判断节点索引区中是否存在当前消息的请求节点对应的节点句柄;如果确定节点索引区中存在当前消息的请求节点对应的节点句柄,则进行步骤S308;如果确定节点索引区中不存在当前消息的请求节点对应的节点句柄,则进行步骤S309。步骤S308,消息队列监控进程从节点索引区获取当前消息请求节点对应的节点句柄。步骤S309,消息队列监控进程以当前消息的请求节点为输入参数调用相应的系统接口,并根据该系统接口创建当前消息的请求节点对应的节点句柄。步骤S310,消息队列监控进程调用相应的系统接口将该消息节点和创建的节点句柄存储到节点索引区中。步骤S311,消息队列监控进程以该节点句柄为输入参数,调用相应的系统接口获取当前消息对应的请求节点的节点属性,并通过请求节点的节点属性配置启动节点。步骤S312,系统调用消息队列监控进程处理该消息,根据消息队列监控进程对应的启动节点的节点属性更改文件的节点标签字段。FIG. 3 schematically shows a schematic diagram of a message processing flow across blockchain nodes according to some embodiments of the present disclosure, including: step S301, initiating a message queue monitoring process at the startup node in the blockchain. Step S302: After the message queue monitoring process is started, the message queue monitoring process calls the corresponding system interface to create a node index area, which can be stored in the storage area of the client corresponding to the blockchain node. In step S303, the message queue monitoring process can determine whether there are still messages to be processed in the message queue. If there are still messages to be processed in the message queue, it is determined whether it is allowed to obtain the messages in the message queue. If the messages to be processed are allowed to be obtained, then proceed to step S304: If acquisition is not allowed, end the message queue monitoring process. Step S304, the message queue monitoring process reads the current message from the message queue. Step S305: The message queue monitoring process judges whether the request node of the current message and the request node of the previous message in the message queue are the same node, if it is determined that the request node of the current message and the request node of the previous message in the message queue are the same node , Proceed to step S312; if it is determined that the request node of the current message and the request node of the previous message in the message queue are not the same node, proceed to step S306. In step S306, the message queue monitoring process takes the request node of the current message as an input parameter, and calls the corresponding system interface to access the node index area to obtain the node attribute of the current message request node. Step S307: The message queue monitoring process determines whether there is a node handle corresponding to the requesting node of the current message in the node index area; if it is determined that there is a node handle corresponding to the requesting node of the current message in the node index area, proceed to step S308; if the node index is determined If there is no node handle corresponding to the request node of the current message in the area, step S309 is performed. Step S308: The message queue monitoring process obtains the node handle corresponding to the current message request node from the node index area. In step S309, the message queue monitoring process calls the corresponding system interface with the request node of the current message as an input parameter, and creates a node handle corresponding to the request node of the current message according to the system interface. In step S310, the message queue monitoring process calls the corresponding system interface to store the message node and the created node handle in the node index area. In step S311, the message queue monitoring process uses the node handle as an input parameter, calls the corresponding system interface to obtain the node attribute of the request node corresponding to the current message, and configures the startup node through the node attribute of the request node. In step S312, the system calls the message queue monitoring process to process the message, and changes the node label field of the file according to the node attribute of the startup node corresponding to the message queue monitoring process.
需要说明的是,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但 是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。It should be noted that although the various steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be performed in the specific order, or that all the steps shown must be performed to Achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution, etc.
此外,在本示例实施例中,还提供了一种跨区块链节点的消息处理装置。参照图4所示,该跨区块链节点的消息处理装置400包括:启动单元410配置为根据区块链中的启动节点启动一消息队列监控进程,并通过消息队列监控进程创建对应的节点索引区;获取单元420配置为通过消息队列监控进程获取区块链节点的消息队列中的当前消息;更改单元430配置为根据节点索引区获取当前消息的目标参数,以根据目标参数以及当前消息对应的请求节点配置消息队列监控进程的节点属性;处理单元440配置为通过消息队列监控进程的节点属性更新请求节点对应的目标文件的节点标签字段,以通过消息队列监控进程处理请求节点中的当前消息。In addition, in this exemplary embodiment, a message processing device across blockchain nodes is also provided. 4, the cross-blockchain node message processing device 400 includes: the activation unit 410 is configured to activate a message queue monitoring process according to the activation node in the blockchain, and create a corresponding node index through the message queue monitoring process The obtaining unit 420 is configured to obtain the current message in the message queue of the blockchain node through the message queue monitoring process; the modification unit 430 is configured to obtain the target parameter of the current message according to the node index area, so as to obtain the target parameter of the current message according to the target parameter and the current message The request node configures the node attributes of the message queue monitoring process; the processing unit 440 is configured to update the node label field of the target file corresponding to the request node through the node attributes of the message queue monitoring process, so as to process the current message in the request node through the message queue monitoring process.
在一实施例中,获取单元420被配置为:根据预设规则对消息队列中的待处理消息进行排序生成顺序列表;通过消息队列监控进程按照顺序列表依次获取消息队列中的当前消息。In an embodiment, the obtaining unit 420 is configured to: sort the messages to be processed in the message queue according to preset rules to generate a sequence list; and obtain the current messages in the message queue in sequence according to the sequence list through the message queue monitoring process.
在一实施例中,启动单元410被配置为:基于消息队列监控进程,获取预设的系统接口;根据系统接口创建节点索引区;节点索引区配置为存储消息队列中当前消息的请求节点与请求节点对节点句柄的对应关系。In an embodiment, the starting unit 410 is configured to: obtain a preset system interface based on the message queue monitoring process; create a node index area according to the system interface; the node index area is configured to store the request node and request of the current message in the message queue Correspondence between node and node handle.
在一实施例中,更改单元430包括:判断单元,配置为判断当前消息的请求节点与消息队列中的前一消息的请求节点是否为同一节点;节点属性修改单元,配置为如果确定当前消息的请求节点与消息队列中的前一消息的请求节点是同一节点,则直接通过启动节点的节点属性更新请求节点对应的目标文件中的节点标签字段,以通过启动节点中的消息队列监控进程处理请求节点中的当前消息。In an embodiment, the modification unit 430 includes: a judging unit configured to judge whether the request node of the current message and the request node of the previous message in the message queue are the same node; the node attribute modification unit is configured to determine whether the request node of the current message The request node and the request node of the previous message in the message queue are the same node, and the node label field in the target file corresponding to the request node is directly updated through the node attribute of the starting node to process the request through the message queue monitoring process in the starting node The current message in the node.
在一实施例中,节点属性修改单元包括:访问单元,配置为如果确定当前消息的请求节点与消息队列中的前一消息的请求节点不是同一节点,则根据当前消息的请求节点调用对应的系统接口访问节点索引区以获取请求节点对应的节点 句柄;根据节点句柄调用对应的系统接口以通过当前消息的请求节点的节点属性配置启动节点,并通过启动节点的节点属性更新请求节点对应的目标文件中的节点标签字段,以通过启动节点中的消息队列监控进程处理请求节点中的当前消息。In an embodiment, the node attribute modification unit includes: an access unit configured to, if it is determined that the request node of the current message and the request node of the previous message in the message queue are not the same node, call the corresponding system according to the request node of the current message The interface accesses the node index area to obtain the node handle corresponding to the request node; calls the corresponding system interface according to the node handle to configure the startup node through the node attributes of the request node of the current message, and update the target file corresponding to the request node through the node attributes of the startup node The node label field in the node to process the current message in the requesting node by starting the message queue monitoring process in the node.
在一实施例中,跨区块链节点的消息处理装置400被配置为:判断节点索引区中是否存在当前消息的请求节点对应的节点句柄;如果节点索引区中存在当前消息的请求节点对应的节点句柄,则从节点索引区中获取当前消息的请求节点的节点句柄以根据节点句柄调用对应的系统接口以通过当前消息对应的请求节点的节点属性配置启动节点;如果节点索引区不存在当前消息的请求节点对应的节点句柄,则通过当前消息的请求节点调用对应的系统接口创建当前消息的请求节点对应的节点句柄并存储到节点索引区中。In one embodiment, the cross-blockchain node message processing device 400 is configured to: determine whether there is a node handle corresponding to the request node of the current message in the node index area; if there is a node handle corresponding to the request node of the current message in the node index area Node handle, the node handle of the requesting node of the current message is obtained from the node index area to call the corresponding system interface according to the node handle to configure the startup node through the node attribute configuration of the requesting node corresponding to the current message; if there is no current message in the node index area The node handle corresponding to the request node of the current message is called by the request node of the current message to call the corresponding system interface to create the node handle corresponding to the request node of the current message and store it in the node index area.
在一实施例中,处理单元440被配置为:基于消息队列监控进程,判断消息队列中是否有待处理的当前消息;如果消息队列中有当前消息,则对当前进行处理;如果消息队列中没有当前消息,则结束消息队列监控进程。In one embodiment, the processing unit 440 is configured to determine whether there is a current message to be processed in the message queue based on the message queue monitoring process; if there is a current message in the message queue, process the current message; if there is no current message in the message queue Message, the message queue monitoring process is ended.
上述装置各模块的具体细节已在对应方法实施例进行了详细的描述,此处不再赘述。The specific details of each module of the above device have been described in detail in the corresponding method embodiment, and will not be repeated here.
应当注意,尽管在上文详细描述中提及了跨区块链节点的消息处理装置的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the message processing device across blockchain nodes are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. The features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.
本公开还提供了一种能够实现上述跨区块链节点的消息处理方法的电子设备。The present disclosure also provides an electronic device capable of implementing the above-mentioned cross-blockchain node message processing method.
能够理解的是,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开色实现可以通过完全的硬件实施例、完全的软件实施例(包括固件、微代码等),或硬件和软件方面结合的实施例,这里可以统称为“电路”、“模块”或“系统”。It can be understood that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, the color of the present disclosure can be realized through a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or a combination of hardware and software, which can be collectively referred to herein as "circuits", "modules" or "system".
下面参照图5来描述根据本公开的这种实施例的电子设备500。图5所示的电子设备500仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制 。The electronic device 500 according to such an embodiment of the present disclosure will be described below with reference to FIG. 5. The electronic device 500 shown in FIG. 5 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
如图5所示,电子设备500以通用计算设备的形式表现。电子设备500的组件可以包括但不限于:至少一处理单元510、至少一存储单元520、连接不同系统组件的总线530、显示单元540。As shown in FIG. 5, the electronic device 500 is represented in the form of a general-purpose computing device. The components of the electronic device 500 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, a bus 530 connecting different system components, and a display unit 540.
存储单元存储有程序代码,程序代码可以被处理单元510执行,使得处理单元510执行上述方法实施例中的方法。例如,处理单元510可以执行如图2中所示的步骤S210-S240。The storage unit stores program code, and the program code can be executed by the processing unit 510, so that the processing unit 510 executes the method in the foregoing method embodiment. For example, the processing unit 510 may perform steps S210-S240 as shown in FIG. 2.
存储单元520可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)521和/或高速缓存存储单元522,还可以进一步包括只读存储单元(ROM)523。存储单元520还可以包括具有一组(至少一个)程序模块525的程序/实用工具524,这样的程序模块525包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 521 and/or a cache storage unit 522, and may further include a read-only storage unit (ROM) 523. The storage unit 520 may also include a program/utility tool 524 having a set of (at least one) program module 525. Such program module 525 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
总线530可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。The bus 530 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
电子设备500也可以与一个或多个外部设备570(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备500交互的设备通信,和/或与使得该电子设备500能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口550进行。并且,电子设备500还可以通过网络适配器560与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器560通过总线530与电子设备500的其它模块通信。应当明白,尽管图中未示出,但可以结合电子设备500使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 500 may also communicate with one or more external devices 570 (such as keyboards, pointing devices, Bluetooth devices, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 500, and/or communicate with Any device (such as a router, modem, etc.) that enables the electronic device 500 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 550. In addition, the electronic device 500 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 560. The network adapter 560 communicates with other modules of the electronic device 500 through the bus 530. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tapes Drives and data backup storage systems, etc.
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此, 根据本公开实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个计算机非易失性可读存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开实施例的方法。Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored in a computer non-volatile readable storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) Or on the network, several instructions are included to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
在本公开的示例性实施例中,还提供了一种计算机非易失性可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施例中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在终端设备上运行时,程序代码用于使终端设备执行本公开上述的方法实施例。In the exemplary embodiment of the present disclosure, there is also provided a computer non-volatile readable storage medium on which is stored a program product capable of implementing the above-mentioned method in this specification. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to make the terminal device execute the foregoing的方法实施例。 Example of the method.
图6示出了用于实现上述跨区块链节点的消息处理方法的程序产品600,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,如个人电脑上,运行。本公开的程序产品不限于此,计算机非易失性可读存储介质还可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Figure 6 shows a program product 600 for implementing the above-mentioned cross-blockchain node message processing method, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be used in terminal devices, such as personal On the computer, run. The program product of the present disclosure is not limited thereto, and the computer non-volatile readable storage medium may also be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
程序产品可以采用一个或多个计算机非易失性可读存储介质的任意组合。计算机非易失性可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product can adopt any combination of one or more computer non-volatile readable storage media. The computer non-volatile readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,程序设计语言包括面向对象的程序设计语言-诸如Java、C++等,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用 户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。The program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages-such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on. In the case of a remote computing device, the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).
此外,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned drawings are merely schematic illustrations of the processing included in the method according to the exemplary embodiments of the present disclosure, and are not intended for limitation. It is easy to understand that the processing shown in the above drawings does not indicate or limit the time sequence of these processings. In addition, it is easy to understand that these processes can be executed synchronously or asynchronously in multiple modules, for example.
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本公开实施例的方法。Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is limited only by the appended claims.

Claims (28)

  1. 一种跨区块链节点的消息处理方法,包括:根据区块链中的启动节点启动一消息队列监控进程,并通过所述消息队列监控进程创建对应的节点索引区;通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息;根据所述节点索引区获取所述当前消息的目标参数,并根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。A message processing method for cross-blockchain nodes includes: starting a message queue monitoring process according to the start node in the block chain, and creating a corresponding node index area through the message queue monitoring process; monitoring through the message queue The process obtains the current message in the message queue of the blockchain node; obtains the target parameter of the current message according to the node index area, and calls the corresponding system interface according to the target parameter to pass the message corresponding to the current message The node attribute of the requesting node configures the starting node; the node label field in the target file corresponding to the requesting node is updated by the node attribute of the starting node, so as to pass the message queue monitoring process in the starting node. The current message in the request node.
  2. 根据权利要求1所述的方法,其中,通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息还包括:根据预设规则对消息队列中的待处理消息进行排序生成顺序列表;通过所述消息队列监控进程按照所述顺序列表依次获取所述消息队列中的当前消息。The method according to claim 1, wherein obtaining the current messages in the message queue of the blockchain node through the message queue monitoring process further comprises: sorting and generating messages to be processed in the message queue according to preset rules Sequence list; obtain the current messages in the message queue in sequence according to the sequence list through the message queue monitoring process.
  3. 根据权利要求1所述的方法,其中,所述通过所述消息队列监控进程创建对应的节点索引区,包括:基于所述消息队列监控进程,获取预设的系统接口;根据所述系统接口创建对应的节点索引区;其中,所述节点索引区用于存储所述消息队列中所述当前消息的请求节点与所述请求节点对节点句柄的对应关系。The method according to claim 1, wherein the creating a corresponding node index area through the message queue monitoring process comprises: obtaining a preset system interface based on the message queue monitoring process; creating according to the system interface Corresponding node index area; wherein, the node index area is used to store the correspondence between the request node of the current message in the message queue and the node handle of the request node.
  4. 根据权利要求3所述的方法,其中,所述目标参数包括所述节点句柄,在根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点之前,所述方法还包括:判断所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是否为同一节点;如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是同一节点,则直接通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监 控进程处理所述请求节点中的所述当前消息。The method according to claim 3, wherein the target parameter includes the node handle, and the corresponding system interface is invoked according to the target parameter to configure the startup node through the node attribute of the request node corresponding to the current message Before, the method further includes: judging whether the requesting node of the current message and the requesting node of the previous message in the message queue are the same node; if it is determined that the requesting node of the current message is The requesting node of the previous message is the same node, then the node label field in the target file corresponding to the requesting node is updated directly through the node attribute of the initiating node, so as to be processed by the message queue monitoring process in the initiating node The current message in the request node.
  5. 根据权利要求4所述的方法,其中,所述目标参数包括所述当前消息的请求节点,在根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点之前,所述方法还包括:如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点不是同一节点,则根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区以获取所述请求节点对应的节点句柄;根据所述节点句柄调用对应的所述系统接口以通过所述当前消息的请求节点的节点属性配置所述启动节点,并通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。The method according to claim 4, wherein the target parameter includes the request node of the current message, and the corresponding system interface is invoked according to the target parameter to configure the node property of the request node corresponding to the current message. Before starting the node, the method further includes: if it is determined that the request node of the current message and the request node of the previous message in the message queue are not the same node, calling the corresponding node according to the request node of the current message. The system interface accesses the node index area to obtain the node handle corresponding to the request node; calls the corresponding system interface according to the node handle to configure the startup node through the node attributes of the request node of the current message, And update the node label field in the target file corresponding to the requesting node by the node attribute of the initiating node, so as to process the current message in the requesting node through the message queue monitoring process in the initiating node.
  6. 根据权利要求5所述的方法,其中,在根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区之后,所述方法还包括:判断所述节点索引区中是否存在所述当前消息的请求节点对应的节点句柄;如果所述节点索引区中存在所述当前消息的请求节点对应的节点句柄,则从所述节点索引区中获取所述当前消息的请求节点的节点句柄以根据所述节点句柄调用对应的所述系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;如果所述节点索引区不存在所述当前消息的请求节点对应的节点句柄,则通过所述当前消息的请求节点调用对应的所述系统接口创建所述当前消息的请求节点对应的节点句柄并存储到所述节点索引区中。The method according to claim 5, wherein, after calling the corresponding system interface to access the node index area according to the requesting node of the current message, the method further comprises: judging whether there is in the node index area The node handle corresponding to the request node of the current message; if the node handle corresponding to the request node of the current message exists in the node index area, the node of the request node of the current message is obtained from the node index area The handle is to call the corresponding system interface according to the node handle to configure the startup node through the node attributes of the request node corresponding to the current message; if the node index area does not exist in the node index area corresponding to the request node of the current message Node handle, the node handle corresponding to the request node of the current message is created by invoking the corresponding system interface by the request node of the current message and stored in the node index area.
  7. 根据权利要求1所述的方法,其中,所述通过所述消息队列监控进程处理所述当前消息还包括:基于所述消息队列监控进程,判断所述消息队列中是否有待处理的所述当前消息;如果所述消息队列中有所述当前消息,则对所述当前消息进行处理;如果所述消息队列中没有所述当前消息,则结束所述消息队列监控进程。The method according to claim 1, wherein the processing the current message through the message queue monitoring process further comprises: judging whether there is the current message to be processed in the message queue based on the message queue monitoring process If there is the current message in the message queue, the current message is processed; if there is no current message in the message queue, the message queue monitoring process is ended.
  8. 一种跨区块链节点的消息处理装置,包括:启动单元,配置为根据区块链中的启动节点启动一消息队列监控进程,并通过所述消息队列监控进程创建对应的节点索引区;获取单元,配置为通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息;更改单元,配置为根据所述节点索引区获取所述当前消息的目标参数,并根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;处理单元,配置为通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。A message processing device for cross-blockchain nodes includes: a start unit configured to start a message queue monitoring process according to the start node in the block chain, and create a corresponding node index area through the message queue monitoring process; obtain The unit is configured to obtain the current message in the message queue of the blockchain node through the message queue monitoring process; the modification unit is configured to obtain the target parameter of the current message according to the node index area, and according to the The target parameter calls the corresponding system interface to configure the startup node through the node attributes of the request node corresponding to the current message; the processing unit is configured to update the target file in the target file corresponding to the request node through the node attributes of the startup node The node label field is used to process the current message in the request node through the message queue monitoring process in the startup node.
  9. 根据权利要求8所述的装置,其中,所述获取单元配置为:根据预设规则对消息队列中的待处理消息进行排序生成顺序列表;通过所述消息队列监控进程按照所述顺序列表依次获取所述消息队列中的当前消息。8. The device according to claim 8, wherein the acquiring unit is configured to: sort the messages to be processed in the message queue according to a preset rule to generate a sequence list; and obtain sequentially according to the sequence list through the message queue monitoring process The current message in the message queue.
  10. 根据权利要求8所述的装置,其中,所述启动单元配置为:基于所述消息队列监控进程,获取预设的系统接口;根据所述系统接口创建对应的节点索引区;其中,所述节点索引区用于存储所述消息队列中所述当前消息的请求节点与所述请求节点对节点句柄的对应关系。8. The device according to claim 8, wherein the activation unit is configured to: obtain a preset system interface based on the message queue monitoring process; create a corresponding node index area according to the system interface; wherein the node The index area is used to store the correspondence between the request node of the current message in the message queue and the node handle of the request node.
  11. 根据权利要求10所述的装置,其中,所述目标参数包括所述节点句柄,所述更改单元包括:判断单元,配置为判断所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是否为同一节点;节点属性修改单元,配置为如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是同一节点,则直接通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。The device according to claim 10, wherein the target parameter includes the node handle, and the modification unit includes: a judging unit configured to judge the request node of the current message and the previous message in the message queue Whether the requesting node of is the same node; the node attribute modification unit is configured to directly pass the node of the initiating node if it is determined that the requesting node of the current message and the requesting node of the previous message in the message queue are the same node The attribute updates the node label field in the target file corresponding to the request node to process the current message in the request node through the message queue monitoring process in the start node.
  12. 根据权利要求11所述的装置,其中,节点属性修改单元包括:访 问单元,被配置为如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点不是同一节点,则根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区以获取所述请求节点对应的节点句柄;根据所述节点句柄调用对应的所述系统接口以通过所述当前消息的请求节点的节点属性配置所述启动节点,并通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。The apparatus according to claim 11, wherein the node attribute modification unit comprises: an access unit configured to, if it is determined that the request node of the current message and the request node of the previous message in the message queue are not the same node, then According to the request node of the current message, call the corresponding system interface to access the node index area to obtain the node handle corresponding to the request node; according to the node handle, call the corresponding system interface to pass the current message The node attribute of the requesting node configures the starting node, and the node label field in the target file corresponding to the requesting node is updated through the node attribute of the starting node to monitor the process through the message queue in the starting node Process the current message in the requesting node.
  13. 根据权利要求12所述的装置,其中,所述装置还被配置为:判断所述节点索引区中是否存在所述当前消息的请求节点对应的节点句柄;如果所述节点索引区中存在所述当前消息的请求节点对应的节点句柄,则从所述节点索引区中获取所述当前消息的请求节点的节点句柄以根据所述节点句柄调用对应的所述系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;如果所述节点索引区不存在所述当前消息的请求节点对应的节点句柄,则通过所述当前消息的请求节点调用对应的所述系统接口创建所述当前消息的请求节点对应的节点句柄并存储到所述节点索引区中。The apparatus according to claim 12, wherein the apparatus is further configured to: determine whether there is a node handle corresponding to the requesting node of the current message in the node index area; if the node index area exists in the node handle The node handle corresponding to the requesting node of the current message is obtained from the node index area to call the corresponding system interface according to the node handle to pass the corresponding node of the current message The node attribute of the requesting node configures the startup node; if the node handle corresponding to the requesting node of the current message does not exist in the node index area, the requesting node of the current message calls the corresponding system interface to create the The node handle corresponding to the request node of the current message is stored in the node index area.
  14. 根据权利要求8所述的装置,其中,所述处理单元被配置为:基于所述消息队列监控进程,判断所述消息队列中是否有待处理的所述当前消息;如果所述消息队列中有所述当前消息,则对所述当前消息进行处理;如果所述消息队列中没有所述当前消息,则结束所述消息队列监控进程。8. The device according to claim 8, wherein the processing unit is configured to: based on the message queue monitoring process, determine whether there is the current message to be processed in the message queue; if there is a message in the message queue If the current message is described, the current message is processed; if there is no current message in the message queue, the message queue monitoring process is ended.
  15. 一种电子设备,包括:处理器;以及存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时实现如下步骤:An electronic device includes: a processor; and a memory on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the following steps are implemented:
    根据区块链中的启动节点启动一消息队列监控进程,并通过所述消息队列监控进程创建对应的节点索引区;通过所述消息队列监 控进程获取所述区块链节点的消息队列中的当前消息;根据所述节点索引区获取所述当前消息的目标参数,并根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。Start a message queue monitoring process according to the startup node in the blockchain, and create a corresponding node index area through the message queue monitoring process; obtain the current information in the message queue of the blockchain node through the message queue monitoring process Message; obtain the target parameter of the current message according to the node index area, and call the corresponding system interface according to the target parameter to configure the startup node through the node attributes of the request node corresponding to the current message; The node attribute of the initiating node updates the node label field in the target file corresponding to the requesting node to process the current message in the requesting node through the message queue monitoring process in the initiating node.
  16. 根据权利要求15所述的电子设备,其中,在通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息的步骤中,所述处理器被配置为:根据预设规则对消息队列中的待处理消息进行排序生成顺序列表;通过所述消息队列监控进程按照所述顺序列表依次获取所述消息队列中的当前消息。The electronic device according to claim 15, wherein, in the step of obtaining the current message in the message queue of the blockchain node through the message queue monitoring process, the processor is configured to: according to a preset rule The messages to be processed in the message queue are sorted to generate a sequence list; and the current messages in the message queue are sequentially acquired according to the sequence list through the message queue monitoring process.
  17. 根据权利要求15所述的电子设备,其中,在所述通过所述消息队列监控进程创建对应的节点索引区的步骤中,所述处理器被配置为:基于所述消息队列监控进程,获取预设的系统接口;根据所述系统接口创建对应的节点索引区;其中,所述节点索引区用于存储所述消息队列中所述当前消息的请求节点与所述请求节点对节点句柄的对应关系。The electronic device according to claim 15, wherein, in the step of creating a corresponding node index area through the message queue monitoring process, the processor is configured to: obtain a preview based on the message queue monitoring process Set the system interface; create a corresponding node index area according to the system interface; wherein the node index area is used to store the corresponding relationship between the request node of the current message in the message queue and the node handle of the request node .
  18. 根据权利要求17所述的电子设备,其中,在所述目标参数包括所述节点句柄,在根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点的步骤之前,所述处理器还被配置为:The electronic device according to claim 17, wherein the target parameter includes the node handle, and the corresponding system interface is invoked according to the target parameter to configure the node attribute of the request node corresponding to the current message Before the step of starting the node, the processor is further configured to:
    判断所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是否为同一节点;如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是同一节点,则直接通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。Determine whether the request node of the current message and the request node of the previous message in the message queue are the same node; if it is determined that the request node of the current message is the same as the request node of the previous message in the message queue Node, then directly update the node label field in the target file corresponding to the request node through the node attribute of the initiating node, so as to process the request node in the request node through the message queue monitoring process in the initiating node Current news.
  19. 根据权利要求18所述的电子设备,其中,在所述目标参数包括所述当前消息的请求节点,在根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点的步骤之前,所述处理器还被配置为:The electronic device according to claim 18, wherein, when the target parameter includes the request node of the current message, the corresponding system interface is called according to the target parameter to pass the node attribute of the request node corresponding to the current message Before the step of configuring the startup node, the processor is further configured to:
    如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点不是同一节点,则根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区以获取所述请求节点对应的节点句柄;根据所述节点句柄调用对应的所述系统接口以通过所述当前消息的请求节点的节点属性配置所述启动节点,并通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。If it is determined that the requesting node of the current message and the requesting node of the previous message in the message queue are not the same node, call the corresponding system interface according to the requesting node of the current message to access the node index area to obtain The node handle corresponding to the request node; according to the node handle, the corresponding system interface is invoked to configure the startup node through the node attributes of the request node of the current message, and update the startup node through the node attributes of the startup node The node label field in the target file corresponding to the request node is used to process the current message in the request node through the message queue monitoring process in the start node.
  20. 根据权利要求19所述的电子设备,其中,在所述在根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区的步骤之后,所述处理器还被配置为:The electronic device according to claim 19, wherein, after the step of invoking the corresponding system interface to access the node index area by the requesting node of the current message, the processor is further configured to:
    判断所述节点索引区中是否存在所述当前消息的请求节点对应的节点句柄;如果所述节点索引区中存在所述当前消息的请求节点对应的节点句柄,则从所述节点索引区中获取所述当前消息的请求节点的节点句柄以根据所述节点句柄调用对应的所述系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;如果所述节点索引区不存在所述当前消息的请求节点对应的节点句柄,则通过所述当前消息的请求节点调用对应的所述系统接口创建所述当前消息的请求节点对应的节点句柄并存储到所述节点索引区中。Determine whether there is a node handle corresponding to the request node of the current message in the node index area; if there is a node handle corresponding to the request node of the current message in the node index area, obtain it from the node index area The node handle of the requesting node of the current message to call the corresponding system interface according to the node handle to configure the startup node through the node attributes of the requesting node corresponding to the current message; if the node index area does not exist The node handle corresponding to the request node of the current message is then invoked by the request node of the current message to call the corresponding system interface to create the node handle corresponding to the request node of the current message and store it in the node index area.
  21. 根据权利要求15所述的电子设备,其中,在所述通过所述消息队列监控进程处理所述当前消息的步骤中,所述处理器还被配置为:The electronic device according to claim 15, wherein, in the step of processing the current message through the message queue monitoring process, the processor is further configured to:
    基于所述消息队列监控进程,判断所述消息队列中是否有待处理 的所述当前消息;如果所述消息队列中有所述当前消息,则对所述当前消息进行处理;如果所述消息队列中没有所述当前消息,则结束所述消息队列监控进程。Based on the message queue monitoring process, it is determined whether there is the current message to be processed in the message queue; if the current message is in the message queue, the current message is processed; if the message queue is in If there is no current message, the message queue monitoring process ends.
  22. 一种计算机非易失性可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer non-volatile readable storage medium on which a computer program is stored, wherein the computer program is executed by a processor to implement the following steps:
    根据区块链中的启动节点启动一消息队列监控进程,并通过所述消息队列监控进程创建对应的节点索引区;通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息;根据所述节点索引区获取所述当前消息的目标参数,并根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。Start a message queue monitoring process according to the startup node in the blockchain, and create a corresponding node index area through the message queue monitoring process; obtain the current message queue of the blockchain node through the message queue monitoring process Message; obtain the target parameter of the current message according to the node index area, and call the corresponding system interface according to the target parameter to configure the startup node through the node attributes of the request node corresponding to the current message; The node attribute of the initiating node updates the node label field in the target file corresponding to the requesting node to process the current message in the requesting node through the message queue monitoring process in the initiating node.
  23. 根据权利要求22所述的计算机非易失性可读存储介质,其中,在所述通过所述消息队列监控进程获取所述区块链节点的消息队列中的当前消息的步骤中,所述处理器还被配置为:The computer non-volatile readable storage medium according to claim 22, wherein, in the step of acquiring the current message in the message queue of the blockchain node through the message queue monitoring process, the processing The device is also configured to:
    根据预设规则对消息队列中的待处理消息进行排序生成顺序列表;通过所述消息队列监控进程按照所述顺序列表依次获取所述消息队列中的当前消息。The messages to be processed in the message queue are sorted according to a preset rule to generate a sequence list; the current messages in the message queue are sequentially acquired according to the sequence list through the message queue monitoring process.
  24. 根据权利要求22所述的计算机非易失性可读存储介质,其中,在所述通过所述消息队列监控进程创建对应的节点索引区的步骤中,所述处理器被配置为:The computer non-volatile readable storage medium according to claim 22, wherein, in the step of creating a corresponding node index area through the message queue monitoring process, the processor is configured to:
    基于所述消息队列监控进程,获取预设的系统接口;根据所述系统接口创建对应的节点索引区;其中,所述节点索引区用于存储所述消息队列中所述当前消息的请求节点与所述请求节点对节点句柄的对应关系。Obtain a preset system interface based on the message queue monitoring process; create a corresponding node index area according to the system interface; wherein the node index area is used to store the request node of the current message in the message queue and The corresponding relationship between the request node and the node handle.
  25. 根据权利要求24所述的计算机非易失性可读存储介质,其中,所 述目标参数包括所述节点句柄,在所述在根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点的步骤之前,所述处理器还被配置为:The computer non-volatile readable storage medium according to claim 24, wherein the target parameter includes the node handle, and the corresponding system interface is called according to the target parameter to correspond to the current message Before the step of requesting the node attributes of the node to configure the starting node, the processor is further configured to:
    判断所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是否为同一节点;如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点是同一节点,则直接通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。Determine whether the request node of the current message and the request node of the previous message in the message queue are the same node; if it is determined that the request node of the current message is the same as the request node of the previous message in the message queue Node, then directly update the node label field in the target file corresponding to the request node through the node attribute of the initiating node, so as to process the request node in the request node through the message queue monitoring process in the initiating node Current news.
  26. 根据权利要求25所述的计算机非易失性可读存储介质,其中,所述目标参数包括所述当前消息的请求节点,所述在根据所述目标参数调用对应的系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点的步骤之前,所述处理器还被配置为:The computer non-volatile readable storage medium according to claim 25, wherein the target parameter includes the request node of the current message, and the corresponding system interface is called according to the target parameter to pass the current message Before the step of configuring the starting node with the node attributes of the requesting node corresponding to the message, the processor is further configured to:
    如果确定所述当前消息的请求节点与所述消息队列中的前一消息的请求节点不是同一节点,则根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区以获取所述请求节点对应的节点句柄;根据所述节点句柄调用对应的所述系统接口以通过所述当前消息的请求节点的节点属性配置所述启动节点,并通过所述启动节点的节点属性更新所述请求节点对应的目标文件中的节点标签字段,以通过所述启动节点中的所述消息队列监控进程处理所述请求节点中的所述当前消息。If it is determined that the requesting node of the current message and the requesting node of the previous message in the message queue are not the same node, call the corresponding system interface according to the requesting node of the current message to access the node index area to obtain The node handle corresponding to the request node; according to the node handle, the corresponding system interface is invoked to configure the startup node through the node attributes of the request node of the current message, and update the startup node through the node attributes of the startup node The node label field in the target file corresponding to the request node is used to process the current message in the request node through the message queue monitoring process in the start node.
  27. 根据权利要求26所述的计算机非易失性可读存储介质,其中,在根据所述当前消息的请求节点调用对应的所述系统接口访问所述节点索引区的步骤之后,所述处理器还被配置为:The computer non-volatile readable storage medium according to claim 26, wherein, after the step of calling the corresponding system interface to access the node index area according to the requesting node of the current message, the processor further Is configured as:
    判断所述节点索引区中是否存在所述当前消息的请求节点对应的节点句柄;如果所述节点索引区中存在所述当前消息的请求节点对应的节点句柄,则从所述节点索引区中获取所述当前消息的请 求节点的节点句柄以根据所述节点句柄调用对应的所述系统接口以通过所述当前消息对应的请求节点的节点属性配置所述启动节点;如果所述节点索引区不存在所述当前消息的请求节点对应的节点句柄,则通过所述当前消息的请求节点调用对应的所述系统接口创建所述当前消息的请求节点对应的节点句柄并存储到所述节点索引区中。Determine whether there is a node handle corresponding to the request node of the current message in the node index area; if there is a node handle corresponding to the request node of the current message in the node index area, obtain it from the node index area The node handle of the requesting node of the current message to call the corresponding system interface according to the node handle to configure the startup node through the node attributes of the requesting node corresponding to the current message; if the node index area does not exist The node handle corresponding to the request node of the current message is then invoked by the request node of the current message to call the corresponding system interface to create the node handle corresponding to the request node of the current message and store it in the node index area.
  28. 根据权利要求22所述的计算机非易失性可读存储介质,其中,在所述通过所述消息队列监控进程处理所述当前消息的步骤中,所述处理器还被配置为:The computer non-volatile readable storage medium according to claim 22, wherein, in the step of processing the current message through the message queue monitoring process, the processor is further configured to:
    基于所述消息队列监控进程,判断所述消息队列中是否有待处理的所述当前消息;如果所述消息队列中有所述当前消息,则对所述当前消息进行处理;如果所述消息队列中没有所述当前消息,则结束所述消息队列监控进程。Based on the message queue monitoring process, it is determined whether there is the current message to be processed in the message queue; if the current message is in the message queue, the current message is processed; if the message queue is in If there is no current message, the message queue monitoring process ends.
PCT/CN2019/118085 2019-08-02 2019-11-13 Message processing method for cross-block chain node, device, apparatus and medium WO2021022714A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910713843.9A CN110609755A (en) 2019-08-02 2019-08-02 Message processing method, device, equipment and medium for cross-block chain node
CN201910713843.9 2019-08-02

Publications (1)

Publication Number Publication Date
WO2021022714A1 true WO2021022714A1 (en) 2021-02-11

Family

ID=68890909

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118085 WO2021022714A1 (en) 2019-08-02 2019-11-13 Message processing method for cross-block chain node, device, apparatus and medium

Country Status (2)

Country Link
CN (1) CN110609755A (en)
WO (1) WO2021022714A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11212371B2 (en) * 2018-12-25 2021-12-28 Advanced New Technologies Co., Ltd. Operation request allocation methods, apparatuses, and devices

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111510484B (en) * 2020-04-10 2023-07-04 金蝶软件(中国)有限公司 Block chain processing method, system, device, computer equipment and storage medium
CN111967229A (en) * 2020-09-01 2020-11-20 申建常 Efficient label type data analysis method and analysis system
CN113079081B (en) 2020-09-25 2022-08-02 支付宝(杭州)信息技术有限公司 Message transmission method and device
CN111930443B (en) * 2020-10-15 2020-12-18 杭州云链趣链数字科技有限公司 Operation and maintenance method, system, computer equipment and storage medium based on block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609010A (en) * 2017-07-27 2018-01-19 北京瑞卓喜投科技发展有限公司 Information processing method and device based on block chain technology
CN107632893A (en) * 2016-08-11 2018-01-26 泰康保险集团股份有限公司 Message queue processing method and processing device
CN108415784A (en) * 2018-02-27 2018-08-17 阿里巴巴集团控股有限公司 The exchange method and device, system, electronic equipment of transregional piece of chain
US20190197130A1 (en) * 2017-12-21 2019-06-27 Microsoft Technology Licensing, Llc Ensuring consistency in distributed incremental content publishing
CN109995666A (en) * 2019-04-12 2019-07-09 深圳市元征科技股份有限公司 A kind of method for message transmission and relevant apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985757B (en) * 2017-11-27 2021-03-30 京东数字科技控股有限公司 Information processing method, device and system, storage medium and electronic equipment
CN109634800A (en) * 2018-10-19 2019-04-16 深圳平安财富宝投资咨询有限公司 Data processing method, system, terminal and readable storage medium storing program for executing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632893A (en) * 2016-08-11 2018-01-26 泰康保险集团股份有限公司 Message queue processing method and processing device
CN107609010A (en) * 2017-07-27 2018-01-19 北京瑞卓喜投科技发展有限公司 Information processing method and device based on block chain technology
US20190197130A1 (en) * 2017-12-21 2019-06-27 Microsoft Technology Licensing, Llc Ensuring consistency in distributed incremental content publishing
CN108415784A (en) * 2018-02-27 2018-08-17 阿里巴巴集团控股有限公司 The exchange method and device, system, electronic equipment of transregional piece of chain
CN109995666A (en) * 2019-04-12 2019-07-09 深圳市元征科技股份有限公司 A kind of method for message transmission and relevant apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11212371B2 (en) * 2018-12-25 2021-12-28 Advanced New Technologies Co., Ltd. Operation request allocation methods, apparatuses, and devices

Also Published As

Publication number Publication date
CN110609755A (en) 2019-12-24

Similar Documents

Publication Publication Date Title
WO2021022714A1 (en) Message processing method for cross-block chain node, device, apparatus and medium
US10467232B2 (en) Searching documentation across interconnected nodes in a distributed network
US7716061B2 (en) Method and apparatus for obtaining status information in a grid
US11403117B2 (en) Methods for processing mini program, and related devices
WO2023109138A1 (en) Method and apparatus for starting android application in linux system, and electronic device
KR101618476B1 (en) Distributed resource management in a portable computing device
US20070240150A1 (en) Simplifying installation of a suite of software products
US11237888B2 (en) Message processing method and system, storage medium and electronic device
JP4233635B2 (en) Apparatus and method for providing persistence to an application interface
WO2021022710A1 (en) Message queue processing method, device, electronic apparatus, and computer readable non-volatile storage medium
JP2017535842A (en) Simplify calling the import procedure to transfer data from the data source to the data target
CN112506854B (en) Page template file storage and page generation methods, devices, equipment and media
CN113448756B (en) Inter-process communication system and method and computing device
CN112395107A (en) Tax control equipment control method and device, storage medium and electronic equipment
JP4336363B2 (en) Business process execution method, business process execution system, and program
KR20220151585A (en) Business data processing method, apparatus, electronic apparatus, storage media and computer program
CN114726789A (en) Method, device, equipment and medium for traffic management and traffic management policy configuration
EP2751687B1 (en) Method and system for managing parallel resource requests in a portable computing device
WO2023169193A1 (en) Method and device for generating smart contract
EP3995973A2 (en) File moving method, apparatus, and medium
US20220229858A1 (en) Multi-cloud object store access
CN107632893B (en) Message queue processing method and device
EP3951687A2 (en) Business content output method, apparatus, storage medium and program product
CN115145652A (en) Method, device, equipment and medium for creating data processing task
US20220012050A1 (en) Mini program batch processing method and apparatus, electronic device, 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: 19940638

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19940638

Country of ref document: EP

Kind code of ref document: A1