CN112860449B - Method, system, equipment and medium for preventing restart caused by message overtime - Google Patents

Method, system, equipment and medium for preventing restart caused by message overtime Download PDF

Info

Publication number
CN112860449B
CN112860449B CN202110023820.2A CN202110023820A CN112860449B CN 112860449 B CN112860449 B CN 112860449B CN 202110023820 A CN202110023820 A CN 202110023820A CN 112860449 B CN112860449 B CN 112860449B
Authority
CN
China
Prior art keywords
node
queue
overtime
issued
current node
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.)
Active
Application number
CN202110023820.2A
Other languages
Chinese (zh)
Other versions
CN112860449A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202110023820.2A priority Critical patent/CN112860449B/en
Publication of CN112860449A publication Critical patent/CN112860449A/en
Application granted granted Critical
Publication of CN112860449B publication Critical patent/CN112860449B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method, a system, equipment and a storage medium for preventing restarting caused by message overtime, wherein the method comprises the following steps: creating an empty queue, a request queue and an overtime queue; responding to a message received from a superior platform, selecting a node from the empty queue, assigning the node according to the message, and then putting the node into the request queue; responding to the overtime of the current node processing of the request queue, and judging whether the current node is issued or not; and responding to the current node not issued yet, sending the current node to the overtime queue for processing, and returning the processed node to the empty queue. The invention avoids the equipment restart caused by overtime processing of the message by adding the link list and replying the false message, enhances the stability of the equipment and improves the competitiveness of the product.

Description

Method, system, equipment and medium for preventing restarting caused by overtime message
Technical Field
The present invention relates to the field of message queues, and more particularly, to a method, system, computer device and readable medium for preventing restart due to message timeout.
Background
The interaction between the upper-layer platform as the storage level and the driver has a high requirement on real-time performance, the driver needs to have a 'need' for the request of the upper-layer platform, under certain scenes, the driver may serve as an intermediate layer and needs to transmit messages to the lower-layer driver in a transparent mode, and on the premise that the capability and the stability of the lower-layer driver for processing the messages cannot be guaranteed, the fault tolerance rate of the system is improved, the system restart times are reduced, and the restart threshold value is increased, so that the system is necessary.
Generally, the driver as an intermediate layer upload and issue needs to create a maintenance queue, the maintenance queue is used as a buffer to temporarily store the messages of the upper platform and create a polling function, the queue is checked at intervals, and the messages in the queue are issued or returned (or executed). When the lower-level driver is overtime, the upper-level platform can start a restart mechanism by considering that the lower-level driver is abnormal, which can cause the system to be frequently restarted and bring bad experience to users.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, a system, a computer device, and a computer readable storage medium for preventing restarting caused by message timeout, where a chain table is added and a false message is replied to avoid restarting caused by timeout processing of a message, so as to enhance stability of a device, improve user experience, and improve competitiveness of a product.
Based on the foregoing object, an aspect of the embodiments of the present invention provides a method for preventing a restart due to message timeout, including the following steps: creating an empty queue, a request queue and an overtime queue; responding to a message received from a superior platform, selecting a node from the empty queue, assigning the node according to the message, and then putting the node into the request queue; responding to the overtime of the current node processing of the request queue, and judging whether the current node is issued or not; and responding to the current node not issued yet, sending the current node to the overtime queue for processing, and returning the processed node to the empty queue.
In some embodiments, the method further comprises: and responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
In some embodiments, the method further comprises: responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and responding to the node not issued yet, and placing the nodes to be processed behind the node in the request queue into the overtime queue.
In some embodiments, the method further comprises: and calling a polling function to sequentially release the nodes to be processed in the overtime queue.
In another aspect of the embodiments of the present invention, a system for preventing a restart caused by a message timeout is further provided, including: the creating module is configured for creating an empty queue, a request queue and an overtime queue; the write-in module is configured to respond to a message received from a superior platform, select a node from the empty queue, assign values to the node according to the message, and then place the node into the request queue; the judging module is configured to respond to the overtime of the current node processing of the request queue and judge whether the current node is issued or not; and the execution module is configured to respond to the fact that the current node is not issued yet, send the current node to the timeout queue for processing, and return the processed node to the empty queue.
In some embodiments, the system further comprises: and the reply module is configured for responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
In some embodiments, the system further comprises a termination module configured to: responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and responding to the node not issued yet, and placing the nodes to be processed behind the node in the request queue into the overtime queue.
In some embodiments, the system further comprises: and the calling module is configured to call a polling function to sequentially release the nodes to be processed in the overtime queue.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: the device is prevented from restarting due to overtime processing of the message by adding the link list and replying the false message, the stability of the device is enhanced, the user experience is improved, and the competitiveness of the product is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a diagram illustrating an embodiment of a method for preventing a restart due to a message timeout according to the present invention;
FIG. 2 is a diagram illustrating a hardware structure of an embodiment of a computer device for preventing a reboot caused by a message timeout according to the present invention;
FIG. 3 is a diagram of an embodiment of a computer storage medium to prevent a restart due to a message timeout provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the foregoing, a first aspect of the embodiments of the present invention provides an embodiment of a method for preventing a restart due to message timeout. Fig. 1 is a schematic diagram illustrating an embodiment of a method for preventing a restart due to message timeout provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, creating an empty queue, a request queue and an overtime queue;
s2, responding to the received message of the upper-level platform, selecting a node from the empty queue, assigning the node according to the message, and then putting the node into a request queue;
s3, responding to the overtime processing of the current node of the request queue, and judging whether the current node is issued or not; and
and S4, responding to the fact that the current node is not issued, sending the current node to a timeout queue for processing, and returning the processed node to the empty queue.
An empty queue, a request queue, and a timeout queue are created. For example, an empty queue free, request queue request, timeout queue abroad may be created.
And responding to the received message of the upper platform, selecting a node from the empty queue, assigning the node according to the message, and then putting the node into the request queue. When the driver receives the information of the superior platform, taking out a node from the empty queue, assigning the node and then putting the node into the request queue, and when the information in the request queue is processed, taking out the node from the request queue and putting the node into the empty queue. This mechanism will avoid memory fragmentation caused by a large number of malloc (memory) operations.
And responding to the overtime processing of the current node of the request queue, and judging whether the current node is issued. The overtime node has two processing modes, one is to move the overtime node into the overtime queue, the other is to perform false reply, if the current node is not issued, the former mode is adopted, and if the current node is issued, the latter mode is adopted.
And responding to the fact that the current node is not issued, sending the current node to the overtime queue for processing, and returning the processed node to the empty queue.
In some embodiments, the method further comprises: and responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
In some embodiments, the method further comprises: responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and in response to the node not being issued, putting the nodes to be processed behind the node in the request queue into the overtime queue. For example, at a certain time, the upper platform sends a termination instruction to a certain node a, and the instruction cannot be replied normally, so that "there is no need to do so," in this embodiment, a node to be processed arranged behind the node a in the request queue may be placed in the timeout queue, so that even if the node cannot be released, the subsequent message processing is not affected.
In some embodiments, the method further comprises: and calling a polling function to sequentially release the nodes to be processed in the overtime queue. The timeout queue only holds messages that require exception handling and that have not yet been notified to the next driver. It is released in the polling function so that it will not affect the lower drives.
It should be particularly noted that, the steps in the embodiments of the above method for preventing the restart due to the message timeout may be mutually intersected, replaced, added, and deleted, so that these reasonable permutation and combination transformations as well as the method for preventing the restart due to the message timeout should also belong to the scope of the present invention, and should not limit the scope of the present invention to the embodiments.
In view of the above object, a second aspect of the embodiments of the present invention provides a system for preventing a restart due to message timeout, including: the creating module is configured for creating an empty queue, a request queue and an overtime queue; the write-in module is configured to respond to a message received from a superior platform, select a node from the empty queue, assign values to the node according to the message, and then place the node into the request queue; the judging module is configured to respond to the overtime of the current node processing of the request queue and judge whether the current node is issued or not; and the execution module is configured to respond to the fact that the current node is not issued yet, send the current node to the timeout queue for processing, and return the processed node to the empty queue.
In some embodiments, the system further comprises: and the reply module is configured for responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
In some embodiments, the system further comprises a termination module configured to: responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and in response to the node not being issued, putting the nodes to be processed behind the node in the request queue into the overtime queue.
In some embodiments, the system further comprises: and the calling module is configured to call a polling function to sequentially release the nodes to be processed in the overtime queue.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, creating an empty queue, a request queue and an overtime queue; s2, responding to the received message of the upper-level platform, selecting a node from the empty queue, assigning the node according to the message, and then putting the node into a request queue; s3, responding to overtime processing of the current node of the request queue, and judging whether the current node is issued or not; and S4, responding to the fact that the current node is not issued, sending the current node to the overtime queue for processing, and returning the processed node to the empty queue.
In some embodiments, the steps further comprise: and responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
In some embodiments, the steps further comprise: responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and in response to the node not being issued, putting the nodes to be processed behind the node in the request queue into the overtime queue.
In some embodiments, the steps further comprise: and calling a polling function to sequentially release the nodes to be processed in the overtime queue.
Fig. 2 is a schematic hardware structural diagram of an embodiment of the computer device for preventing the restart caused by the message timeout provided by the present invention.
Taking the apparatus shown in fig. 2 as an example, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, memory 202, input device 203, and output device 204 may be connected by a bus or other means, as exemplified by the bus connection in fig. 2.
The memory 202, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for preventing a restart due to a message timeout in the embodiments of the present application. The processor 201 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 202, i.e. implementing the method of preventing restart due to message timeout of the above-described method embodiments.
The memory 202 may 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; the storage data area may store data created according to use of a method of preventing a restart due to a message timeout, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may receive information such as a user name and a password that are input. The output device 204 may include a display device such as a display screen.
Program instructions/modules corresponding to one or more methods of preventing message timeouts from causing restarts are stored in the memory 202 and, when executed by the processor 201, perform the method of preventing message timeouts from causing restarts in any of the method embodiments described above.
Any embodiment of a computer device implementing the method for preventing a restart due to a message timeout may achieve the same or similar effects as any of the previous method embodiments corresponding thereto.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
FIG. 3 is a schematic diagram of an embodiment of a computer storage medium for preventing a restart due to a message timeout according to the present invention. Taking the computer storage medium as shown in fig. 3 as an example, the computer readable storage medium 3 stores a computer program 31 which, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as those skilled in the art can understand, all or part of the processes in the methods according to the embodiments described above can be implemented by instructing relevant hardware through a computer program, and the program of the method for preventing restart due to message timeout can be stored in a computer-readable storage medium, and when executed, the program can include the processes according to the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, where the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit or scope of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (8)

1. A method for preventing a restart due to a message timeout, comprising the steps of:
creating an empty queue, a request queue and an overtime queue;
responding to a message received from a superior platform, selecting a node from the empty queue, assigning the node according to the message, and then putting the node into the request queue;
responding to the overtime of the current node processing of the request queue, and judging whether the current node is issued or not; and
responding to the current node not issued yet, sending the current node to the overtime queue for processing, and returning the processed node to the empty queue,
the method further comprises the following steps: and responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
2. The method of claim 1, further comprising:
responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and
and in response to the node not yet issued, putting the nodes to be processed behind the node in the request queue into the overtime queue.
3. The method of claim 2, further comprising:
and calling a polling function to sequentially release the nodes to be processed in the overtime queue.
4. A system for preventing message timeouts from causing a reboot, comprising:
the creating module is configured for creating an empty queue, a request queue and an overtime queue;
the write-in module is configured to respond to a message received from a superior platform, select a node from the empty queue, assign values to the node according to the message, and then place the node into the request queue;
the judging module is configured to respond to the overtime processing of the current node of the request queue and judge whether the current node is issued or not; and
an execution module configured to respond to the current node not being issued yet, send the current node to the timeout queue for processing, and return the processed node to the empty queue,
the system further comprises: and the reply module is configured for responding to the current node which is issued, and calling a function to carry out forced reply on the current node.
5. The system of claim 4, further comprising a termination module configured to:
responding to a received termination instruction of a superior platform, and judging whether a node corresponding to the termination instruction is issued or not; and
and in response to the node not issued yet, putting the nodes to be processed behind the node in the request queue into the overtime queue.
6. The system of claim 5, further comprising:
and the calling module is configured to call a polling function to sequentially release the nodes to be processed in the overtime queue.
7. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 3.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN202110023820.2A 2021-01-08 2021-01-08 Method, system, equipment and medium for preventing restart caused by message overtime Active CN112860449B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110023820.2A CN112860449B (en) 2021-01-08 2021-01-08 Method, system, equipment and medium for preventing restart caused by message overtime

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110023820.2A CN112860449B (en) 2021-01-08 2021-01-08 Method, system, equipment and medium for preventing restart caused by message overtime

Publications (2)

Publication Number Publication Date
CN112860449A CN112860449A (en) 2021-05-28
CN112860449B true CN112860449B (en) 2023-01-10

Family

ID=76005440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110023820.2A Active CN112860449B (en) 2021-01-08 2021-01-08 Method, system, equipment and medium for preventing restart caused by message overtime

Country Status (1)

Country Link
CN (1) CN112860449B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003418B (en) * 2021-09-29 2024-01-12 苏州浪潮智能科技有限公司 Command timeout detection method, device and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097527A (en) * 2006-06-27 2008-01-02 中国银联股份有限公司 Flowpath scheduling method and system of application progress
CN101876938A (en) * 2009-11-11 2010-11-03 北京神州泰岳软件股份有限公司 Message queue-based application software response time measuring method
CN111104232A (en) * 2019-11-09 2020-05-05 苏州浪潮智能科技有限公司 Method, device and medium for accelerating message writing of message queue

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097527A (en) * 2006-06-27 2008-01-02 中国银联股份有限公司 Flowpath scheduling method and system of application progress
CN101876938A (en) * 2009-11-11 2010-11-03 北京神州泰岳软件股份有限公司 Message queue-based application software response time measuring method
CN111104232A (en) * 2019-11-09 2020-05-05 苏州浪潮智能科技有限公司 Method, device and medium for accelerating message writing of message queue

Also Published As

Publication number Publication date
CN112860449A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN109788068B (en) Heartbeat state information reporting method, device and equipment and computer storage medium
CN108008950B (en) Method and device for realizing user interface updating
CN103795569A (en) Server connection method and device based on connection pool
CN106034138A (en) Remote service calling method and remote service calling device
US20220353170A1 (en) Method, apparatus, and system for controlling a flow entry
CN112306979B (en) Message queue-based log information processing method and device and readable medium
CN112860449B (en) Method, system, equipment and medium for preventing restart caused by message overtime
CN114363334B (en) Cloud system, network configuration method, device and equipment of cloud desktop virtual machine
CN107682389B (en) Method, terminal and computer readable storage medium for executing network request
CN116366652A (en) Distributed application operation and maintenance method, system, device, server and gateway equipment
CN107341059A (en) A kind of wechat public number concurrent message treatment mechanism
CN108241616B (en) Message pushing method and device
CN111988391A (en) Message sending method and device
CN111274047A (en) Information processing method, terminal, system, computer device and storage medium
CN110413398B (en) Task scheduling method and device, computer equipment and storage medium
CN111786859A (en) Packet loss detection method, device and storage medium
CN116366634A (en) File downloading method, device, terminal, source server and medium
CN111159298A (en) Service request processing method and device, electronic equipment and storage medium
CN111935337B (en) MAC address keep-alive method, equipment and storage medium of aggregation link
CN109857720B (en) Database table monitoring method, device, computer device and readable storage medium
CN113971073A (en) Data calling method and device, electronic equipment and computer storage medium
WO2016206399A1 (en) Communication equipment, device and software version upgrade method utilized in communication equipment
CN111818468A (en) Message processing method, system and related equipment
CN114968407B (en) Plug-in calling method, device, electronic equipment and storage medium
CN113766437B (en) Short message sending method and device

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