CN114416392A - Message processing method and device, storage medium and electronic equipment - Google Patents

Message processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114416392A
CN114416392A CN202111564788.5A CN202111564788A CN114416392A CN 114416392 A CN114416392 A CN 114416392A CN 202111564788 A CN202111564788 A CN 202111564788A CN 114416392 A CN114416392 A CN 114416392A
Authority
CN
China
Prior art keywords
processing
task
target
state
result
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.)
Pending
Application number
CN202111564788.5A
Other languages
Chinese (zh)
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.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing 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 Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202111564788.5A priority Critical patent/CN114416392A/en
Publication of CN114416392A publication Critical patent/CN114416392A/en
Pending legal-status Critical Current

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
    • 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/542Event management; Broadcasting; Multicasting; Notifications

Landscapes

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

Abstract

The invention discloses a message processing method, a message processing device, a storage medium and electronic equipment. Wherein, the method comprises the following steps: acquiring a first message sent by a first system, wherein the first message carries a task identifier of a target processing task; controlling a first system to process a target processing task based on a task identifier of the target processing task in a first message to obtain a processing result state, wherein the processing result state is used for representing whether a processing result is obtained within a preset time; and in response to the processing result state that the processing result is not obtained within the preset time, inquiring the processing state of the target processing task, and controlling the second system to work based on the inquiry result, wherein the inquiry result is used for representing whether the processing state of the target processing task is normal, and the second system is a downstream system of the first system. The invention solves the technical problem of lower efficiency of maintaining the data consistency between systems in the related technology.

Description

Message processing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of information processing, and in particular, to a method and an apparatus for processing a message, a storage medium, and an electronic device.
Background
At present, under a micro-service architecture, a processing task needs to span multiple subsystems, which generally requires that the processing results of the multiple subsystems for the processing task are the same, and if the processing is not successful in the multiple subsystems, the processing is not failed in the multiple subsystems, otherwise, data among the multiple subsystems are inconsistent. Generally, a compensation mechanism is used to process the situation of data inconsistency among a plurality of systems, but the compensation mechanism has a long processing time and a complex processing process, so that the efficiency of maintaining the systems is reduced.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a message processing method, a message processing device, a storage medium and electronic equipment, and aims to at least solve the technical problem of low efficiency of maintaining data consistency among systems in the related art.
According to an aspect of an embodiment of the present invention, a method for acquiring a first message sent by a first system is provided, where the first message carries a task identifier of a target processing task; controlling a first system to process a target processing task based on a task identifier of the target processing task in a first message to obtain a processing result state, wherein the processing result state is used for representing whether a processing result is obtained within a preset time; and in response to the processing result state that the processing result is not obtained within the preset time, inquiring the processing state of the target processing task, and controlling the second system to work based on the inquiry result, wherein the inquiry result is used for representing whether the processing state of the target processing task is normal, and the second system is a downstream system of the first system.
Optionally, in response to that the processing result status is that no processing result is obtained within the preset time, querying the processing status of the target processing task, and controlling the second system to work based on the query result, including: in response to the processing result state that the processing result is not obtained within the preset time, inquiring the processing state of the target processing task based on the task identifier and a target task table in the first system to obtain an inquiry result, wherein the target task table is used for representing the corresponding relation between the task identifier and the processing state; in response to the condition that the query result is the processing state of the target processing task which is not queried, marking a preset state on the task identifier of the target processing task in the target task table to obtain a marking result; and in response to the condition that the labeling result is the labeling failure, determining the processing state of the target processing task as the processing success, and controlling the second system to work.
Optionally, the method further comprises: and in response to the fact that the labeling result is successful, determining that the processing state of the target processing task is processing failure, and deleting the target processing task in the target task table.
Optionally, the method further comprises: and responding to the processing state of the target processing task which is inquired by the inquiry result, and controlling the second system to work based on the processing state.
Optionally, controlling the second system to operate based on the processing state comprises: responding to the processing state being satisfied, and controlling the second system to work; and in response to the processing state being satisfied as processing failure, deleting the target processing task in the target task table.
Optionally, the method further comprises: and controlling the second system to work based on the processing result in response to the processing result state that the processing result is obtained within the preset time.
Optionally, controlling the second system to operate based on the processing result, comprising: responding to the processing state meeting the processing result as the target processing task as successful processing, and controlling the second system to work; and deleting the target processing task in the target task table in response to the processing state meeting the processing result as the target processing task being processing failure.
Optionally, controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message, and obtaining a processing result state, where the processing result state includes: judging whether the task identifier of the target processing task in the first message is abnormal or not; in response to the fact that the task identification of the target processing task in the first message is abnormal, the first system is prohibited from being controlled to process the target processing task; and in response to the fact that the task identifier of the target processing task in the first message is not abnormal, controlling the first system to process the target processing task to obtain a processing result state.
According to another aspect of the embodiments of the present invention, there is also provided a device for processing a message, including: the acquisition module acquires a first message sent by a first system, wherein the first message carries a task identifier of a target processing task; the processing module is used for controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message to obtain a processing result state, wherein the processing result state is used for representing whether a processing result is obtained within a preset time or not; and the query module is used for responding to the processing result state that the processing result is not obtained within the preset time, querying the processing state of the target processing task and controlling the second system to work based on the query result, wherein the query result is used for representing whether the processing state of the target processing task is normal, and the second system is a downstream system of the first system.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the processing method of the message in any one of the above items when the computer program runs.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor and a memory, the processor being configured to run a program stored in the memory, wherein the program is configured to perform the method of processing a message of any of the above when run.
In the embodiment of the invention, a first message sent by a first system is firstly obtained, wherein the first message carries a task identifier of a target processing task, then the first system is controlled to process the target processing task based on the task identifier of the target processing task in the first message to obtain a processing result state, wherein the processing result state is used for representing whether a processing result is obtained within a preset time, and finally, in response to the fact that the processing result state is that the processing result is not obtained within the preset time, the processing state of the target processing task is inquired, and the second system is controlled to work based on the inquiry result, wherein the inquiry result is used for representing whether the task state of the target processing task is normal, and the second system is a downstream system of the first system, so that the efficiency of maintaining the data consistency between the systems is improved. It is easy to note that, when the processing result of the first system is not obtained, the processing state of the target processing task in the first system can be timely queried to determine whether the processing state of the target processing task is normal, and the second system can be controlled to work under the condition that the processing state of the target processing task is normal, so that the processing states of the target processing tasks in the systems are maintained to be normal, the consistency of data among the systems is maintained, and the technical problem of low efficiency in maintaining the consistency of the data among the systems in the related art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of processing a message according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a target task table according to an embodiment of the invention;
FIG. 3 is a process diagram of a query according to an embodiment of the invention;
FIG. 4 is a block diagram of a message processing process according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided a message processing method embodiment, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a method for processing a message according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, a first message sent by a first system is obtained.
The first message carries a task identifier of the target processing task.
The first system described above may be an upstream system. The first message may be a prepare message for prompting the first system to prepare for processing the target processing task.
In an alternative embodiment, the first message sent by the first system may be acquired through a message system, where the message system is configured to manage messages in each system.
The task identification of the target processing task may be an ID.
And step S104, controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message to obtain a processing result state.
And the processing result state is used for representing whether a processing result is obtained within a preset time.
In an optional embodiment, whether the target processing task is abnormal or not may be determined according to the task identifier of the target processing task in the first message, and if the target processing task is abnormal, the first system is prohibited from being controlled to process the target processing task, so as to avoid wasting processing resources of the first system. If no exception occurs, the first system can be controlled to process the target processing task, and a processing result state is obtained.
The preset time can be set by itself, and is mainly used as a basis for judging whether the processing result state is abnormal or not, if the processing result is obtained within the preset time, the processing result state is not abnormal, and the processing result is fed back normally, and if the processing result is not obtained within the preset time, the processing result state is abnormal, the processing result is not fed back normally, or the first system does not output the processing result. At this time, the first system needs to be checked back to check what causes the abnormal state of the processing result of the first system, and the processing is performed in time.
And S106, responding to the processing result state that the processing result is not obtained within the preset time, inquiring the processing state of the target processing task, and controlling the second system to work based on the inquiring result.
And the query result is used for representing whether the processing state of the target processing task is normal or not, and the second system is a downstream system of the first system.
In an optional embodiment, if the processing result state is that the processing result is not obtained within the preset time, it is indicated that the processing result state is abnormal, where the abnormality may be that the processing result is not obtained due to omission of the processing result in the transmission process, or that the processing result is not generated due to an abnormality occurring in the process of processing the target processing task, at this time, the processing state of the target processing task in the first system needs to be reversely queried, so that the reason that the processing result state is abnormal can be quickly queried, and the user can process the processing result in time.
In another optional embodiment, the processing state of the target processing task may be queried, and it is checked whether the processing state of the target processing task is successful or failed, and when the processing state of the target processing task is successful, it may be determined that the exception occurs in the processing result state because the processing result is lost in the transmission process, at this time, because the processing state of the target processing task is successful, at this time, a downstream system of the first system may be controlled to work, that is, the second system may be controlled to work, where the first system may be an upstream system of the second system, and a relationship between the first system and the second system may be an upstream-downstream relationship, and specifically, the second message may be sent to the second system, so as to control the second system to work according to the second message, and ensure consistency of upstream and downstream data.
Further, when the processing status of the target processing task is a processing failure, it may be determined that the processing result status is abnormal because the processing result is lost during transmission or the processing result is not generated after the processing failure. At this time, since the processing state of the target processing task is processing failure, the target processing task needs to be deleted, and the second system does not need to be controlled to work, so that the situation that data inconsistency occurs between the first system and the second system due to the fact that the first system fails to process the target processing task and the second system succeeds in processing the target processing task is avoided.
Through the steps, a first message sent by a first system is obtained, wherein the first message carries a task identifier of a target processing task, the first system is controlled to process the target processing task based on the task identifier of the target processing task in the first message, a processing result state is obtained, the processing result state is used for representing whether a processing result is obtained within preset time, and finally, the processing state of the target processing task is inquired in response to the fact that the processing result state is that the processing result is not obtained within the preset time, and a second system is controlled to work based on the inquiry result, wherein the inquiry result is used for representing whether the task state of the target processing task is normal, and the second system is a downstream system of the first system, so that the efficiency of maintaining data consistency between systems is improved. It is easy to note that, when the processing result of the first system is not obtained, the processing state of the target processing task in the first system can be timely queried to determine whether the processing state of the target processing task is normal, and the second system can be controlled to work under the condition that the processing state of the target processing task is normal, so that the processing states of the target processing tasks in the systems are maintained to be normal, the consistency of data among the systems is maintained, and the technical problem of low efficiency in maintaining the consistency of the data among the systems in the related art is solved.
Optionally, in response to that the processing result status is that no processing result is obtained within the preset time, querying the processing status of the target processing task, and controlling the second system to work based on the query result, including: in response to the processing result state that the processing result is not obtained within the preset time, inquiring the processing state of the target processing task based on the task identifier and a target task table in the first system to obtain an inquiry result, wherein the target task table is used for representing the corresponding relation between the task identifier and the processing state; in response to the condition that the query result is the processing state of the target processing task which is not queried, marking a preset state on the task identifier of the target processing task in the target task table to obtain a marking result; and in response to the condition that the labeling result is the labeling failure, determining the processing state of the target processing task as the processing success, and controlling the second system to work.
The query result may be used to indicate whether the processing state of the target processing task is queried or not, and may also be used to indicate whether the processing state of the target processing task is normal or not when the processing state of the target processing task is queried.
The task identification described above may be a unique identification of the target processing task.
The target task table may record a task identifier of each to-be-processed task and a processing state of each to-be-processed task, where the task identifiers correspond to the processing states one to one. As shown in fig. 2, a target task table may be used, where the task ID may be 1001 or 1002, the processing status corresponding to 1001 may be success, and the processing status corresponding to 1002 may be failure.
In an optional embodiment, if the processing result state is that the processing result is not obtained within the preset time, it indicates that a problem may occur in the transmission mechanism of the first system, and at this time, the first system needs to be reversely queried, and specifically, the processing state of the target processing task may be queried in the target task table in the first system according to the task identifier of the target processing task, so as to obtain a query result.
Further, if the query result indicates that the processing state of the target processing task is not queried, it indicates that the target processing task may not be processed, or the state is not updated, at this time, a preset state may be marked to the task identifier of the target processing task in the target task table, where the preset state may be a state of processing failure, and it is determined whether the marking fails, and if the marking fails, it indicates that the target processing task has been processed successfully, but the target processing task is not updated in the target task table.
Optionally, the method further comprises: and in response to the fact that the labeling result is successful, determining that the processing state of the target processing task is processing failure, and deleting the target processing task in the target task table.
In an alternative embodiment, if the tagging result is successful, it indicates that the processing state of the target processing task is indeed a processing failure state, and in order to ensure data consistency between the other system and the first system, the target processing task needs to be deleted in the target task table. Specifically, the task identifier of the target processing task can be deleted, and the target processing task is prevented from being processed by a subsequent system, so that data inconsistency is avoided.
The target task table can be constructed by the current database.
The processing state corresponding to the target processing task is inquired in a labeling mode, so that the current state of the target processing task can be rapidly determined, the target processing task is processed conveniently, and the processing efficiency is improved.
As shown in fig. 3, which is a schematic diagram of a query process, a query request may be first sent to a first system to query a target task table in the first system, and if a query result of the target task table for a target processing task is empty, the request may be continuously sent, a record whose state is "failure" is inserted into a processing state corresponding to a task identifier, and if the first system feeds back a "unique key collision" error, it indicates that the processing state of the target processing task by the first system is processing success, and at this time, a second system may be notified to control a second system to operate; if the first system feeds back "insert success", it indicates that the target processing task in the first system has rolled back, that is, the processing state of the target processing task is failure, and at this time, the target processing task needs to be deleted or the task identifier corresponding to the target processing task needs to be deleted in the target task table, so as to prevent the subsequent system from processing the target processing task. If the processing state of the target processing task is found in the target task table, the second system may be notified to control the second system to operate if the processing state is successful, and the target processing task may be deleted if the processing state is failed.
Optionally, the method further comprises: and responding to the processing state of the target processing task which is inquired by the inquiry result, and controlling the second system to work based on the processing state.
In an optional embodiment, if the query result is the processing state of the queried target processing task, it indicates that the processing result is lost in the transmission process, and at this time, the second system may be controlled to operate according to the queried processing state, so as to improve the processing efficiency of the system.
Optionally, controlling the second system to operate based on the processing state comprises: responding to the processing state being satisfied, and controlling the second system to work; and in response to the processing state being satisfied as processing failure, deleting the target processing task in the target task table.
In an optional embodiment, if the processing status is processing success, it indicates that the target processing task has been successfully processed in the first system, and at this time, the target processing task may be processed in the second system to ensure consistency of data between the systems.
Optionally, the method further comprises: and controlling the second system to work based on the processing result in response to the processing result state that the processing result is obtained within the preset time.
In an alternative embodiment, if the processing result status is that the processing result is obtained within the preset time, it indicates that the data transmission mechanism between the systems is normal, and at this time, the second system may be controlled to operate according to the processing result, so as to ensure the consistency of data between the systems.
Optionally, controlling the second system to operate based on the processing result, comprising: responding to the processing state meeting the processing result as the target processing task as successful processing, and controlling the second system to work; and deleting the target processing task in the target task table in response to the processing state meeting the processing result as the target processing task being processing failure.
In an alternative embodiment, a notification message may be sent to the second system to control the second system to operate when the received processing result is that the processing status of the target processing task is processing success. And under the condition that the processing state of the target processing task is successful, deleting the target processing task from the target task table, so that the second system is prevented from processing the target processing task, and the consistency of data among the systems is kept.
Optionally, controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message, and obtaining a processing result state, where the processing result state includes: judging whether the task identifier of the target processing task in the first message is abnormal or not; in response to the fact that the task identification of the target processing task in the first message is abnormal, the first system is prohibited from being controlled to process the target processing task; and in response to the fact that the task identifier of the target processing task in the first message is not abnormal, controlling the first system to process the target processing task to obtain a processing result state.
In an optional embodiment, after receiving the first message, it may be determined whether a task identifier of the target processing task is abnormal, for example, the target processing task fails to be processed in another system, or the target processing task is already processed, if there is an abnormality, it is necessary to prohibit controlling the first system to process the target processing task, it is to be noted that the first system may also be a downstream system of another system, if the target processing task is abnormal, it is necessary to prohibit controlling the first system to process the target processing task in order to maintain consistency of data between systems, and if there is no abnormality in the task identifier of the target processing task in the first message, the first system may be controlled to process the target processing task, so as to obtain a processing result state.
Referring to fig. 4, a detailed description is given below, where as shown in fig. 4, a structure diagram of a message processing process is shown, a first system may send a preparation message to a message system, that is, send the first message to the message system, where the preparation message carries a unique task identifier of a target processing task, and then the message system may send a second message to the first system when it is determined that the unique task identifier of the target processing task in the first message is not abnormal, where the second message is used to indicate that the unique task identifier is not abnormal, and at this time, the first system may process the target processing task according to the fed-back second message, where the target processing task may be one or more; after the processing is successful, a record of the "task identifier" may be inserted into the target task table, the processing state of the task identifier is marked as "successful", and after the processing is failed, the task identifier may be deleted from the target task table. Further, the first system may generate a processing result and send the processing result to the message system after the processing is successful, and if the message system does not receive the processing result within the preset time, the first system may be queried reversely so as to obtain the processing state of the target processing task quickly, so as to notify the second system according to the processing state, so as to control the second system to work.
Example 2
According to an embodiment of the present invention, an embodiment of a message processing apparatus is provided, and fig. 5 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention, as shown in fig. 5, the method includes the following steps:
an obtaining module 52, configured to obtain a first message sent by a first system, where the first message carries a task identifier of a target processing task;
the control module 54 is configured to control the first system to process the target processing task based on the task identifier of the target processing task in the first message, so as to obtain a processing result state, where the processing result state is used to indicate whether a processing result is obtained within a preset time;
and the query module 56 is configured to query the processing state of the target processing task in response to the processing result state being that a processing result is not obtained within the preset time, and control the second system to work based on the query result, where the query result is used to represent whether the processing state of the target processing task is normal, and the second system is a downstream system of the first system.
Optionally, the query module includes: the query unit is used for responding to the processing result state that the processing result is not obtained within the preset time, and querying the processing state of the target processing task based on the task identifier and a target task table in the first system to obtain a query result, wherein the target task table is used for representing the corresponding relation between the task identifier and the processing state; the marking unit is used for marking a preset state on the task identifier of the target processing task in the target task table in response to the condition that the query result is the processing state of the target processing task which is not queried, so as to obtain a marking result; and the determining unit is used for responding to the condition that the labeling result is the labeling failure, determining the processing state of the target processing task as the processing success, and controlling the second system to work.
Optionally, the apparatus further comprises: and the determining module is used for determining the processing state of the target processing task as processing failure in response to the fact that the labeling result is satisfied and the labeling is successful, and deleting the target processing task in the target task table.
Optionally, the control module is further configured to control the second system to operate based on the processing state in response to the processing state of the target processing task being queried according to the query result.
Optionally, the control module comprises: the control unit is used for responding to the condition that the processing state is satisfied and the processing is successful, and controlling the second system to work; and the deleting unit is used for deleting the target processing task in the target task table in response to the processing state is satisfied and the processing fails.
Optionally, the control module is further configured to control the second system to operate based on the processing result in response to the processing result status being that the processing result is obtained within the preset time.
Optionally, the control unit is further configured to control the second system to operate in response to the processing status that the processing result is satisfied as the target processing task is processing success; the deleting unit is further configured to delete the target processing task in the target task table in response to the processing status satisfying the processing result as the target processing task being a processing failure.
Optionally, the processing module comprises: the judging unit is used for judging whether the task identifier of the target processing task in the first message is abnormal or not; the prohibiting unit is used for responding to the abnormality of the task identifier of the target processing task in the first message and prohibiting the first system from being controlled to process the target processing task; and the processing unit is used for responding to the fact that the task identifier of the target processing task in the first message is not abnormal, and controlling the first system to process the target processing task to obtain a processing result state.
Example 3
According to an embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the processing method of the message in any one of the above items when the computer program runs.
Example 4
According to an embodiment of the present invention, there is also provided an electronic device including: a processor and a memory, the processor being configured to run a program stored in the memory, wherein the program is configured to perform the method of processing a message of any of the above when run.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A method for processing a message, comprising:
acquiring a first message sent by a first system, wherein the first message carries a task identifier of a target processing task;
controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message to obtain a processing result state, wherein the processing result state is used for representing whether a processing result is obtained within a preset time;
and in response to the processing result state that the processing result is not obtained within the preset time, querying the processing state of the target processing task, and controlling a second system to work based on the query result, wherein the query result is used for representing whether the processing state of the target processing task is normal, and the second system is a downstream system of the first system.
2. The method of claim 1, wherein in response to the processing result status being that the processing result is not obtained within the preset time, querying the processing status of the target processing task and controlling a second system to work based on the query result comprises:
responding to the processing result state that the processing result is not obtained within the preset time, inquiring the processing state of the target processing task based on a task identifier and a target task table in the first system to obtain an inquiry result, wherein the target task table is used for representing the corresponding relation between the task identifier and the processing state;
in response to the condition that the query result is the processing state of the target processing task which is not queried, marking a preset state on the task identifier of the target processing task in the target task table to obtain a marking result;
and in response to the fact that the marking result is a marking failure, determining that the processing state of the target processing task is a processing success, and controlling the second system to work.
3. The method of claim 2, further comprising:
and in response to the fact that the marking result is successful, determining that the processing state of the target processing task is processing failure, and deleting the target processing task in the target task table.
4. The method of claim 2, further comprising:
and responding to the processing state of the target processing task which is inquired by the inquiry result, and controlling the second system to work based on the processing state.
5. The method of claim 4, wherein controlling the second system operation based on the processing state comprises:
responding to the condition that the processing state is successful, and controlling the second system to work;
and in response to the processing state is satisfied as processing failure, deleting the target processing task in the target task table.
6. The method of claim 1, further comprising:
and controlling the second system to work based on the processing result in response to the processing result state that the processing result is obtained within the preset time.
7. The method of claim 2, wherein controlling the second system operation based on the processing result comprises:
responding to the processing result that the processing state of the target processing task is successful, and controlling the second system to work;
and deleting the target processing task in the target task table in response to the processing result is satisfied that the processing state of the target processing task is processing failure.
8. The method of claim 1, wherein controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message to obtain a processing result status comprises:
judging whether the task identifier of the target processing task in the first message is abnormal or not;
in response to the fact that the task identifier of the target processing task in the first message is abnormal, the first system is prohibited from being controlled to process the target processing task;
and in response to the fact that the task identifier of the target processing task in the first message is not abnormal, controlling the first system to process the target processing task to obtain the processing result state.
9. An apparatus for processing a message, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module acquires a first message sent by a first system, and the first message carries a task identifier of a target processing task;
the processing module is used for controlling the first system to process the target processing task based on the task identifier of the target processing task in the first message to obtain a processing result state, wherein the processing result state is used for representing whether a processing result is obtained within a preset time or not;
and the query module is used for responding to the processing result state that the processing result is not obtained within the preset time, querying the processing state of the target processing task, and controlling a second system to work based on the query result, wherein the query result is used for representing whether the processing state of the target processing task is normal, and the second system is a downstream system of the first system.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to execute a method of processing a message as claimed in any one of claims 1 to 8 when executed.
11. An electronic device, comprising: a processor and a memory, the processor being configured to execute a program stored in the memory, wherein the program is configured to perform the method of processing a message as claimed in any one of claims 1 to 8 when executed.
CN202111564788.5A 2021-12-20 2021-12-20 Message processing method and device, storage medium and electronic equipment Pending CN114416392A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111564788.5A CN114416392A (en) 2021-12-20 2021-12-20 Message processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111564788.5A CN114416392A (en) 2021-12-20 2021-12-20 Message processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114416392A true CN114416392A (en) 2022-04-29

Family

ID=81267033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111564788.5A Pending CN114416392A (en) 2021-12-20 2021-12-20 Message processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114416392A (en)

Similar Documents

Publication Publication Date Title
CN109815291B (en) Data synchronization method and device, electronic equipment and storage medium
CN111274052A (en) Data distribution method, server, and computer-readable storage medium
CN106059825A (en) Distributed system and configuration method
CN113179304B (en) Message issuing method, system, device and storage medium
CN112039718B (en) Upgrade state detection method, server, equipment and storage medium
CN112418794A (en) Service transfer method and device
CN111460038A (en) Quasi-real-time data synchronization method and device
CN113946427A (en) Task processing method, processor and storage medium for multi-operating system
CN113900842A (en) Message consumption method and device, electronic equipment and computer storage medium
CN111371645A (en) Method, system, computer equipment and storage medium for testing service connectivity
CN113726642A (en) Problematic part processing method and system
CN114416392A (en) Message processing method and device, storage medium and electronic equipment
CN110688252A (en) Data recovery method, data backup device and storage medium
CN111880949B (en) Service information processing method, system, device, server and terminal
CN112860746B (en) Cache reduction-based method, equipment and system
US20150234866A1 (en) Data Distribution System
EP4092961A1 (en) Group updating method, message sending method, and apparatuses
CN114020368A (en) Information processing method and device based on state machine and storage medium
CN114298830A (en) Batch service processing method and device and batch service processing platform
CN110213322B (en) Content publishing processing method, client and server for community
CN108319679B (en) Method and device for generating primary key
CN113535727A (en) Data output method and data output device of information system and electronic equipment
CN112035411A (en) Log alarm method, device and system and electronic equipment
CN112231612A (en) Configuration information transmission method and device, storage medium and electronic device
CN111767299A (en) Database operation method, device and system, storage medium and electronic equipment

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