CN116418896A - Task execution method, device, equipment and medium based on timer - Google Patents

Task execution method, device, equipment and medium based on timer Download PDF

Info

Publication number
CN116418896A
CN116418896A CN202310675911.3A CN202310675911A CN116418896A CN 116418896 A CN116418896 A CN 116418896A CN 202310675911 A CN202310675911 A CN 202310675911A CN 116418896 A CN116418896 A CN 116418896A
Authority
CN
China
Prior art keywords
message
receiving node
timer
time slice
cluster
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
CN202310675911.3A
Other languages
Chinese (zh)
Other versions
CN116418896B (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.)
Huarui Distributed Technology Changsha Co ltd
Shenzhen Huarui Distributed Technology Co ltd
Original Assignee
Huarui Distributed Technology Changsha Co ltd
Shenzhen Huarui Distributed 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 Huarui Distributed Technology Changsha Co ltd, Shenzhen Huarui Distributed Technology Co ltd filed Critical Huarui Distributed Technology Changsha Co ltd
Priority to CN202310675911.3A priority Critical patent/CN116418896B/en
Publication of CN116418896A publication Critical patent/CN116418896A/en
Application granted granted Critical
Publication of CN116418896B publication Critical patent/CN116418896B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the technical field of computers, and provides a task execution method, device, equipment and medium based on a timer, which can enable a clock driving source cluster to continuously and synchronously send time slice messages to each receiving node according to a preset sending interval in the process that a message sending end synchronously sends messages to each receiving node in a distributed master-slave high-availability message receiving end cluster, each receiving node constructs a logic clock based on the preset sending interval and the time slice messages, executes corresponding tasks according to the logic clock and the messages sent by the message sending end, and enables the distributed master-slave high-availability clusters to keep consistency when executing the tasks by introducing the clock driving source cluster as the timer.

Description

Task execution method, device, equipment and medium based on timer
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for executing tasks based on a timer.
Background
With the development of various computer intelligent systems in various industries, the advantages of the distributed system in the fields of finance, the internet, block chains and the like are more and more obvious, more and more centralized systems are replaced by the distributed system, particularly in the finance field, users have high requirements on the expansibility of the system, the old centralized system is difficult to break through in the expansibility, and one distributed system can meet the requirements of the larger expansibility due to the transverse expansion, so that the financial system is likely to be upgraded to the distributed system architecture.
However, developing a distributed system needs to face greater challenges, because of CAP (Consistency Availability Partition tolerance) theory, a distributed system can only meet at most two of the three indexes of Consistency (Consistency), availability (Availability) and partition fault tolerance (Partition tolerance) at the same time. However, in some distributed systems, it is necessary to explicitly ensure consistency, and the timer is an indispensable function that is often used in system development, so it is important how to use the timer and ensure consistency of distributed active-standby high-availability cluster service processing.
At present, most of the existing distributed system timer implementations do not consider the consistency requirement, usually the system clock is completely dependent, and the system clock is influenced by multiple aspects of machine load, main frequency of a CPU (Central Processing Unit ), clock synchronization and the like, so even on the same machine, the same input between different instance processes of the business logic is not necessarily generated by the dependent timer, and the problem can be avoided in the distributed scenario without considering the consistency, but in the financial system with clear requirements on the consistency such as transactions, quotations and the like, the ordinary timer dependent on the system clock cannot meet the requirement.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, an apparatus, a device, and a medium for executing tasks based on a timer, which aim to solve the problem of inconsistent processing of distributed active-standby high-availability cluster messages.
A timer-based task execution method, the timer-based task execution method comprising:
the message sending end synchronously sends messages to each receiving node in the distributed main and standby high-availability message receiving end cluster;
in the process of transmitting the message by the message transmitting end, the clock driving source cluster continuously and synchronously transmits the time slice message to each receiving node according to a preset transmission interval;
each receiving node constructs a logic clock based on the preset sending interval and the time slice message;
and each receiving node executes a corresponding task according to the logic clock and the message issued by the message transmitting end.
According to the preferred embodiment of the invention, the message sending end is a master-slave high-availability message sending end cluster or a single-instance message sending end cluster.
According to a preferred embodiment of the present invention, the constructing, by each receiving node, a logic clock based on the preset transmission interval and the time slice message includes:
each receiving node determines the issuing sequence of each time slice message and takes the issuing sequence as the message sequence number of each time slice message;
each receiving node determines the number of the preset sending intervals between any two time slice messages according to the message sequence number of each time slice message;
each receiving node constructs the logic clock according to the product of the number of the preset sending intervals and the preset sending intervals between any two time slice messages.
According to a preferred embodiment of the present invention, the executing, by each receiving node, a corresponding task according to the logic clock and the message sent by the message sending end includes:
when the corresponding task is a timeout task, each receiving node determines the logic clock as a timer timeout calculation reference;
and each receiving node executes the overtime task according to the overtime calculation reference of the timer and the message sent by the message sending end.
According to a preferred embodiment of the invention, the method further comprises:
in the process of transmitting the message by the message transmitting end, each receiving node receives the counting message transmitted by the counter cluster;
and each receiving node executes a counting task according to the counting message and the message issued by the message transmitting end.
A timer-based task execution device, the timer-based task execution device comprising:
the message sending end is used for synchronously sending the message to each receiving node in the distributed main and standby high-availability message receiving end cluster;
the clock driving source cluster is used for continuously and synchronously transmitting the time slice message to each receiving node according to a preset transmission interval in the process of transmitting the message by the message transmitting end;
each receiving node is used for constructing a logic clock based on the preset sending interval and the time slice message;
each receiving node is further configured to execute a corresponding task according to the logic clock and the message sent by the message sending end.
A computer device, the computer device comprising:
a memory storing at least one instruction; a kind of electronic device with high-pressure air-conditioning system
And the processor executes the instructions stored in the memory to realize the task execution method based on the timer.
A computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the timer-based task execution method.
According to the technical scheme, in the process that the message sending end synchronously sends the messages to each receiving node in the distributed main and standby high-availability message receiving end cluster, the clock driving source cluster continuously synchronously sends the time slice messages to each receiving node according to the preset sending interval, each receiving node builds a logic clock based on the preset sending interval and the time slice messages, and executes corresponding tasks according to the logic clock and the messages sent by the message sending end, and the clock driving source cluster is introduced as a timer, so that the distributed main and standby high-availability clusters can keep consistency when executing the tasks.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the timer-based task execution method of the present invention.
FIG. 2 is a functional block diagram of a preferred embodiment of the timer-based task execution device of the present invention.
FIG. 3 is a schematic diagram of a computer device implementing a preferred embodiment of a timer-based task execution method according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a preferred embodiment of the timer-based task execution method of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The timer-based task execution method is applied to one or more computer devices, wherein the computer device is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware comprises, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device and the like.
The computer device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The computer device may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
S10, the message sending end synchronously sends the message to each receiving node in the distributed master and slave high-availability message receiving end cluster.
The high availability cluster of the primary and the standby refers to that the number of messages sent or received by all instance nodes in the cluster is completely consistent with the sequence of the messages.
In this embodiment, the message sending end may be a primary and standby high-availability message sending end cluster or a single-instance message sending end cluster.
For example: the message sending end can be a quotation sending end or a transaction message sending end and the like.
Accordingly, each receiving node in the distributed active and standby high-availability message receiving end cluster can be a quotation receiving end or a transaction message receiving end and the like.
In this embodiment, each receiving node in the distributed active-standby high-availability message receiving end cluster needs to ensure that the receiving nodes have the same input, and can simultaneously ensure that the receiving nodes have the same output data, that is, the task processing states of the receiving nodes need to be kept consistent, and the global message sequences received by all the receiving nodes are completely consistent, so that when the active receiving node is abnormal, any other standby receiving node can directly replace the abnormal active receiving node to execute the task.
S11, in the process of sending the message by the message sending end, the clock driving source cluster continuously and synchronously sends the time slice message to each receiving node according to a preset sending interval.
The preset sending interval can be configured according to actual task requirements.
S12, each receiving node constructs a logic clock based on the preset sending interval and the time slice message.
In this embodiment, the constructing, by each receiving node, a logic clock based on the preset transmission interval and the time slice message includes:
each receiving node determines the issuing sequence of each time slice message and takes the issuing sequence as the message sequence number of each time slice message;
each receiving node determines the number of the preset sending intervals between any two time slice messages according to the message sequence number of each time slice message;
each receiving node constructs the logic clock according to the product of the number of the preset sending intervals and the preset sending intervals between any two time slice messages.
For example: assume that the message received by each receiving node in the distributed primary and standby high availability message receiving end cluster is as follows:
wherein: snm represents a message issued by the message sending end, namely, a service message received by each receiving node, wherein n represents a sequence number identifier (namely, one message sending end or a plurality of message sending ends can be provided) of the message sending end, and m represents an mth message sent by the corresponding message sending end; tm represents each time slice message, where m represents an mth time slice message sent by the clock driving source cluster, i.e. a message sequence number of each time slice message. If the preset transmission interval is i, the time slice message t1 and the time slice message tm are separated by m i, and the logic clock running time may be set to i×m.
As long as the logic clocks are consistent, the timer triggering rules are also completely consistent, so that the system consistency requirement of the active and standby high-availability clusters is ensured.
S13, each receiving node executes corresponding tasks according to the logic clock and the message sent by the message sending end.
In this embodiment, the executing, by each receiving node, a corresponding task according to the logic clock and the message sent by the message sending end includes:
when the corresponding task is a timeout task, each receiving node determines the logic clock as a timer timeout calculation reference;
and each receiving node executes the overtime task according to the overtime calculation reference of the timer and the message sent by the message sending end.
It can be appreciated that some distributed active-standby high availability clusters require a timeout mechanism of a timer under certain scenarios to ensure that services run at regular time, but system clocks and processing speeds of multiple instances in the cluster cannot be guaranteed to be completely aligned, and even if deployed on the same machine, processing speeds between different processes are also different due to scheduling and competing resources. However, the master-slave high-availability clusters need to ensure that the same input is required to generate the same output, the system time is taken as a timeout judgment basis, and the timeout judgment among a plurality of examples cannot be guaranteed to be completely coincident, so that uncertainty influence is generated on the system output, different message output sequences can be generated when the same message input sequences are received among different example nodes of the distributed master-slave high-availability message receiving end clusters, and the design requirement of the consistency of the master-slave high-availability clusters cannot be met.
In view of the above problems, the present embodiment introduces the clock driving source cluster, although the processing speed of each receiving node is not completely consistent, since the sequence of messages received by each receiving node is completely the same, it can be inferred that the logic clock calculated by each receiving node is also completely the same, so tasks such as timeout processing of a timer can be implemented according to the logic clock, so as to ensure that the number of service messages processed by each receiving node is completely the same at a timeout point. In this way, for each receiving node in the distributed active-standby high-availability message receiving end cluster, under the condition that message input is completely the same, the number of received messages and the sequence of the messages can be ensured to be completely the same, namely, the consistency of timer clock execution among the distributed active-standby high-availability cluster nodes is ensured.
The embodiment can effectively ensure the system consistency under the scene of relying on a timer clock to realize the function and ensuring the consistency of the distributed active-standby high-availability clusters.
In the above embodiment, the problem of inconsistent message processing results of the distributed main and standby high-availability message receiving end clusters can be solved only by introducing the clock driving source clusters, the coupling of the whole system is smaller, and the original system can be integrated and applied quickly by slightly modifying.
In this embodiment, the method further includes:
in the process of transmitting the message by the message transmitting end, each receiving node receives the counting message transmitted by the counter cluster;
and each receiving node executes a counting task according to the counting message and the message issued by the message transmitting end.
With the above-described embodiments, in addition to the coincidence clock, coincidence counting is introduced to perform the relevant counting task.
According to the technical scheme, in the process that the message sending end synchronously sends the messages to each receiving node in the distributed main and standby high-availability message receiving end cluster, the clock driving source cluster continuously synchronously sends the time slice messages to each receiving node according to the preset sending interval, each receiving node builds a logic clock based on the preset sending interval and the time slice messages, and executes corresponding tasks according to the logic clock and the messages sent by the message sending end, and the clock driving source cluster is introduced as a timer, so that the distributed main and standby high-availability clusters can keep consistency when executing the tasks.
FIG. 2 is a functional block diagram of a preferred embodiment of the timer-based task execution device of the present invention. The timer-based task execution device 11 includes a message sending end 110, a distributed active-standby high availability message receiving end cluster 111, a clock driving source cluster 112, and each receiving node 1110. The module/unit referred to in the present invention refers to a series of computer program segments, which are stored in a memory, capable of being executed by a processor and of performing a fixed function. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
The message sending end 110 is configured to send a message to each receiving node 1110 in the distributed active-standby high-availability message receiving end cluster 111 synchronously;
the clock driving source cluster 112 is configured to continuously and synchronously send a time slice message to each receiving node 1110 according to a preset sending interval in a process of sending a message by the message sending end 110;
each receiving node 1110 is configured to construct a logic clock based on the preset sending interval and the time slice message;
each receiving node 1110 is further configured to execute a corresponding task according to the logic clock and the message sent by the message sender.
According to the technical scheme, in the process that the message sending end synchronously sends the messages to each receiving node in the distributed main and standby high-availability message receiving end cluster, the clock driving source cluster continuously synchronously sends the time slice messages to each receiving node according to the preset sending interval, each receiving node builds a logic clock based on the preset sending interval and the time slice messages, and executes corresponding tasks according to the logic clock and the messages sent by the message sending end, and the clock driving source cluster is introduced as a timer, so that the distributed main and standby high-availability clusters can keep consistency when executing the tasks.
FIG. 3 is a schematic diagram of a computer device implementing a preferred embodiment of the timer-based task execution method of the present invention.
The computer device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program stored in the memory 12 and executable on the processor 13, such as a timer-based task execution program.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation of the computer device 1, the computer device 1 may be a bus type structure, a star type structure, the computer device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, for example, the computer device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the computer device 1 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
The memory 12 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the computer device 1, such as a removable hard disk of the computer device 1. The memory 12 may in other embodiments also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the computer device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the computer device 1. The memory 12 may be used not only for storing application software installed in the computer device 1 and various types of data, such as code of a timer-based task execution program, but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, a combination of various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the computer device 1, connects the respective components of the entire computer device 1 using various interfaces and lines, executes various functions of the computer device 1 and processes data by running or executing programs or modules stored in the memory 12 (for example, executing a timer-based task execution program or the like), and calls data stored in the memory 12.
The processor 13 executes the operating system of the computer device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps of the various timer-based task execution method embodiments described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the computer device 1. For example, the computer program may be partitioned into a message sender 110, a distributed primary and backup high availability message receiver cluster 111, a clock drive source cluster 112, and each receiving node 1110.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to perform portions of the timer-based task execution methods described in various embodiments of the invention.
The modules/units integrated in the computer device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on this understanding, the present invention may also be implemented by a computer program for instructing a relevant hardware device to implement all or part of the procedures of the above-mentioned embodiment method, where the computer program may be stored in a computer readable storage medium and the computer program may be executed by a processor to implement the steps of each of the above-mentioned method embodiments.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory, or the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one straight line is shown in fig. 3, but not only one bus or one type of bus. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the computer device 1 may further comprise a power source (such as a battery) for powering the various components, preferably the power source may be logically connected to the at least one processor 13 via a power management means, whereby the functions of charge management, discharge management, and power consumption management are achieved by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The computer device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described in detail herein.
Further, the computer device 1 may also comprise a network interface, optionally comprising a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the computer device 1 and other computer devices.
The computer device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the computer device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Fig. 3 shows only a computer device 1 with components 12-13, it being understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the computer device 1 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the computer device 1 stores a plurality of instructions to implement a timer-based task execution method, the processor 13 being executable to implement:
the message sending end synchronously sends messages to each receiving node in the distributed main and standby high-availability message receiving end cluster;
in the process of transmitting the message by the message transmitting end, the clock driving source cluster continuously and synchronously transmits the time slice message to each receiving node according to a preset transmission interval;
each receiving node constructs a logic clock based on the preset sending interval and the time slice message;
and each receiving node executes a corresponding task according to the logic clock and the message issued by the message transmitting end.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
The data in this case were obtained legally.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The invention is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means stated in the invention may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A timer-based task execution method, characterized in that the timer-based task execution method comprises:
the message sending end synchronously sends messages to each receiving node in the distributed main and standby high-availability message receiving end cluster;
in the process of transmitting the message by the message transmitting end, the clock driving source cluster continuously and synchronously transmits the time slice message to each receiving node according to a preset transmission interval;
each receiving node constructs a logic clock based on the preset sending interval and the time slice message;
and each receiving node executes a corresponding task according to the logic clock and the message issued by the message transmitting end.
2. The timer-based task execution method of claim 1, wherein the message sender is a master-slave high availability message sender cluster or a single instance message sender cluster.
3. The timer-based task execution method of claim 1, wherein the constructing a logic clock by each receiving node based on the preset transmission interval and the time slice message comprises:
each receiving node determines the issuing sequence of each time slice message and takes the issuing sequence as the message sequence number of each time slice message;
each receiving node determines the number of the preset sending intervals between any two time slice messages according to the message sequence number of each time slice message;
each receiving node constructs the logic clock according to the product of the number of the preset sending intervals and the preset sending intervals between any two time slice messages.
4. The timer-based task execution method according to claim 1, wherein each receiving node executes a corresponding task according to the logic clock and the message issued by the message sender, including:
when the corresponding task is a timeout task, each receiving node determines the logic clock as a timer timeout calculation reference;
and each receiving node executes the overtime task according to the overtime calculation reference of the timer and the message sent by the message sending end.
5. The timer-based task execution method of claim 1, wherein the method further comprises:
in the process of transmitting the message by the message transmitting end, each receiving node receives the counting message transmitted by the counter cluster;
and each receiving node executes a counting task according to the counting message and the message issued by the message transmitting end.
6. A timer-based task execution device, characterized in that the timer-based task execution device comprises:
the message sending end is used for synchronously sending the message to each receiving node in the distributed main and standby high-availability message receiving end cluster;
the clock driving source cluster is used for continuously and synchronously transmitting the time slice message to each receiving node according to a preset transmission interval in the process of transmitting the message by the message transmitting end;
each receiving node is used for constructing a logic clock based on the preset sending interval and the time slice message;
each receiving node is further configured to execute a corresponding task according to the logic clock and the message sent by the message sending end.
7. The timer-based task execution apparatus of claim 6, wherein the message sender is a master-slave high availability message sender cluster or a single instance message sender cluster.
8. The timer-based task execution apparatus of claim 6, wherein the constructing a logic clock by each receiving node based on the preset transmission interval and the time slice message comprises:
each receiving node determines the issuing sequence of each time slice message and takes the issuing sequence as the message sequence number of each time slice message;
each receiving node determines the number of the preset sending intervals between any two time slice messages according to the message sequence number of each time slice message;
each receiving node constructs the logic clock according to the product of the number of the preset sending intervals and the preset sending intervals between any two time slice messages.
9. A computer device, the computer device comprising:
a memory storing at least one instruction; a kind of electronic device with high-pressure air-conditioning system
A processor executing instructions stored in the memory to implement the timer-based task execution method of any one of claims 1 to 5.
10. A computer-readable storage medium, characterized by: the computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the timer-based task execution method of any one of claims 1 to 5.
CN202310675911.3A 2023-06-08 2023-06-08 Task execution method, device, equipment and medium based on timer Active CN116418896B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310675911.3A CN116418896B (en) 2023-06-08 2023-06-08 Task execution method, device, equipment and medium based on timer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310675911.3A CN116418896B (en) 2023-06-08 2023-06-08 Task execution method, device, equipment and medium based on timer

Publications (2)

Publication Number Publication Date
CN116418896A true CN116418896A (en) 2023-07-11
CN116418896B CN116418896B (en) 2023-08-22

Family

ID=87049552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310675911.3A Active CN116418896B (en) 2023-06-08 2023-06-08 Task execution method, device, equipment and medium based on timer

Country Status (1)

Country Link
CN (1) CN116418896B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150341422A1 (en) * 2014-05-21 2015-11-26 Omx Technology Ab Efficient and reliable host distribution of totally ordered global state
CN113127271A (en) * 2021-04-01 2021-07-16 深圳华锐金融技术股份有限公司 Transaction system deployment method and device, computer equipment and storage medium
US20220131960A1 (en) * 2020-10-23 2022-04-28 Nokia Technologies Oy Methods and devices in a blockchain network
CN114666346A (en) * 2022-02-18 2022-06-24 苏州浪潮智能科技有限公司 Distributed cluster time synchronization method and device and computer readable storage medium
CN115549836A (en) * 2022-08-23 2022-12-30 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Design method and system for logic clock synchronization algorithm of distributed system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150341422A1 (en) * 2014-05-21 2015-11-26 Omx Technology Ab Efficient and reliable host distribution of totally ordered global state
US20220131960A1 (en) * 2020-10-23 2022-04-28 Nokia Technologies Oy Methods and devices in a blockchain network
CN113127271A (en) * 2021-04-01 2021-07-16 深圳华锐金融技术股份有限公司 Transaction system deployment method and device, computer equipment and storage medium
CN114666346A (en) * 2022-02-18 2022-06-24 苏州浪潮智能科技有限公司 Distributed cluster time synchronization method and device and computer readable storage medium
CN115549836A (en) * 2022-08-23 2022-12-30 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Design method and system for logic clock synchronization algorithm of distributed system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘鲁源;王晓欣;刘昆;吕伟杰;: "分布式系统高精度时钟同步算法及其实现", 天津大学学报, no. 08 *

Also Published As

Publication number Publication date
CN116418896B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN115118738B (en) Disaster recovery method, device, equipment and medium based on RDMA
CN114020845A (en) Block chain network management method, system, electronic equipment and storage medium
CN116418896B (en) Task execution method, device, equipment and medium based on timer
CN115314570B (en) Data issuing method, device, equipment and medium based on protocol development framework
CN114185502B (en) Log printing method, device, equipment and medium based on production line environment
CN115687384A (en) UUID (user identifier) identification generation method, device, equipment and storage medium
CN114741422A (en) Query request method, device, equipment and medium
CN114816371A (en) Message processing method, device, equipment and medium
CN114385453A (en) Database cluster exception handling method, device, equipment and medium
CN117851520B (en) Data synchronization method, system, equipment and medium of securities core transaction engine
CN115277376B (en) Disaster recovery switching method, device, equipment and medium
CN116860508B (en) Distributed system software defect continuous self-healing method, device, equipment and medium
CN113687834B (en) Distributed system node deployment method, device, equipment and medium
CN116414366B (en) Middleware interface generation method, device, equipment and medium
CN116225789B (en) Transaction system backup capability detection method, device, equipment and medium
CN116306591B (en) Flow form generation method, device, equipment and medium
CN115934576B (en) Test case generation method, device, equipment and medium in transaction scene
CN116455997B (en) STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium
CN116760835B (en) Distributed storage method, device and medium
CN114389988B (en) Remote procedure call method, device, equipment and medium based on network architecture
CN114640618B (en) Cluster route scheduling method and device, electronic equipment and readable storage medium
CN118193493A (en) Service method, device, equipment and medium based on law enforcement event processing task
CN117851506A (en) GIT-based cross-library synchronization method and device, electronic equipment and storage medium
CN118037453A (en) Order processing method, device, equipment and medium of transaction system
CN116401104A (en) Application data source switching method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant