Movatterモバイル変換


[0]ホーム

URL:


CN109032819A - Synchronous method, device, equipment and the storage medium of message event between a kind of system - Google Patents

Synchronous method, device, equipment and the storage medium of message event between a kind of system
Download PDF

Info

Publication number
CN109032819A
CN109032819ACN201810844922.9ACN201810844922ACN109032819ACN 109032819 ACN109032819 ACN 109032819ACN 201810844922 ACN201810844922 ACN 201810844922ACN 109032819 ACN109032819 ACN 109032819A
Authority
CN
China
Prior art keywords
event
message
slave system
instruction
acquisition instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810844922.9A
Other languages
Chinese (zh)
Other versions
CN109032819B (en
Inventor
马旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co LtdfiledCriticalZhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810844922.9ApriorityCriticalpatent/CN109032819B/en
Publication of CN109032819ApublicationCriticalpatent/CN109032819A/en
Application grantedgrantedCritical
Publication of CN109032819BpublicationCriticalpatent/CN109032819B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请公开了一种系统间消息事件的同步方法,在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将在上一次发送获取指令之后开始计时的当前的计时时间设置为预设周期时间;接收从系统根据获取指令获取的对应的消息事件,可见,本申请通过在预设周期时间的基础上进一步根据触发指令发送获取指令,从而更及时地获取对应的消息事件,提高同步消息事件的效率;并且通过将检测到触发指令的当前的计时时间设置为预设周期时间,避免了频繁地发送获取指令,从而提高系统的稳定性。本申请还公开了一种系统间消息事件的同步装置、设备及计算机可读存储介质,均具有上述有益效果。

This application discloses a method for synchronizing message events between systems. In the thread that sends an acquisition command to the slave system according to the preset cycle time, if a trigger command is detected, the current time will start counting after the last time the acquisition command was sent. The timing time is set to the preset cycle time; receiving the corresponding message event obtained from the system according to the acquisition instruction, it can be seen that the application further obtains the corresponding message event in a more timely manner by sending the acquisition instruction according to the trigger instruction on the basis of the preset cycle time. Message events, improve the efficiency of synchronous message events; and by setting the current timing time when the trigger command is detected as the preset cycle time, frequent sending and acquisition commands are avoided, thereby improving the stability of the system. The present application also discloses a synchronization device, device and computer-readable storage medium for inter-system message events, all of which have the above-mentioned advantageous effects.

Description

Translated fromChinese
一种系统间消息事件的同步方法、装置、设备及存储介质Method, device, equipment and storage medium for synchronizing message events between systems

技术领域technical field

本发明涉及信息传输领域,特别涉及一种系统间消息事件的同步方法、装置、设备及计算机可读存储介质。The invention relates to the field of information transmission, in particular to a method, device, equipment and computer-readable storage medium for synchronizing message events between systems.

背景技术Background technique

在系统间的消息处理过程中,消息事件的同步是两个系统间状态同步、指令下发等功能实现的基础。在现有技术中,主系统根据预设周期时间向从系统发送获取指令,从而获取从系统上消息队列中的消息事件。但是,在此方法中,由于从系统的消息队列增加消息事件的时间和数量都是随机的,因此若设置的预设周期时间过长,将导致主系统获取从系统的消息事件不及时,使得从系统上消息事件的堆积,降低消息事件的处理效率;若预设周期时间过短,主系统频繁地向从系统发送获取指令,将占用大量的系统资源,导致系统不稳定。In the process of message processing between systems, the synchronization of message events is the basis for the realization of functions such as state synchronization and command delivery between the two systems. In the prior art, the master system sends an acquisition instruction to the slave system according to a preset cycle time, so as to acquire message events in the message queue on the slave system. However, in this method, since the message queue of the slave system increases the time and quantity of message events randomly, if the preset cycle time is too long, the master system will not obtain the message events of the slave system in time, making The accumulation of message events on the slave system reduces the processing efficiency of message events; if the preset cycle time is too short, the master system frequently sends acquisition instructions to the slave system, which will occupy a large amount of system resources and cause system instability.

因此,如何提供一种在保证系统稳定的前提下,能够及时高效地同步系统间消息事件的方法是本领域技术人员目前需要解决的技术问题。Therefore, how to provide a method capable of timely and efficiently synchronizing message events between systems under the premise of ensuring system stability is a technical problem to be solved by those skilled in the art.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种系统间消息事件的同步方法,能够在保证系统稳定的前提下,及时高效地同步系统间的消息事件;本发明的另一目的是提供一种系统间消息事件的同步装置、设备及计算机可读存储介质,均具有上述有益效果。In view of this, the purpose of the present invention is to provide a method for synchronizing message events between systems, which can synchronize message events between systems in a timely and efficient manner under the premise of ensuring system stability; another purpose of the present invention is to provide a system The synchronizing device, device and computer-readable storage medium for inter-message events all have the above-mentioned beneficial effects.

为解决上述技术问题,本发明提供一种系统间消息事件的同步方法,包括:In order to solve the above technical problems, the present invention provides a method for synchronizing message events between systems, including:

在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将当前的计时时间设置为所述预设周期时间;其中,所述计时时间是在发送所述获取指令后开始计时;In the thread that sends the acquisition instruction to the slave system according to the preset cycle time, if a trigger instruction is detected, the current timing time is set as the preset cycle time; wherein, the timing time is when the acquisition instruction is sent start timing after

接收所述从系统根据所述获取指令获取的对应的消息事件。receiving the corresponding message event acquired by the slave system according to the acquisition instruction.

优选地,所述触发指令具体包括检测到业务需求时生成的指令。Preferably, the trigger instruction specifically includes an instruction generated when a business requirement is detected.

优选地,进一步包括:Preferably, further comprising:

预先分别设置主系统事件ID和从系统事件ID;Set the main system event ID and the slave system event ID respectively in advance;

对应的,所述获取指令的生成方式具体包括:Correspondingly, the method for generating the acquisition instruction specifically includes:

根据所述业务需求向所述从系统发送包含所述主系统事件ID或标识ID的查询指令;Sending a query command including the master system event ID or identification ID to the slave system according to the business requirement;

接收所述从系统根据所述主系统事件ID或所述标识ID判断出的对应类型的异常事件;receiving the abnormal event of the corresponding type judged by the slave system according to the master system event ID or the identification ID;

根据所述异常事件的类型生成对应的包含所述主系统事件ID或所述标识ID的所述获取指令。Generate the corresponding acquisition instruction including the main system event ID or the identification ID according to the type of the abnormal event.

优选地,所述接收所述从系统根据所述主系统事件ID或所述标识ID判断出的异常事件具体包括:Preferably, the receiving the abnormal event judged by the slave system according to the main system event ID or the identification ID specifically includes:

若所述查询指令包含所述标识ID或所述查询指令包含所述主系统事件ID且所述主系统事件ID大于所述从系统事件ID,则接收所述从系统发送的第一异常事件;If the query command includes the identification ID or the query command includes the master system event ID and the master system event ID is greater than the slave system event ID, then receive the first abnormal event sent by the slave system;

对应的,所述根据所述异常事件的类型生成对应的包含所述主系统事件ID或所述标识ID的所述获取指令具体为根据所述第一异常事件生成包含所述标识ID的所述获取指令;Correspondingly, the generating the corresponding acquisition instruction including the main system event ID or the identification ID according to the type of the abnormal event is specifically generating the acquisition instruction including the identification ID according to the first abnormal event. Get instructions;

对应的,所述接收所述从系统根据所述获取指令获取的对应的消息事件具体为接收所述从系统根据所述标识ID获取的当前全部消息事件;Correspondingly, the receiving the corresponding message events obtained by the slave system according to the acquisition instruction is specifically receiving all current message events obtained by the slave system according to the identification ID;

若所述查询指令包含所述主系统事件ID且所述主系统事件ID小于所述从系统事件ID,则接收所述从系统发送的第二异常事件;If the query command includes the event ID of the master system and the event ID of the master system is smaller than the event ID of the slave system, then receive the second abnormal event sent by the slave system;

对应的,所述根据所述异常事件的类型生成对应的包含所述主系统事件ID或所述标识ID的所述获取指令具体为根据所述第二异常事件生成包含所述主系统事件ID的获取指令;Correspondingly, the generating the corresponding acquisition instruction including the main system event ID or the identification ID according to the type of the abnormal event is specifically generating the instruction including the main system event ID according to the second abnormal event Get instructions;

对应的,所述接收所述从系统根据所述获取指令获取的对应的消息事件具体为:Correspondingly, the receiving the corresponding message event obtained from the slave system according to the obtaining instruction is specifically:

接收所述从系统根据所述从系统事件ID与所述主系统事件ID的差值获取的新增消息事件。receiving the newly added message event acquired by the slave system according to the difference between the event ID of the slave system and the event ID of the master system.

优选地,所述触发指令进一步包括接收到所述从系统发送的通知消息时生成的指令;Preferably, the trigger instruction further includes an instruction generated when the notification message sent from the system is received;

对应的,所述获取指令的生成方式具体为:Correspondingly, the generation method of the acquisition instruction is specifically as follows:

根据所述通知消息的性质生成对应的获取指令。A corresponding acquisition instruction is generated according to the nature of the notification message.

优选地,所述触发指令进一步包括接收到所述从系统中所述消息事件的数量达到预设的消息队列的长度阈值时的产生的指令;Preferably, the trigger instruction further includes an instruction generated when the number of message events in the slave system reaches a preset message queue length threshold;

对应的,所述获取指令的生成方式具体为:Correspondingly, the generation method of the acquisition instruction is specifically as follows:

根据预设规则生成获取所述从系统当前全部消息事件的获取指令。An acquisition instruction for acquiring all current message events of the slave system is generated according to a preset rule.

优选地,在所述接收所述从系统根据所述获取指令获取的对应的消息事件之后进一步包括:Preferably, after receiving the corresponding message event obtained from the slave system according to the obtaining instruction, the method further includes:

删除所述从系统的所述消息事件。Delete said message event from said slave system.

为解决上述技术问题,本发明还提供一种系统间消息事件的同步装置,包括:In order to solve the above technical problems, the present invention also provides a synchronization device for message events between systems, including:

发送模块,用于在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将当前的计时时间设置为所述预设周期时间;其中,所述计时时间是在发送所述获取指令后开始计时;The sending module is used to send the acquisition instruction to the slave system according to the preset cycle time. If a trigger instruction is detected, the current timing time is set as the preset cycle time; wherein the timing time is at Start timing after sending the acquiring instruction;

接收模块,用于接收所述从系统根据所述获取指令获取的对应的消息事件。The receiving module is configured to receive the corresponding message event acquired by the slave system according to the acquisition instruction.

为解决上述技术问题,本发明还提供一种系统间消息事件的同步设备,包括:In order to solve the above technical problems, the present invention also provides a synchronization device for message events between systems, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现上述任一种系统间消息事件的同步方法的步骤。A processor, configured to implement the steps of any one of the above methods for synchronizing message events between systems when executing the computer program.

为解决上述技术问题,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种系统间消息事件的同步方法的步骤。In order to solve the above-mentioned technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned inter-system message events can be implemented. The steps of the synchronization method.

本发明提供的一种系统间消息事件的同步方法,相较于现有技术中只能根据预设周期时间获取从系统的消息事件的方法,本发明在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将在上一次发送获取指令之后开始计时的当前的计时时间设置为预设周期时间;接收从系统根据获取指令获取的对应的消息事件,可见,本发明通过在预设周期时间的基础上进一步根据触发指令发送获取指令,从而更及时地获取对应的消息事件,提高同步消息事件的效率;并且通过将检测到触发指令的当前的计时时间设置为预设周期时间,避免了频繁地发送获取指令,从而提高系统的稳定性。The method for synchronizing message events between systems provided by the present invention is compared with the method in the prior art which can only obtain message events from the slave system according to the preset cycle time. In the instruction thread, if a trigger instruction is detected, the current timing time that started timing after the last acquisition instruction is sent is set as the preset cycle time; receiving the corresponding message event obtained from the system according to the acquisition instruction, it can be seen that this The invention further sends acquisition instructions according to the trigger instruction on the basis of the preset cycle time, thereby obtaining the corresponding message event in a more timely manner and improving the efficiency of synchronizing message events; and by setting the current timing time when the trigger instruction is detected as the preset The cycle time is set to avoid frequent sending and acquisition instructions, thereby improving the stability of the system.

为解决上述技术问题,本发明还提供了一种系统间消息事件的同步装置、设备及计算机可读存储介质,均具有上述有益效果。In order to solve the above-mentioned technical problems, the present invention also provides an inter-system message event synchronization device, device and computer-readable storage medium, all of which have the above-mentioned beneficial effects.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or prior art. Obviously, the accompanying drawings in the following description are only For some embodiments of the present invention, those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本发明实施例提供的一种系统间消息事件的同步方法的流程图;FIG. 1 is a flow chart of a method for synchronizing message events between systems provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种系统间消息事件的同步方法中获取指令的生成方式的流程图;FIG. 2 is a flowchart of a method for generating an acquisition instruction in another method for synchronizing message events between systems provided by an embodiment of the present invention;

图3为本发明实施例提供的一种消息队列处理过程示意图;FIG. 3 is a schematic diagram of a message queue processing process provided by an embodiment of the present invention;

图4为本发明实施例提供的一种系统间消息事件的同步装置的结构图;FIG. 4 is a structural diagram of an apparatus for synchronizing message events between systems according to an embodiment of the present invention;

图5为本发明实施例提供的一种系统间消息事件的同步设备的结构图。Fig. 5 is a structural diagram of a device for synchronizing message events between systems according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明实施例的核心是提供一种系统间消息事件的同步方法,能够在保证系统稳定的前提下,及时高效地同步系统间的消息事件;本发明的另一核心是提供一种系统间消息事件的同步装置、设备及计算机可读存储介质,均具有上述有益效果。The core of the embodiment of the present invention is to provide a method for synchronizing message events between systems, which can synchronize message events between systems in a timely and efficient manner under the premise of ensuring system stability; another core of the present invention is to provide an inter-system message event The event synchronization device, device, and computer-readable storage medium all have the above-mentioned beneficial effects.

为了使本领域技术人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

图1为本发明实施例提供的一种系统间消息事件的同步方法的流程图,如图1所示,一种系统间消息事件的同步方法包括:FIG. 1 is a flowchart of a method for synchronizing message events between systems provided by an embodiment of the present invention. As shown in FIG. 1 , a method for synchronizing message events between systems includes:

S10:在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将当前的计时时间设置为预设周期时间;其中,计时时间是在发送获取指令后开始计时。S10: In the thread that sends the acquisition command to the slave system according to the preset cycle time, if a trigger command is detected, the current timing time is set as the preset cycle time; wherein, the timing time is started after sending the acquisition command.

可以理解的是,系统间消息事件的同步是系统间实现状态同步、指令下发等功能的基础,因此系统间消息事件同步方法的优劣,对系统间功能的实现将产生直接的影响。在本实施例中,主系统根据预先设置的周期时间向从系统发送获取指令,并且在每次发送获取指令后开始新的计时,与此同时,也即在主系统的预设周期时间内,主系统检测当前是否存在触发指令,若检测到触发指令,则将当前的计时时间设置为预设周期时间,也即使得当前的计时时间达到发送获取指令的时间点。假设预设周期时间为5分钟,若在计时时间为3分钟时,主系统检测到触发指令,则将设置当前的计时时间为5分钟,从而使得主系统达到发送获取指令的时间,发送获取指令。可以理解的是,本实施例中的计时方式是从0开始计时,并累计到预设的周期时间,在其他的实施例中,计时方式也可以是预先设置周期时间,然后通过逐渐减少计时时间直至计时时间为0的方式,本实施例对此不做具体的限定。It can be understood that the synchronization of message events between systems is the basis for implementing functions such as state synchronization and command issuance between systems. Therefore, the advantages and disadvantages of message event synchronization methods between systems will have a direct impact on the realization of inter-system functions. In this embodiment, the master system sends acquisition instructions to the slave system according to the preset cycle time, and starts a new timing after sending the acquisition instruction each time. At the same time, that is, within the preset cycle time of the master system, The main system detects whether there is a trigger command at present, and if a trigger command is detected, the current timing time is set as the preset cycle time, that is, the current timing time reaches the time point for sending and obtaining the command. Assuming that the preset cycle time is 5 minutes, if the main system detects a trigger command when the timing time is 3 minutes, it will set the current timing time to 5 minutes, so that the main system reaches the time to send the acquisition command and send the acquisition command . It can be understood that the timing method in this embodiment starts timing from 0 and accumulates to the preset cycle time. In other embodiments, the timing method can also be to preset the cycle time, and then gradually reduce the timing time The method until the counting time is 0 is not specifically limited in this embodiment.

需要说明的是,在发送获取指令之后,重新开始周期的计时时间,以便能多次获取从系统的消息事件。若在预设周期时间内没有检测到触发指令,则在计时时间达到预设周期时间时发送获取指令,以便根据预设周期时间获取从系统中对应的消息事件。It should be noted that, after sending the acquisition instruction, the timing of the cycle is restarted, so that the message events of the slave system can be acquired multiple times. If no trigger instruction is detected within the preset cycle time, an acquisition instruction is sent when the timing time reaches the preset cycle time, so as to obtain corresponding message events from the system according to the preset cycle time.

S20:接收从系统根据获取指令获取的对应的消息事件。S20: Receive a corresponding message event obtained from the system according to the obtaining instruction.

具体的,在主系统向从系统发送获取指令后,从系统根据该获取指令从自身的消息队列中获取与获取指令对应的消息事件,并将获取到的对应的消息事件返回给主系统。需要说明的是,预先设置获取指令中的设置参数,例如获取消息事件的时间或获取消息事件的大小或获取消息事件的数量等参数,然后通过获取指令的参数获取对应的消息事件。Specifically, after the master system sends an acquisition instruction to the slave system, the slave system acquires a message event corresponding to the acquisition instruction from its own message queue according to the acquisition instruction, and returns the acquired corresponding message event to the master system. It should be noted that the setting parameters in the obtaining instruction are set in advance, such as the time to obtain the message event, the size of the obtained message event, or the number of obtained message events, etc., and then the corresponding message event is obtained through the parameter of the obtaining instruction.

本实施例中,从系统将对应的消息事件返回给主系统的具体方式为本领域技术人员的公知常识,故此处不再赘述。另外需要说明的是,本实施例中的主系统和从系统指的是进行异步信息传输的信息系统,为了在实施例的描述中区分信息的接收方与发送方,可以理解的是,信息系统中的发送方也可以是接收方,也即主系统与从系统的可以互相同步信息。另外,本实施例对主系统与从系统的数量不做限定,例如一个从系统可以将消息事件同步给多个主系统,或者一个主系统可以接收多个从系统的消息事件。In this embodiment, the specific manner in which the slave system returns the corresponding message event to the master system is common knowledge of those skilled in the art, so it will not be repeated here. In addition, it should be noted that the master system and slave system in this embodiment refer to the information system for asynchronous information transmission. In order to distinguish the receiver and sender of information in the description of the embodiment, it can be understood that the information system The sender in can also be the receiver, that is, the master system and the slave system can synchronize information with each other. In addition, this embodiment does not limit the number of master systems and slave systems. For example, one slave system can synchronize message events to multiple master systems, or one master system can receive message events from multiple slave systems.

本发明实施例提供的一种系统间消息事件的同步方法,相较于现有技术中只能根据预设周期时间获取从系统的消息事件的方法,本发明在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将在上一次发送获取指令之后开始计时的当前的计时时间设置为预设周期时间;接收从系统根据获取指令获取的对应的消息事件,可见,本发明通过在预设周期时间的基础上进一步根据触发指令发送获取指令,从而更及时地获取对应的消息事件,提高同步消息事件的效率;并且通过将检测到触发指令的当前的计时时间设置为预设周期时间,避免了频繁地发送获取指令,从而提高系统的稳定性。The embodiment of the present invention provides a method for synchronizing message events between systems. Compared with the method in the prior art that can only obtain the message events of the slave system according to the preset cycle time, the present invention sends messages to the slave system according to the preset cycle time. In the thread that sends the acquisition instruction, if a trigger instruction is detected, the current timing time that started timing after the last acquisition instruction is sent is set as the preset cycle time; the corresponding message event obtained from the system according to the acquisition instruction is received, which can be seen , the present invention further acquires the corresponding message event by sending the acquisition instruction according to the trigger instruction on the basis of the preset cycle time, thereby obtaining the corresponding message event in a more timely manner, and improving the efficiency of synchronizing the message event; and by setting the current timing time when the trigger instruction is detected The cycle time is preset to avoid frequent sending and acquisition instructions, thereby improving the stability of the system.

在上述实施例的基础上,本实施例对技术方案作了进一步的说明和优化,具体的,触发指令具体包括检测到业务需求时生成的指令。On the basis of the above embodiments, this embodiment further explains and optimizes the technical solution. Specifically, the trigger instruction specifically includes an instruction generated when a service requirement is detected.

具体的,当主系统存在业务需求时,例如需要利用从系统中的消息事件进行如计算、存储等操作时,主系统在检测到存在业务需求时则生成触发指令以便于获取从系统的对应的消息事件。Specifically, when the main system has business requirements, for example, when it is necessary to use the message events in the slave system to perform operations such as calculation and storage, the main system will generate a trigger command when detecting the existence of business needs so as to obtain the corresponding message from the slave system event.

在上述实施例的基础上,本实施例对技术方案作了进一步的说明和优化,具体的,进一步包括:On the basis of the above embodiments, this embodiment further explains and optimizes the technical solution, specifically, it further includes:

预先分别设置主系统事件ID和从系统事件ID。Set the master system event ID and slave system event ID respectively in advance.

作为优选的实施方式,本实施例通过预先在从系统中设置消息队列,从系统在接收到消息事件后,将消息事件按照预设的顺序如时间顺序放入消息队列中,并根据消息队列的顺序为每个消息事件设置唯一对应的事件ID,用于标识各个消息事件。一般的,在实际应用中,为了便于区分和计算,通常将ID设置为数值依次递增的形式,然后将最新接收到的消息事件的事件ID也即当前消息队列中数值最大的事件ID设置为从系统事件ID。在主系统获取从系统的消息事件后,主系统根据各事件ID,将最新接收到的消息事件的事件ID也即当前主系统中数值最大的事件ID设置为主系统事件ID。As a preferred implementation, this embodiment pre-sets the message queue in the slave system. After the slave system receives the message event, it puts the message event into the message queue according to the preset order such as time order, and according to the message queue The sequence sets a unique corresponding event ID for each message event, which is used to identify each message event. Generally, in practical applications, in order to facilitate the distinction and calculation, the ID is usually set in the form of increasing numerical values, and then the event ID of the latest received message event, that is, the event ID with the largest value in the current message queue, is set to start from System event ID. After the master system obtains the message events of the slave system, the master system sets the event ID of the latest received message event, that is, the event ID with the largest value in the current master system, as the event ID of the master system according to each event ID.

可见,通过设置主系统事件ID和从系统事件ID,可以更直接地判断主系统消息事件的同步情况。It can be seen that by setting the event ID of the master system and the event ID of the slave system, the synchronization of the message events of the master system can be judged more directly.

对应的,如图2所示,获取指令的生成方式具体包括:Correspondingly, as shown in Figure 2, the generation method of the acquisition instruction specifically includes:

S21:根据业务需求向从系统发送包含主系统事件ID或标识ID的查询指令。S21: Send a query command including the event ID or identification ID of the master system to the slave system according to business requirements.

具体的,在计时时间到达预设周期时间或者在检测到业务需求并生成触发指令之后,主系统向从系统发送查询指令,根据预设周期时间获取消息事件的形式或根据业务需求获取消息事件的形式,查询指令可以是包含主系统事件ID或标识ID。需要说明的是,标识ID为预先设置的表示消息事件的范围的ID,例如标识ID可以为A或者设置为-1,对应表示从系统消息队列中当前全部消息事件,标识ID也可以是表示某一类型的消息事件如带有标签的消息事件。Specifically, after the timing time reaches the preset cycle time or after detecting the business requirement and generating the trigger command, the master system sends a query command to the slave system to obtain the form of the message event according to the preset cycle time or the form of the message event according to the business requirement form, the query command can contain the main system event ID or identification ID. It should be noted that the identification ID is a pre-set ID indicating the range of message events. For example, the identification ID can be A or set to -1, correspondingly representing all current message events from the system message queue, and the identification ID can also be a certain One type of message event is a message event with a tag.

S22:接收从系统根据主系统事件ID或标识ID判断出的对应类型的异常事件。S22: Receive a corresponding type of abnormal event judged by the slave system according to the master system event ID or identification ID.

需要说明的是,主系统将包含主系统事件ID或标识ID的查询指令发送给从系统,以便于从系统根据主系统事件ID或标识ID判断异常事件的类型并将对应类型的异常事件返回给主系统。具体的,从系统根据主系统事件ID或标识ID判断当前的查询指令对应的异常事件的类型,可以是通过判断ID的类型的方式,也可以是通过比较ID之间的大小关系的方式,本实施例对此不做具体的限定。It should be noted that the master system sends a query command containing the event ID or identification ID of the main system to the slave system, so that the slave system can judge the type of abnormal event according to the event ID or identification ID of the main system and return the abnormal event of the corresponding type to the main system. Specifically, the slave system judges the type of the abnormal event corresponding to the current query command according to the main system event ID or identification ID, either by judging the type of ID or by comparing the size relationship between IDs. The embodiment does not specifically limit this.

S23:根据异常事件的类型生成对应的包含主系统事件ID或标识ID的获取指令。S23: Generate a corresponding acquisition instruction including the main system event ID or identification ID according to the type of the abnormal event.

具体的,主系统在接收到异常事件后,将根据异常事件的类型生成对应的获取指令,以获取对应的消息事件。根据异常事件的类型不同,对应需要获取的消息事件的类型和数量都可能存在差异,因此,在本实施例中,根据异常事件的类型生成对应的包含主系统事件ID或标识ID的获取指令。Specifically, after receiving the abnormal event, the main system will generate a corresponding obtaining instruction according to the type of the abnormal event, so as to obtain the corresponding message event. According to different types of abnormal events, there may be differences in the type and quantity of message events to be acquired. Therefore, in this embodiment, a corresponding acquisition instruction including the main system event ID or identification ID is generated according to the type of abnormal event.

本实施例中,通过预先分别设置主系统事件ID和从系统事件ID,并利用主系统事件ID和从系统事件ID生成获取指令,使得主系统利用获取指令获取的消息事件更加准确。In this embodiment, by setting the main system event ID and the slave system event ID respectively in advance, and using the master system event ID and the slave system event ID to generate the acquisition instruction, the message events obtained by the master system using the acquisition instruction are more accurate.

在上述实施例的基础上,本实施例对技术方案作了进一步的说明和优化,具体的,步骤“接收从系统根据主系统事件ID或标识ID判断出的异常事件”具体包括:On the basis of the above embodiments, this embodiment further explains and optimizes the technical solution. Specifically, the step of "receiving the abnormal event judged by the slave system according to the event ID or identification ID of the main system" specifically includes:

若查询指令包含标识ID或查询指令包含主系统事件ID且主系统事件ID大于从系统事件ID,则接收从系统发送的第一异常事件;If the query instruction includes the identification ID or the query instruction includes the master system event ID and the master system event ID is greater than the slave system event ID, then receive the first abnormal event sent by the slave system;

对应的,根据异常事件的类型生成对应的包含主系统事件ID或标识ID的获取指令具体为根据第一异常事件生成包含标识ID的获取指令;Correspondingly, according to the type of the abnormal event, generating a corresponding acquisition instruction including the main system event ID or identification ID is specifically generating an acquisition instruction including the identification ID according to the first abnormal event;

对应的,接收从系统根据获取指令获取的对应的消息事件具体为接收从系统根据标识ID获取的当前全部消息事件。Correspondingly, receiving the corresponding message events obtained from the slave system according to the obtaining instruction is specifically receiving all current message events obtained from the slave system according to the identification ID.

具体的,从系统在判断出查询指令中包含的是标识ID,或者查询指令包含的是主系统事件ID但是该主系统事件ID大于从系统事件ID,将生成第一异常事件并发送给主系统。主系统在接收到该第一异常事件后,按照预设规则发送包含标识ID的获取指令。由于标识ID表示的是获取从系统上当前全部的消息事件,因此从系统根据包含标识ID的获取指令,从自身的消息队列中获取全部消息事件并发送给主系统。Specifically, when the slave system judges that the query command contains the identification ID, or the query command contains the master system event ID but the master system event ID is greater than the slave system event ID, the first abnormal event will be generated and sent to the master system . After receiving the first abnormal event, the host system sends an acquisition instruction including the identification ID according to preset rules. Since the identification ID means to obtain all current message events on the slave system, the slave system obtains all message events from its own message queue and sends them to the main system according to the acquisition instruction containing the identification ID.

如图3所示的消息队列处理过程示意图,在一种具体实施中,从系统上的消息队列中消息事件的事件ID为0~4,从系统事件ID为4,主系统先使用包含有标识ID的获取指令GET(last=-1)获取从系统上消息队列中的全部消息事件events=0~4,并更新主系统事件ID为4。在从系统接收到新的消息事件之后,若主系统事件ID大于从系统事件ID,从系统将产生一个“无效参数”的第一异常事件,当主系统收到该异常事件时,主系统在下次将使用包含有标识ID的获取指令GET(last=-1)获取从系统上消息队列中的全部消息事件。The schematic diagram of the message queue processing process shown in Figure 3, in a specific implementation, the event ID of the message event in the message queue on the slave system is 0 to 4, the event ID of the slave system is 4, and the master system first uses the The ID acquisition instruction GET(last=-1) acquires all message events events=0-4 in the message queue on the slave system, and updates the main system event ID to 4. After the slave system receives a new message event, if the event ID of the master system is greater than the event ID of the slave system, the slave system will generate a first abnormal event of "invalid parameter". All message events in the message queue on the slave system will be obtained by using the get command GET(last=-1) containing the identification ID.

若查询指令包含主系统事件ID且主系统事件ID小于从系统事件ID,则接收从系统发送的第二异常事件;If the query command includes the master system event ID and the master system event ID is less than the slave system event ID, then receive the second abnormal event sent by the slave system;

对应的,根据异常事件的类型生成对应的包含主系统事件ID或标识ID的获取指令具体为根据第二异常事件生成包含主系统事件ID的获取指令;Correspondingly, generating a corresponding acquisition instruction including the main system event ID or identification ID according to the type of the abnormal event is specifically generating an acquisition instruction including the main system event ID according to the second abnormal event;

对应的,接收从系统根据获取指令获取的对应的消息事件具体为:Correspondingly, the corresponding message event received from the system according to the acquisition instruction is specifically:

接收从系统根据从系统事件ID与主系统事件ID的差值获取的新增消息事件。Receive new message events obtained from the slave system based on the difference between the event ID of the slave system and the event ID of the master system.

例如,假设从系统接收到新的消息事件之后,从系统消息事件ID更新为7,主系统事件ID仍为4,也即主系统事件ID小于从系统事件ID,则从系统发送“丢失事件”的第二异常事件,当主系统收到该第二异常事件时,主系统通过GET方法发送包含所述主系统事件ID的获取指令GET(last=4),从系统根据从系统事件ID与主系统事件ID的差值计算新增的消息事件为5、6和7,从而从系统将events=5、6和7的消息事件发送给主系统,从而完成新增信息的同步。For example, assuming that after the slave system receives a new message event, the slave system message event ID is updated to 7, and the master system event ID is still 4, that is, the master system event ID is smaller than the slave system event ID, then the slave system sends a "lost event" When the master system receives the second exception event, the master system sends the acquisition command GET (last=4) containing the event ID of the master system through the GET method. The newly added message events calculated by the difference of event IDs are 5, 6 and 7, so that the slave system sends the message events with events=5, 6 and 7 to the master system, thereby completing the synchronization of the newly added information.

可见,本实施例提供的系统间消息事件的同步方法,使得同步消息事件的方式更加准确。It can be seen that the method for synchronizing message events between systems provided by this embodiment makes the method of synchronizing message events more accurate.

在上述实施例的基础上,本实施例对技术方案作了进一步的说明和优化,具体的,触发指令进一步包括接收到从系统发送的通知消息时生成的指令;On the basis of the above embodiments, this embodiment further explains and optimizes the technical solution. Specifically, the trigger instruction further includes an instruction generated when a notification message sent from the system is received;

对应的,获取指令的生成方式具体为:Correspondingly, the generation method of the acquisition command is as follows:

根据通知消息的性质生成对应的获取指令。A corresponding acquisition instruction is generated according to the nature of the notification message.

也就是说,触发指令也可以是主系统接收到从系统发送的通知消息时生成的指令。具体的,从系统根据消息队列中的消息事件的性质例如某些消息事件为紧急事件,需要尽快地同步到主系统,因此从系统在检测到该消息事件后,生成通知指令并发送给主系统,使得主系统对应生成触发指令。更具体的,可以将该消息事件的标签信息发送给主系统,或者是将该消息事件的时间或者其他的唯一标识信息发送给主系统,以便于主系统能够及时获取对应的消息事件。That is to say, the trigger instruction may also be an instruction generated when the master system receives a notification message sent by the slave system. Specifically, according to the nature of the message events in the message queue, for example, some message events are urgent events, the slave system needs to synchronize to the master system as soon as possible, so after the slave system detects the message event, it generates a notification command and sends it to the master system , so that the host system generates a corresponding trigger command. More specifically, the tag information of the message event can be sent to the main system, or the time of the message event or other unique identification information can be sent to the main system, so that the main system can obtain the corresponding message event in time.

需要说明的是,从系统可以将该通知信息放入消息队列中以便于主系统获取,或者通过直接传输的方式将该获通知信息发送给主系统,本实施例对此不做具体的限定。作为优选的实施方式,可以预先根据各消息事件的性质为消息事件设置标签,当从系统检测到带标签的消息事件时,则生成触发指令,这样能够尽快地生成触发指令,提高同步消息事件的及时性,提高消息事件的利用效率。It should be noted that the slave system may put the notification information into a message queue for the master system to obtain, or send the notified information to the master system through direct transmission, which is not specifically limited in this embodiment. As a preferred embodiment, tags can be set for message events in advance according to the nature of each message event, and when a tagged message event is detected from the system, a trigger instruction is generated, which can generate a trigger instruction as soon as possible and improve the synchronization of message events. Timeliness, improve the utilization efficiency of message events.

在上述实施例的基础上,本实施例对技术方案作了进一步的说明和优化,具体的,触发指令进一步包括接收到从系统中消息事件的数量达到预设的消息队列的长度阈值时的产生的指令;On the basis of the above-mentioned embodiments, this embodiment further explains and optimizes the technical solution. Specifically, the trigger instruction further includes the generation when the number of message events received from the system reaches the preset message queue length threshold. instructions;

对应的,获取指令的生成方式具体为:Correspondingly, the generation method of the acquisition command is as follows:

根据预设规则生成获取从系统当前全部消息事件的获取指令。Generate an acquisition instruction for acquiring all current message events from the system according to preset rules.

具体的,当从系统的消息事件已将消息队列占满,即消息事件的数量达到预设的消息队列的长度阈值,为了让主系统能够及时处理从系统的消息事件,作为优选的实施方式,本实施例通过丢失最先存储于从系统的消息队列中的消息事件,然后产生一个异常事件,主系统在获取到该异常事件之后,将产生一个带标识ID的获取指令,以获取从系统消息队列中的当前全部消息事件。Specifically, when the message events of the slave system have filled the message queue, that is, the number of message events reaches the preset length threshold of the message queue, in order to allow the master system to process the message events of the slave system in a timely manner, as a preferred embodiment, In this embodiment, by losing the message event first stored in the message queue of the slave system, an abnormal event is generated. After the master system obtains the abnormal event, it will generate an acquisition command with an identification ID to obtain the slave system message All message events currently in the queue.

需要说明的是,上述方式是在检测出消息事件的数量达到预设的消息队列的长度阈值的情况是偶然事件时实行的,若多次检测到消息事件的数量达到预设的消息队列的长度阈值的情况,则还可以通过调整预设周期时间的时长和增加消息队列长度阈值的方式来减少从系统中消息事件的数量达到预设的消息队列的长度阈值的情况。It should be noted that the above-mentioned method is implemented when it is detected that the number of message events reaching the preset message queue length threshold is an accidental event. If the number of message events detected multiple times reaches the preset message queue length In the case of the threshold, the situation that the number of message events in the system reaches the preset message queue length threshold can also be reduced by adjusting the duration of the preset cycle time and increasing the message queue length threshold.

本实施例通过在接收到从系统中消息事件的数量达到预设的消息队列的长度阈值时的产生的指令时获取从系统对应的消息事件,能够及时改善从系统消息队列中消息事件堆积的情况,提高系统的稳定性。This embodiment can timely improve the accumulation of message events in the message queue of the slave system by acquiring the message events corresponding to the slave system when the number of message events in the slave system reaches the preset length threshold of the message queue. , improve system stability.

在上述实施例的基础上,本实施例对技术方案作了进一步的说明和优化,具体的,在接收从系统根据获取指令获取的对应的消息事件之后进一步包括:On the basis of the above embodiments, this embodiment further explains and optimizes the technical solution. Specifically, after receiving the corresponding message event obtained from the system according to the obtaining instruction, it further includes:

删除从系统的消息事件。Delete a message event from the system.

具体的,在主系统接收到从系统根据获取指令获取的对应的消息事件之后,删除从系统中已发送的消息事件。不仅能避免已发送的消息事件占用消息队列长度空间,还能避免在获取从系统的消息事件时重复发送消息事件,使得传输效率更高。Specifically, after the master system receives the corresponding message event acquired by the slave system according to the acquisition instruction, it deletes the message event sent by the slave system. It can not only prevent the sent message events from occupying the length space of the message queue, but also avoid repeatedly sending message events when obtaining message events from the system, so that the transmission efficiency is higher.

上文对于本发明提供的一种系统间消息事件的同步方法的实施例进行了详细的描述,本发明还提供了一种与该方法对应的系统间消息事件的同步装置、设备及计算机可读存储介质,由于装置、设备及计算机可读存储介质部分的实施例与方法部分的实施例相互照应,因此装置、设备及计算机可读存储介质部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。The above has described in detail the embodiment of a method for synchronizing message events between systems provided by the present invention, and the present invention also provides a synchronization device, equipment and computer-readable method for message events between systems corresponding to the method For the storage medium, since the embodiments of the device, equipment, and computer-readable storage medium correspond to the embodiments of the method, please refer to the description of the embodiments of the method for the embodiments of the device, equipment, and computer-readable storage medium. I won't go into details here.

图4为本发明实施例提供的一种系统间消息事件的同步装置的结构图,如图4所示,一种系统间消息事件的同步装置包括:FIG. 4 is a structural diagram of a device for synchronizing message events between systems provided by an embodiment of the present invention. As shown in FIG. 4 , a device for synchronizing message events between systems includes:

发送模块41,用于在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将当前的计时时间设置为所述预设周期时间;其中,计时时间是在发送获取指令后开始计时。The sending module 41 is used to send the acquisition instruction to the slave system according to the preset cycle time. If a trigger instruction is detected, the current timing time is set as the preset cycle time; wherein, the timing time is when sending Start timing after getting the instruction.

接收模块42,用于接收所述从系统根据所述获取指令获取的对应的消息事件。The receiving module 42 is configured to receive the corresponding message event acquired by the slave system according to the acquisition instruction.

本发明提供的一种系统间消息事件的同步装置,相较于现有技术中只能根据预设周期时间获取从系统的消息事件的方法,本装置通过发送模块在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将在上一次发送获取指令之后开始计时的当前的计时时间设置为预设周期时间;并通过接收模块接收从系统根据获取指令获取的对应的消息事件,可见,本装置通过在预设周期时间的基础上进一步根据触发指令发送获取指令,从而更及时地获取对应的消息事件,提高同步消息事件的效率;并且通过将检测到触发指令的当前的计时时间设置为预设周期时间,避免了频繁地发送获取指令,从而提高系统的稳定性。The present invention provides a device for synchronizing message events between systems. Compared with the method in the prior art that can only obtain message events from the slave system according to the preset cycle time, the device transmits messages to the slave system according to the preset cycle time through the sending module. In the thread where the system sends an acquisition instruction, if a trigger instruction is detected, the current timing time that started timing after the last acquisition instruction is sent is set as the preset cycle time; and the receiving module receives the corresponding information obtained from the system according to the acquisition instruction It can be seen that the device further obtains the corresponding message event by sending the acquisition instruction according to the trigger instruction on the basis of the preset cycle time, so as to obtain the corresponding message event in a more timely manner and improve the efficiency of synchronizing the message event; and by detecting the trigger instruction The current timing time is set as the preset cycle time, which avoids frequently sending and obtaining commands, thereby improving the stability of the system.

图5为本发明实施例提供的一种系统间消息事件的同步设备的结构图,如图5所示,一种系统间消息事件的同步设备包括:FIG. 5 is a structural diagram of a device for synchronizing message events between systems provided by an embodiment of the present invention. As shown in FIG. 5 , a device for synchronizing message events between systems includes:

存储器51,用于存储计算机程序;memory 51 for storing computer programs;

处理器52,用于执行计算机程序时实现如上述系统间消息事件的同步方法的步骤。The processor 52 is configured to implement the steps of the above method for synchronizing message events between systems when executing the computer program.

本发明实施例提供的系统间消息事件的同步设备,具有上述系统间消息事件的同步方法的有益效果。The device for synchronizing message events between systems provided by the embodiment of the present invention has the beneficial effect of the above-mentioned method for synchronizing message events between systems.

为解决上述技术问题,本发明还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述系统间消息事件的同步方法的步骤。In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned method for synchronizing message events between systems are realized.

本发明实施例提供的计算机可读存储介质,具有上述系统间消息事件的同步方法的有益效果。The computer-readable storage medium provided by the embodiment of the present invention has the beneficial effects of the above method for synchronizing message events between systems.

以上对本发明所提供的系统间消息事件的同步的方法、装置、设备及计算机可读存储介质进行了详细介绍。本文中应用了具体实施例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The method, device, device, and computer-readable storage medium for synchronizing message events between systems provided by the present invention are described above in detail. In this paper, specific examples are used to illustrate the principles and implementation modes of the present invention, and the descriptions of the above examples are only used to help understand the methods and core ideas of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.

Claims (10)

Translated fromChinese
1.一种系统间消息事件的同步方法,其特征在于,包括:1. A method for synchronizing message events between systems, comprising:在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将当前的计时时间设置为所述预设周期时间;其中,所述计时时间是在发送所述获取指令后开始计时;In the thread that sends the acquisition instruction to the slave system according to the preset cycle time, if a trigger instruction is detected, the current timing time is set as the preset cycle time; wherein, the timing time is when the acquisition instruction is sent start timing after接收所述从系统根据所述获取指令获取的对应的消息事件。receiving the corresponding message event acquired by the slave system according to the acquisition instruction.2.根据权利要求1所述的方法,其特征在于,所述触发指令具体包括检测到业务需求时生成的指令。2. The method according to claim 1, wherein the trigger instruction specifically includes an instruction generated when a service requirement is detected.3.根据权利要求2所述的方法,其特征在于,进一步包括:3. The method of claim 2, further comprising:预先分别设置主系统事件ID和从系统事件ID;Set the main system event ID and the slave system event ID respectively in advance;对应的,所述获取指令的生成方式具体包括:Correspondingly, the method for generating the acquisition instruction specifically includes:根据所述业务需求向所述从系统发送包含所述主系统事件ID或标识ID的查询指令;Sending a query command including the master system event ID or identification ID to the slave system according to the business requirement;接收所述从系统根据所述主系统事件ID或所述标识ID判断出的对应类型的异常事件;receiving the abnormal event of the corresponding type judged by the slave system according to the master system event ID or the identification ID;根据所述异常事件的类型生成对应的包含所述主系统事件ID或所述标识ID的所述获取指令。Generate the corresponding acquisition instruction including the main system event ID or the identification ID according to the type of the abnormal event.4.根据权利要求3所述的方法,其特征在于,所述接收所述从系统根据所述主系统事件ID或所述标识ID判断出的异常事件具体包括:4. The method according to claim 3, wherein the receiving the abnormal event judged by the slave system according to the main system event ID or the identification ID specifically comprises:若所述查询指令包含所述标识ID或所述查询指令包含所述主系统事件ID且所述主系统事件ID大于所述从系统事件ID,则接收所述从系统发送的第一异常事件;If the query command includes the identification ID or the query command includes the master system event ID and the master system event ID is greater than the slave system event ID, then receive the first abnormal event sent by the slave system;对应的,所述根据所述异常事件的类型生成对应的包含所述主系统事件ID或所述标识ID的所述获取指令具体为根据所述第一异常事件生成包含所述标识ID的所述获取指令;Correspondingly, the generating the corresponding acquisition instruction including the main system event ID or the identification ID according to the type of the abnormal event is specifically generating the acquisition instruction including the identification ID according to the first abnormal event. Get instructions;对应的,所述接收所述从系统根据所述获取指令获取的对应的消息事件具体为接收所述从系统根据所述标识ID获取的当前全部消息事件;Correspondingly, the receiving the corresponding message events obtained by the slave system according to the acquisition instruction is specifically receiving all current message events obtained by the slave system according to the identification ID;若所述查询指令包含所述主系统事件ID且所述主系统事件ID小于所述从系统事件ID,则接收所述从系统发送的第二异常事件;If the query command includes the event ID of the master system and the event ID of the master system is smaller than the event ID of the slave system, then receive the second abnormal event sent by the slave system;对应的,所述根据所述异常事件的类型生成对应的包含所述主系统事件ID或所述标识ID的所述获取指令具体为根据所述第二异常事件生成包含所述主系统事件ID的获取指令;Correspondingly, the generating the corresponding acquisition instruction including the main system event ID or the identification ID according to the type of the abnormal event is specifically generating the instruction including the main system event ID according to the second abnormal event Get instructions;对应的,所述接收所述从系统根据所述获取指令获取的对应的消息事件具体为:Correspondingly, the receiving the corresponding message event obtained from the slave system according to the obtaining instruction is specifically:接收所述从系统根据所述从系统事件ID与所述主系统事件ID的差值获取的新增消息事件。receiving the newly added message event acquired by the slave system according to the difference between the event ID of the slave system and the event ID of the master system.5.根据权利要求1所述的方法,其特征在于,所述触发指令进一步包括接收到所述从系统发送的通知消息时生成的指令;5. The method according to claim 1, wherein the trigger instruction further comprises an instruction generated when receiving the notification message sent from the system;对应的,所述获取指令的生成方式具体为:Correspondingly, the generation method of the acquisition instruction is specifically as follows:根据所述通知消息的性质生成对应的获取指令。A corresponding acquisition instruction is generated according to the nature of the notification message.6.根据权利要求1所述的方法,其特征在于,所述触发指令进一步包括接收到所述从系统中所述消息事件的数量达到预设的消息队列的长度阈值时的产生的指令;6. The method according to claim 1, wherein the trigger instruction further comprises an instruction generated when the number of message events in the slave system reaches a preset message queue length threshold;对应的,所述获取指令的生成方式具体为:Correspondingly, the generation method of the acquisition instruction is specifically as follows:根据预设规则生成获取所述从系统当前全部消息事件的获取指令。An acquisition instruction for acquiring all current message events of the slave system is generated according to a preset rule.7.根据权利要求1至6任一项所述的方法,其特征在于,在所述接收所述从系统根据所述获取指令获取的对应的消息事件之后进一步包括:7. The method according to any one of claims 1 to 6, further comprising: after receiving the corresponding message event obtained from the slave system according to the obtaining instruction:删除所述从系统的所述消息事件。Delete said message event from said slave system.8.一种系统间消息事件的同步装置,其特征在于,包括:8. A device for synchronizing message events between systems, comprising:发送模块,用于在根据预设周期时间向从系统发送获取指令的线程中,若检测到触发指令,则将当前的计时时间设置为所述预设周期时间;其中,所述计时时间是在发送所述获取指令后开始计时;The sending module is used to send the acquisition instruction to the slave system according to the preset cycle time. If a trigger instruction is detected, the current timing time is set as the preset cycle time; wherein the timing time is at Start timing after sending the acquisition instruction;接收模块,用于接收所述从系统根据所述获取指令获取的对应的消息事件。The receiving module is configured to receive the corresponding message event acquired by the slave system according to the acquisition instruction.9.一种系统间消息事件的处理设备,其特征在于,包括:9. A processing device for intersystem message events, characterized in that it comprises:存储器,用于存储计算机程序;memory for storing computer programs;处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的系统间消息事件的处理方法的步骤。A processor, configured to implement the steps of the method for processing an intersystem message event according to any one of claims 1 to 7 when executing the computer program.10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的系统间消息事件的处理方法的步骤。10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the system according to any one of claims 1 to 7 is realized The steps of the processing method of the inter-message event.
CN201810844922.9A2018-07-272018-07-27 A method, device, device and storage medium for synchronizing message events between systemsActiveCN109032819B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201810844922.9ACN109032819B (en)2018-07-272018-07-27 A method, device, device and storage medium for synchronizing message events between systems

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201810844922.9ACN109032819B (en)2018-07-272018-07-27 A method, device, device and storage medium for synchronizing message events between systems

Publications (2)

Publication NumberPublication Date
CN109032819Atrue CN109032819A (en)2018-12-18
CN109032819B CN109032819B (en)2021-10-29

Family

ID=64647274

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201810844922.9AActiveCN109032819B (en)2018-07-272018-07-27 A method, device, device and storage medium for synchronizing message events between systems

Country Status (1)

CountryLink
CN (1)CN109032819B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5150313A (en)*1990-04-121992-09-22Regents Of The University Of CaliforniaParallel pulse processing and data acquisition for high speed, low error flow cytometry
US20080222453A1 (en)*2002-03-292008-09-11Cypress Semiconductor CorporationMethod for integrating event-related information and trace information
US20100257404A1 (en)*2009-04-042010-10-07Oracle International CorporationMethod and system for implementing a scalable, high-performance, fault-tolerant locking mechanism in a multi-process environment
CN107800883A (en)*2017-10-312018-03-13广东欧珀移动通信有限公司 Calendar reminder anomaly detection method, device and mobile terminal
CN107908494A (en)*2017-11-102018-04-13泰康保险集团股份有限公司 Abnormal event processing method, device, electronic equipment and storage medium
CN108304704A (en)*2018-02-072018-07-20平安普惠企业管理有限公司Authority control method, device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5150313A (en)*1990-04-121992-09-22Regents Of The University Of CaliforniaParallel pulse processing and data acquisition for high speed, low error flow cytometry
US20080222453A1 (en)*2002-03-292008-09-11Cypress Semiconductor CorporationMethod for integrating event-related information and trace information
US20100257404A1 (en)*2009-04-042010-10-07Oracle International CorporationMethod and system for implementing a scalable, high-performance, fault-tolerant locking mechanism in a multi-process environment
CN107800883A (en)*2017-10-312018-03-13广东欧珀移动通信有限公司 Calendar reminder anomaly detection method, device and mobile terminal
CN107908494A (en)*2017-11-102018-04-13泰康保险集团股份有限公司 Abnormal event processing method, device, electronic equipment and storage medium
CN108304704A (en)*2018-02-072018-07-20平安普惠企业管理有限公司Authority control method, device, computer equipment and storage medium

Also Published As

Publication numberPublication date
CN109032819B (en)2021-10-29

Similar Documents

PublicationPublication DateTitle
CN110474896A (en)Data communications method and relevant device based on Modbus consensus standard
CN107147620B (en)Message interaction processing method, client and server
CN106789431A (en)A kind of overtime monitoring method and device
WO2019037374A1 (en)Method, storage medium, device, and system for waking up main process of android application
CN102724112B (en)Transmission method, receiving terminal equipment and system based on TCP (transmission control protocol)
CN104301428B (en)Data synchronization method and server
CN104601366A (en)Configuration service method and device for control and service nodes
CN107968797A (en)A kind of video transmission method, apparatus and system
CN111416823A (en)Data transmission method and device
CN105528366A (en)A data synchronization control method and device
CN107682460A (en)A kind of distributed storage trunked data communication method and system
CN112261142A (en) A data retransmission method, device and FPGA for RDMA network
CN114756356A (en)Task processing method, work node device, main node device and storage medium
US10051552B2 (en)Method for realizing resource attribute notification, and common service entity
CN114900449A (en)Resource information management method, system and device
WO2019000790A1 (en)Method and device for calling remote procedure using synchronous mode
US20250147826A1 (en)Message execution and processing method, device, electronic device, and storage medium
CN112068940A (en)Real-time task scheduling method, device, scheduling system and storage medium
CN106293970A (en)Asynchronous processing method and system between a kind of process based on IPC
CN109032819A (en)Synchronous method, device, equipment and the storage medium of message event between a kind of system
CN110888739B (en)Distributed processing method and device for delayed tasks
CN117667144A (en)Annotating hot refreshing method, annotating hot refreshing device, annotating hot refreshing equipment and annotating hot refreshing medium
CN111552581A (en)Event delivery method, device and system and electronic equipment
CN117596288A (en)Message transmission method and device, electronic equipment and storage medium
CN111092956A (en)Resource synchronization method, device, storage medium and equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp