CN114356608A - Service message delivery method and device, readable storage medium and electronic equipment - Google Patents

Service message delivery method and device, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN114356608A
CN114356608A CN202210009921.9A CN202210009921A CN114356608A CN 114356608 A CN114356608 A CN 114356608A CN 202210009921 A CN202210009921 A CN 202210009921A CN 114356608 A CN114356608 A CN 114356608A
Authority
CN
China
Prior art keywords
service
sub
calling
message
sequence
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
CN202210009921.9A
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.)
Beijing Lifangtong Payment Technology Co ltd
Original Assignee
Beijing Lifangtong Payment 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 Beijing Lifangtong Payment Technology Co ltd filed Critical Beijing Lifangtong Payment Technology Co ltd
Priority to CN202210009921.9A priority Critical patent/CN114356608A/en
Publication of CN114356608A publication Critical patent/CN114356608A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the disclosure discloses a service message delivery method, a device, a computer readable storage medium and an electronic device, wherein the method comprises the following steps: receiving a service calling message sent by a service message generation system; analyzing the service calling message to obtain sub-service calling strategy information; determining the calling sequence of the sub-service systems in the sub-service system set to be called based on the sub-service calling strategy information; and delivering the sub-service calling message to the sub-service systems in the sub-service system set based on the calling sequence. The embodiment of the disclosure improves the strategy of message delivery, can flexibly call the sub-service system according to various strategies by configuring and calling strategy information, meets various message delivery strategies required in service, and is beneficial to reducing the risk of repeated development and maintenance of the service and the safety risk of a convergence system.

Description

Service message delivery method and device, readable storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for delivering a service message, a computer-readable storage medium, and an electronic device.
Background
In a message delivery system, there may be generally included a message publisher that sends a message, a message subscriber that receives a message, and message middleware that supports receiving messages from message publishers and delivering to message subscribers. The message middleware may deliver a message to a message subscriber in response to a message retrieved from a message publisher to be delivered to the message subscriber.
At present, most message delivery depends on a service system, and a timeout/abnormal retry mechanism is adopted to support message delivery of a single address or an equivalent batch address.
Disclosure of Invention
The embodiment of the disclosure provides a service message delivery method, a service message delivery device, a computer-readable storage medium and electronic equipment.
The embodiment of the disclosure provides a service message delivery method, which comprises the following steps: receiving a service calling message sent by a service message generation system; analyzing the service calling message to obtain sub-service calling strategy information; determining the calling sequence of the sub-service systems in the sub-service system set to be called based on the sub-service calling strategy information; and delivering the sub-service calling message to the sub-service systems in the sub-service system set based on the calling sequence.
In some embodiments, parsing the service invocation message to obtain sub-service invocation policy information includes: determining calling type information based on the service calling message; and acquiring sub-service calling strategy information corresponding to the calling type information.
In some embodiments, determining the calling order of the sub-service systems in the set of sub-service systems to be called based on the sub-service calling policy information includes: based on the sub-service calling strategy information, a tree data structure which takes the message generation system as a root node and takes the sub-service system in the sub-service system set as a sub-node is constructed; and determining the access sequence of each sub node from the tree data structure as the calling sequence of the sub service systems in the sub service system set based on the calling type information.
In some embodiments, determining, from the tree data structure, an access order of the respective child nodes as a calling order of the child business systems in the set of child business systems based on the call type information includes: and in response to the fact that the calling type information indicates that the access sequence is the breadth sequence, determining the calling sequence of the sub-service systems respectively corresponding to the sub-nodes according to the sequence of the levels included in the tree data structure and the arrangement sequence of the sub-nodes in the levels.
In some embodiments, determining, from the tree data structure, an access order of the respective child nodes as a calling order of the child business systems in the set of child business systems based on the call type information includes: and in response to the fact that the calling type information indicates that the access sequence is the depth sequence, determining the calling sequence of the sub-service system corresponding to each sub-node according to the sequence of the sub-nodes included in each complete path in the tree data structure.
In some embodiments, delivering a sub-service invocation message to a sub-service system in the set of sub-service systems based on the order of invocation includes: determining whether the current process of calling the sub-service system through the delivery sub-service calling message meets a preset calling failure condition; and if the calling failure condition is met, generating calling failure information.
In some embodiments, determining whether a process currently calling the sub-service system through the delivery sub-service calling message meets a preset calling failure condition includes: determining whether the process of calling the sub-service system is overtime or not based on the preset overtime duration respectively corresponding to the sub-service systems in the sub-service system set; responding to overtime of the process of calling the sub-service system at present, and executing re-calling operation; and determining that the calling failure condition is met in response to the fact that the number of times of executing the re-calling operation is larger than the preset number of times.
According to another aspect of the disclosed embodiments, there is provided a service message delivery apparatus, including: the receiving module is used for receiving the service calling message sent by the service message generating system; the analysis module is used for analyzing the service calling message to obtain sub-service calling strategy information; the determining module is used for determining the calling sequence of the sub-service systems in the sub-service system set to be called based on the sub-service calling strategy information; and the delivery module is used for delivering the sub-service calling message to the sub-service systems in the sub-service system set based on the calling sequence.
According to another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the service message delivery method.
According to another aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; and the processor is used for reading the executable instruction from the memory and executing the instruction to realize the service message delivery method.
According to another aspect of an embodiment of the present disclosure, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the above-mentioned service message delivery method.
Based on the service message delivery method, device, computer readable storage medium, electronic device and computer program product provided by the embodiments of the present disclosure, the service message is received and sent by the service message generation system, the service call message is analyzed to obtain sub-service call policy information, then the call sequence of each sub-service system is determined based on the sub-service call policy information, and finally the sub-service call message is delivered to the sub-service systems in the sub-service system set based on the call sequence, so that the sub-service call policy information is realized, a certain service system calls the sub-service systems in the sub-service system set according to a certain policy during operation, the policy of message delivery is greatly improved, the sub-service systems can be flexibly called according to various policies by configuring the call policy information, and various message delivery policies required on the service are satisfied, the method is beneficial to reducing the repeated development and maintenance of the service and the safety risk of a convergence system.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a system diagram to which the present disclosure is applicable.
Fig. 2 is a flowchart illustrating a service message delivery method according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart illustrating a service message delivery method according to another exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating a service message delivery method according to another exemplary embodiment of the present disclosure.
FIG. 5 is a schematic diagram of one tree diagram of an embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of a service message delivery apparatus according to an exemplary embodiment of the present disclosure.
Fig. 7 is a schematic structural diagram of a service message delivery apparatus according to another exemplary embodiment of the present disclosure.
Fig. 8 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Summary of the application
At present, most service Message delivery methods mainly implement Message delivery between systems through a delay Queue or some Message middleware, but support for delivery policies is relatively simple, for example, MQ (Message Queue) only supports custom delay and first-level batch push, RabbitMq (Message-oriented middleware) needs plug-in to implement Message delivery between systems, and the like.
The service message delivery method provided by the embodiment of the disclosure is independent of a service system, has no specific service attribute, and can be deployed independently. The method mainly solves the problems of how to implement strategic ladder delivery, repeated development and maintenance of functions, high availability and high concurrency of service system messages and the like.
Exemplary System
Fig. 1 illustrates an exemplary system architecture 100 of a service message delivery method or service message delivery apparatus to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include a business message generation system 101, a network 102, a messaging engine system 103, and a set of sub-business systems 104. Network 102 is the medium used to provide communication links between message generation system 101, messaging engine system 103, and set of sub-business systems 104. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The service message generation system 101 is configured to generate a service call message according to a service requirement, and send the service call message to the message sending engine system 103 in a manner of a message queue, http (hypertext Transfer Protocol), https (hypertext Transfer Protocol over Secure Socket Layer), and the like. The message sending engine system 103 is configured to parse the service invocation message, and invoke the sub-service system from the sub-service system set 104 based on the sub-service invocation policy information obtained after parsing, where the invocation is to send the sub-service invocation message to the sub-service system in the sub-service system set. The set of sub-business systems 104 includes a plurality of sub-business systems, and as shown in FIG. 1, the set of sub-business systems 104 includes n sub-business systems. The sub-business systems may be provided in the same electronic device (e.g., server) or may be provided in different electronic devices.
The service message generation system 101, the message sending engine system 103, and the sub-service system set 104 may be respectively disposed in different electronic devices, or any at least two components of the system architecture may be disposed in the same electronic device. For example, the business message generation system 101 and the set of sub-business systems 104 are located on the same server or server cluster, and the messaging engine system 103 is located on another service.
It should be noted that the service message delivery method provided by the embodiment of the present disclosure is generally executed by the message sending engine system 103, and accordingly, the service message delivery apparatus is generally disposed in the message sending engine system 103.
It should be understood that the number of the service message generation system 101, the network 102, the messaging engine system 103, and the set of sub-service systems 104 in fig. 1 are merely illustrative. There may be any number of business message generation systems 101, networks 102, messaging engine systems 103, and sub-business system collections 104, as desired for an implementation.
Exemplary method
Fig. 2 is a flowchart illustrating a service message delivery method according to an exemplary embodiment of the present disclosure. The present embodiment can be applied to an electronic device (such as the electronic device for setting the message sending engine system 103 shown in fig. 1), and as shown in fig. 2, the method includes the following steps:
step 201, receiving a service call message sent by a service message generation system.
In this embodiment, the electronic device may receive a service invocation message sent by the service message generation system 101 as shown in fig. 1. The service calling message is used for indicating that the service message generating system needs to call other sub-service systems currently to complete corresponding service processes. As an example, the service message generation system provides support for the ordering operation of the user, and if the user does not pay within ten minutes after ordering, the order is automatically closed, and meanwhile, an order closing notification is sent, and the order closing notification is a service call message. The electronic device needs to send a sub-service call message indicating a policy making notification to the sub-service system, so that the sub-service system restores the reduced quantity of the items corresponding to the order to the quantity before placing the order.
For another example, the system a (service message generation system) is responsible for the basic data of the merchant, the system B (sub-service system) is responsible for the account opening of the merchant, and the system C (sub-service system) is responsible for the rate configuration of the merchant. Then the system a notifies the system B and the system C of opening the account and configuring the basic rate at the same time after the merchant successfully resides. Therefore, the system A sends a service calling message indicating that the merchant successfully resides to the electronic device, and the electronic device sends sub-service calling messages to the system B and the system C respectively, so that the system B and the system C perform operations of opening an account and configuring a basic rate.
Step 202, analyzing the service calling message to obtain sub-service calling strategy information.
In this embodiment, the electronic device may parse the service invocation message to obtain sub-service invocation policy information. The sub-service invocation policy information is used to determine the set of sub-service systems to be invoked and the invocation order of each sub-service system from the set of sub-service systems 104 shown in fig. 1. The sub-service calling policy information is a policy indicating that each sub-service system is called in advance, and the policy may be set as needed, for example, sequentially called according to the hierarchical order of the called sub-service systems, or preferentially calling sub-service systems across multiple hierarchies arranged in a chain-like order.
As an example of the execution manner of this step, a table representing a corresponding relationship between the service invocation message and the sub-service invocation policy information may be stored in advance in the electronic device, and the electronic device extracts the corresponding sub-service invocation policy information according to the received service invocation message.
Optionally, the electronic device may determine, from a preset database, sub-service invocation policy information corresponding to the service invocation message. The database stores the relationship among the sub-service systems when the sub-service systems are called. For example, the database may include a table for representing the relationship between the service invocation message and the sub-service systems, and the name of the sub-service system corresponding to the service invocation message and the relationship between the sub-service systems may be found from the table. The database may be located locally on the electronic device or in another device communicatively coupled to the electronic device. The user may configure the sub-service invocation policy information in the database in advance.
Step 203, determining the calling sequence of the sub-service systems in the sub-service system set to be called based on the sub-service calling strategy information.
In this embodiment, the electronic device may determine, based on the sub-service invocation policy information, an invocation order of the sub-service systems in the sub-service system set to be invoked. As an example, the sub-service invocation policy information includes the number of each sub-service system to be invoked, and the sequence of the numbers, according to which the invocation sequence of each sub-service system can be determined.
And step 204, delivering a sub-service calling message to the sub-service systems in the sub-service system set based on the calling sequence.
In this embodiment, the electronic device may deliver the sub-service invocation message to the sub-service systems in the sub-service system set based on the invocation order. The sub-service calling message is used for indicating that the corresponding sub-service system needs to be called currently to execute the corresponding service process. Generally, after the called sub-service system executes the corresponding service flow, the execution result can be sent back to the electronic device, and the electronic device continues to call the next sub-service system; or directly sending the execution result to the next sub-service system.
The method provided by the above embodiment of the present disclosure obtains sub-service invocation policy information by receiving the service invocation message sent by the service message generation system, parsing the service invocation message, then determining the calling sequence of each sub-service system based on the sub-service calling strategy information, and finally delivering the sub-service calling information to the sub-service systems in the sub-service system set based on the calling sequence, thereby realizing that the sub-service calling strategy information is based on that a certain service system calls the sub-service systems in the sub-service system set according to a certain strategy when in operation, greatly improving the strategy of message delivery, the sub-service system can be flexibly called according to various strategies by configuring and calling strategy information, various message delivery strategies required in service are met, and the safety risks of repeated development and maintenance of the service and convergence of the system are reduced.
In some alternative implementations, step 204 may be performed as follows:
firstly, whether the process of calling the sub-service system by delivering the sub-service calling message meets the preset calling failure condition is determined.
The information indicating the call failure condition may be preset in the electronic device, and the electronic device may monitor the execution state of the currently called sub-service system in real time to determine whether the execution state meets the call failure condition.
As an example, the failure condition may include that the call result returned by the sub-service system currently called is not received within a preset time length.
And then, if the calling failure condition is met, generating calling failure information.
The call failure information may be information in various forms, such as text, symbols, images, sounds, and the like. Generally, the electronic device may output the call failure information, for example, on a display comprised by the electronic device, or transmit the call failure information to other electronic devices (e.g., user terminals).
Optionally, the electronic device may stop the call to the sub-service system set after determining that the call fails. Or, the electronic device may skip the sub-service system that fails to be currently called, and continue to call other sub-service systems.
The realization mode generates the calling failure information when the calling of the sub-service system fails by setting the calling failure condition, thereby enabling a user to know the condition of calling the sub-service system in time and being beneficial to timely adjusting the strategy for calling the sub-service system set.
In some optional implementations, the electronic device may determine whether a process of currently calling the sub-service system by delivering the sub-service call message meets a preset call failure condition according to the following steps:
firstly, determining whether the process of calling the sub-service system is overtime or not based on the preset overtime duration respectively corresponding to the sub-service systems in the sub-service system set.
Specifically, if the calling result returned by the sub-service system is still not received after a preset timeout period (for example, 10 seconds) after the sub-service calling message is sent to the currently called sub-service system, or information indicating a calling failure returned by the sub-service system is received after the preset timeout period, it is determined whether the process of calling the sub-service system is overtime.
And executing the re-calling operation in response to the timeout of the current process for calling the sub-business system.
Specifically, the sub-service invocation message may be re-sent to the currently invoked sub-service system for re-invocation.
And determining that the calling failure condition is met in response to the fact that the number of times of executing the re-calling operation is larger than the preset number of times.
The retry interval time between two times of re-calling operations can be set arbitrarily, for example, 1 second, 1 minute, 10 minutes, and so on. If the execution times of the re-calling operation are larger than the preset times, the calling fails.
It should be noted that the information indicating the call failure condition, such as a preset timeout period, a preset number of times of performing the recall operation, a retry interval period, etc., may be stored in the electronic device, or in another device connected to the electronic device. The electronic device may obtain such information indicative of call failure conditions to complete the monitoring of sub-business system calls.
According to the implementation mode, by setting conditions such as the overtime length and the maximum retry number, the calling can be recovered as far as possible under the condition that the calling fails, and the execution success rate of the calling strategy is improved.
With further reference to fig. 3, a flow diagram of yet another embodiment of a service message delivery method is shown. As shown in fig. 3, based on the embodiment shown in fig. 2, step 202 may include the following steps:
step 2021, determining the call type information based on the service call message.
The calling type information is used for representing the principle classification followed by the sequence of calling the sub-service systems when the sub-service systems are called. For example, the order of calling the type information token may include a breadth order and a depth order, and refer to the following embodiments. Generally, the service invocation message may include invocation type information, and the electronic device may extract the invocation type information from the service invocation message.
Step 2022, obtaining the sub-service calling policy information corresponding to the calling type information.
Wherein, different calling type information corresponds to different calling sequences. For example, the calling type information indicates the breadth order when the number is 0, and indicates the depth order when the number is 1. Different calling orders are indicated by different sub-service calling strategy information. As an example, for one service invocation message, at least one table may be set in the database, and different sub-service invocation policy information is stored respectively. The electronic equipment can obtain the sub-service calling strategy information corresponding to the calling type information from the database. The correspondence between the call type information and the sub-service call policy information may be set in advance by configuring a database in advance.
The method provided by the embodiment corresponding to fig. 3 obtains the sub-service calling policy information corresponding to the calling type information by determining the calling type information, thereby implementing different calling policies for the sub-service system according to different calling type information, and improving flexibility of service calling.
In some optional implementations, based on the corresponding embodiment of fig. 3, as shown in fig. 4, step 203 may be performed as follows:
step 2031, based on the sub-service calling policy information, a tree data structure is constructed with the message generation system as a root node and the sub-service systems in the sub-service system set as sub-nodes.
Relationships between child nodes in the tree data structure may be represented by links between the child nodes. As shown in fig. 5, a tree diagram corresponding to the tree data structure is shown, wherein each circle represents a node, node a is a root node and represents a message generation system, and node B, C, D, E, F is a child node and represents each sub-service system. The line with arrows indicates the dependency relationship of the sub-service system calls, for example, the arrows pointing to nodes E and F from node B indicate that the sub-service system corresponding to node B must be executed first, and then the sub-service systems corresponding to node B must be executed E, F.
Step 2032, based on the calling type information, determining the access sequence of each sub-node from the tree data structure as the calling sequence of the sub-service system in the sub-service system set.
Wherein, different calling type information corresponds to different access sequences. For example, the calling type information indicates the breadth order when the number is 0, and indicates the depth order when the number is 1.
According to the implementation mode, the tree-shaped data structure is built, and the access sequence of the sub-nodes is determined according to the calling type information, so that the characteristics of intuition and convenience in construction of the tree-shaped data structure are effectively utilized, and different calling strategies can be conveniently and accurately executed on each sub-service system.
In some optional implementations, step 2032 may include:
and in response to the fact that the calling type information indicates that the access sequence is the breadth sequence, determining the calling sequence of the sub-service systems respectively corresponding to the sub-nodes according to the sequence of the levels included in the tree data structure and the arrangement sequence of the sub-nodes in the levels.
Breadth-sequential means that when a child node is accessed, all child nodes in the same hierarchy are preferentially accessed. As shown in FIG. 5, the first level includes child node B, C, D and the second level includes child node E, F. And when the access sequence is the breadth sequence, sequentially accessing the child nodes in the first hierarchy and the second hierarchy, namely sequentially calling the corresponding child service systems according to the sequence of B-C-D-E-F.
Generally, the sub-service invocation policy information corresponding to the breadth order is shown in table 1 below:
TABLE 1
Node numbering Name of service system Child node Father node Call type information
01 System B 01 -1 0
02 System C 02 -1 0
03 System D 03 -1 0
04 System E 04 01 0
05 System F 05 01 0
In table 1, a node with a number of-1 represents a root node, that is, a node a shown in fig. 5, the call type information is 0, the current access sequence is an extent sequence, and the corresponding service system numbers in the child node column and the parent node column represent the parent-child relationship of the service system numbers. Since the call type information is 0, the access order of the child nodes can be set in the tree data structure, i.e., the access order is B-C-D-E-F.
In some optional implementations, step 2032 may include:
and in response to the fact that the calling type information indicates that the access sequence is a depth sequence, determining the calling sequence of the sub-service systems respectively corresponding to the sub-nodes according to the arrangement sequence of the complete paths in the tree data structure.
Depth order means that when a child node is visited, all child nodes in the same full path are visited preferentially. The complete path refers to a path triggered from the root node and passing through the most child nodes. As an example, in the tree diagram shown in fig. 5, starting from the root node a, the connecting line passing through the most child nodes is a complete path in the direction indicated by the arrow. For example, A-B-E is a full path, and therefore, nodes on the full path are invoked preferentially. A-B-F is another complete path, but since A, B has already been called, F is called after E. A-C and A-D are full paths, respectively, and therefore C, D is called after F is called. Namely, the corresponding sub-service systems are sequentially called according to the sequence of B-E-F-C-D.
Generally, the sub-service invocation policy information corresponding to the depth order is shown in table 2 below:
TABLE 2
Node numbering Name of service system Child node Father node Call type information
01 System B 01 -1 1
02 System C 02 -1 1
03 System D 03 -1 1
04 System E 04 01 1
05 System F 05 01 1
In table 2, the call type information of 1 indicates that the current access order is the depth order. Since the call type information is 1, the access order of the child nodes can be set in the tree data structure, i.e., the access order is B-E-F-C-D.
The two optional implementation modes provide two different calling strategies of the sub-service system, the two calling strategies can be suitable for different service scenes, the calling strategy of the sub-service system is further improved, and the application scenes of the service message delivery method are enriched.
Exemplary devices
Fig. 6 is a schematic structural diagram of a service message delivery apparatus according to an exemplary embodiment of the present disclosure. The embodiment can be applied to an electronic device, as shown in fig. 6, the service message delivery apparatus includes: a receiving module 601, configured to receive a service invocation message sent by a service message generation system; the parsing module 602 is configured to parse the service invocation message to obtain sub-service invocation policy information; a determining module 603, configured to determine, based on the sub-service calling policy information, a calling order of the sub-service systems in the set of sub-service systems to be called; and a delivery module 604, configured to deliver the sub-service call message to the sub-service systems in the sub-service system set based on the call sequence.
In this embodiment, the receiving module 601 may receive a service invocation message sent by the service message generation system 101 shown in fig. 1. The service calling message is used for indicating that the service message generating system needs to call other sub-service systems currently to complete corresponding service processes. As an example, the service message generation system provides support for the ordering operation of the user, and if the user does not pay within ten minutes after ordering, the order is automatically closed, and meanwhile, an order closing notification is sent, and the order closing notification is a service call message. The device needs to send a sub-service call message indicating a policy-related notification to the sub-service system, so that the sub-service system restores the reduced quantity of the items corresponding to the order to the quantity before placing the order.
In this embodiment, the parsing module 602 may parse the service invocation message to obtain sub-service invocation policy information. The sub-service invocation policy information is used to determine the set of sub-service systems to be invoked and the invocation order of each sub-service system from the set of sub-service systems 104 shown in fig. 1. The sub-service calling policy information is a policy indicating that each sub-service system is called in advance, and the policy may be set as needed, for example, sequentially called according to the hierarchical order of the called sub-service systems, or preferentially calling sub-service systems across multiple hierarchies arranged in a chain-like order.
As an example, a table representing a corresponding relationship between the service invocation message and the sub-service invocation policy information may be stored in advance in the electronic device, and the parsing module 602 extracts the corresponding sub-service invocation policy information according to the received service invocation message.
In this embodiment, the determining module 603 may determine, based on the sub-service invocation policy information, an invocation order of the sub-service systems in the set of sub-service systems to be invoked. As an example, the sub-service invocation policy information includes the number of each sub-service system to be invoked, and the sequence of the numbers, according to which the invocation sequence of each sub-service system can be determined.
In this embodiment, the delivery module 604 may deliver the sub-service call message to the sub-service systems in the sub-service system set based on the call order. The sub-service calling message is used for indicating that the corresponding sub-service system needs to be called currently to execute the corresponding service process. Generally, after the called sub-service system executes the corresponding service flow, the execution result can be sent back to the electronic device, and the electronic device continues to call the next sub-service system; or directly sending the execution result to the next sub-service system.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a service message delivery apparatus according to another exemplary embodiment of the present disclosure.
In some optional implementations, the parsed module 602 includes: a first determining unit 6021, configured to determine the invocation type information based on the service invocation message; an obtaining unit 6022, configured to obtain sub-service invocation policy information corresponding to the invocation type information.
In some optional implementations, the determining module 603 includes: a constructing unit 6031 configured to construct, based on the sub-service invocation policy information, a tree data structure in which the message generation system is a root node and the sub-service systems in the sub-service system set are sub-nodes; a second determining unit 6032 configured to determine, based on the invocation type information, an access order of each of the child nodes from the tree data structure as an invocation order of the child business systems in the set of child business systems.
In some optional implementations, the second determining unit 6032 is further configured to: and in response to the fact that the calling type information indicates that the access sequence is the breadth sequence, determining the calling sequence of the sub-service systems respectively corresponding to the sub-nodes according to the sequence of the levels included in the tree data structure and the arrangement sequence of the sub-nodes in the levels.
In some optional implementations, the second determining unit 6032 is further configured to: and in response to the fact that the calling type information indicates that the access sequence is the depth sequence, determining the calling sequence of the sub-service system corresponding to each sub-node according to the sequence of the sub-nodes included in each complete path in the tree data structure.
In some alternative implementations, the delivery module 604 includes: a third determining unit 6041, configured to determine whether a process of calling the sub-service system through the delivery sub-service call message currently meets a preset call failure condition; a generating unit 6042, configured to generate call failure information if the call failure condition is met.
In some optional implementations, the third determining unit 6041 includes: a first determining subunit 60411, configured to determine whether a process of currently calling a sub-service system is overtime based on preset timeout durations respectively corresponding to sub-service systems in the sub-service system set; an execution subunit 60412, configured to, in response to a timeout occurring during the current process of calling the sub-business system, execute a re-call operation; a second determining subunit 60413, configured to determine that the call failure condition is met in response to the number of times the re-call operation is performed being greater than the preset number of times.
The service message delivery device provided by the above embodiment of the present disclosure obtains sub-service invocation policy information by receiving the service invocation message sent by the service message generation system, parsing the service invocation message, then determining the calling sequence of each sub-service system based on the sub-service calling strategy information, and finally delivering the sub-service calling information to the sub-service systems in the sub-service system set based on the calling sequence, thereby realizing that the sub-service calling strategy information is based on that a certain service system calls the sub-service systems in the sub-service system set according to a certain strategy when in operation, greatly improving the strategy of message delivery, the sub-service system can be flexibly called according to various strategies by configuring and calling strategy information, various message delivery strategies required in service are met, and the safety risks of repeated development and maintenance of the service and convergence of the system are reduced.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 8. The electronic device may be either or both of the terminal device 101 and the server 103 as shown in fig. 1, or a stand-alone device separate from them, which may communicate with the terminal device 101 and the server 103 to receive the collected input signals therefrom.
FIG. 8 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure.
As shown in fig. 8, an electronic device 800 includes one or more processors 801 and memory 802.
The processor 801 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 800 to perform desired functions.
Memory 802 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, Random Access Memory (RAM), cache memory (or the like). The non-volatile memory may include, for example, Read Only Memory (ROM), a hard disk, flash memory, and the like. One or more computer program instructions may be stored on a computer readable storage medium and executed by the processor 801 to implement the service message delivery methods of the various embodiments of the present disclosure above and/or other desired functions. Various contents such as a service invocation message, sub-service invocation policy information, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 800 may further include: an input device 803 and an output device 804, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, when the electronic device is the terminal device 101 or the server 103, the input device 803 may be a device such as a mouse or a keyboard for inputting instructions, programs, or the like. When the electronic device is a stand-alone device, the input unit 803 may be a communication network connector for receiving input instructions, programs, and the like from the terminal device 101 and the server 103.
The output device 804 may output various information including a sub-service invocation message, invocation failure information, and the like to the outside. The output devices 804 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 800 relevant to the present disclosure are shown in fig. 8, omitting components such as buses, input/output interfaces, and the like. In addition, electronic device 800 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer programs/instructions that, when executed by a processor, cause the processor to perform the steps in the method of service message delivery according to various embodiments of the present disclosure described in the "exemplary methods" section of this specification above.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the service message delivery method according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Exemplary computer program
The embodiment of the present disclosure further provides a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the service message delivery method in any possible implementation manner may be implemented.
The computer program product may be embodied in hardware, software or a combination thereof. In one alternative, the computer program product is embodied in a computer storage medium, and in another alternative, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A service message delivery method comprises the following steps:
receiving a service calling message sent by a service message generation system;
analyzing the service calling message to obtain sub-service calling strategy information;
determining the calling sequence of the sub-service systems in the sub-service system set to be called based on the sub-service calling strategy information;
and delivering a sub-service calling message to the sub-service systems in the sub-service system set based on the calling sequence.
2. The method of claim 1, wherein the parsing the service invocation message to obtain sub-service invocation policy information comprises:
determining calling type information based on the service calling message;
and acquiring sub-service calling strategy information corresponding to the calling type information.
3. The method of claim 2, wherein the determining, based on the sub-service invocation policy information, an order of invocation of sub-service systems in the set of sub-service systems to be invoked comprises:
based on the sub-service calling strategy information, constructing a tree data structure which takes the message generation system as a root node and takes the sub-service systems in the sub-service system set as sub-nodes;
and determining the access sequence of each sub-node from the tree data structure as the calling sequence of the sub-service systems in the sub-service system set based on the calling type information.
4. The method of claim 3, wherein the determining, from the tree data structure, an access order of each child node as a calling order of a child business system in the set of child business systems based on the call type information comprises:
and in response to determining that the calling type information indicates that the access sequence is a breadth sequence, determining the calling sequence of the sub-service systems respectively corresponding to the sub-nodes according to the sequence of the levels included in the tree data structure and the arrangement sequence of the sub-nodes in the levels.
5. The method of claim 3, wherein the determining, from the tree data structure, an access order of each child node as a calling order of a child business system in the set of child business systems based on the call type information comprises:
and in response to determining that the calling type information indicates that the access sequence is a depth sequence, determining the calling sequence of the sub-service system corresponding to each sub-node according to the sequence of the sub-nodes included in each complete path in the tree data structure.
6. The method of claim 1, wherein said posting a sub-service invocation message to a sub-service system in the set of sub-service systems based on the invocation order comprises:
determining whether the current process of calling the sub-service system through the delivery sub-service calling message meets a preset calling failure condition;
and if the calling failure condition is met, generating calling failure information.
7. The method of claim 6, wherein the determining whether the process of currently calling the sub-service system by delivering the sub-service call message meets a preset call failure condition comprises:
determining whether the process of calling the sub-service system is overtime or not based on the preset overtime duration respectively corresponding to the sub-service systems in the sub-service system set;
responding to overtime of the process of calling the sub-service system at present, and executing re-calling operation;
and determining that the calling failure condition is met in response to the fact that the number of times of executing the re-calling operation is larger than a preset number of times.
8. A service message delivery apparatus comprising:
the receiving module is used for receiving the service calling message sent by the service message generating system;
the analysis module is used for analyzing the service calling message to obtain sub-service calling strategy information;
the determining module is used for determining the calling sequence of the sub-service systems in the sub-service system set to be called based on the sub-service calling strategy information;
and the delivery module is used for delivering the sub-service calling message to the sub-service systems in the sub-service system set based on the calling sequence.
9. A computer-readable storage medium, the storage medium storing a computer program for performing the method of any of the preceding claims 1-7.
10. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 7.
CN202210009921.9A 2022-01-05 2022-01-05 Service message delivery method and device, readable storage medium and electronic equipment Pending CN114356608A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210009921.9A CN114356608A (en) 2022-01-05 2022-01-05 Service message delivery method and device, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210009921.9A CN114356608A (en) 2022-01-05 2022-01-05 Service message delivery method and device, readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114356608A true CN114356608A (en) 2022-04-15

Family

ID=81108229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210009921.9A Pending CN114356608A (en) 2022-01-05 2022-01-05 Service message delivery method and device, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114356608A (en)

Similar Documents

Publication Publication Date Title
US6816576B2 (en) Tree hierarchy and description for generated logs
CN106548402B (en) Resource transfer monitoring method and device
US8825798B1 (en) Business event tracking system
WO2004029898A2 (en) Xml instrumentation interface for tree-based monitoring architecture
CN109327380A (en) Public platform management method, device, computer equipment and storage medium
CN109522139B (en) Data table service generation and calling method, device, equipment and storage medium
US10554701B1 (en) Real-time call tracing in a service-oriented system
CN103259684A (en) Internet service monitoring method and system
CN110781180B (en) Data screening method and data screening device
CN110430121A (en) Message informing method and device
CN111198804A (en) Gateway-based industrial internet platform third-party micro-service monitoring and early warning method
CA3065729A1 (en) Business rules processing framework
US10599505B1 (en) Event handling system with escalation suppression
CN113687958A (en) Data processing method, system, computer device and storage medium
CN109684176A (en) A kind of report method of warning information, system and associated component
CN113010379A (en) Electronic equipment monitoring system
CN113051086A (en) Data processing method and device, electronic equipment and storage medium
CN114356608A (en) Service message delivery method and device, readable storage medium and electronic equipment
CN110825538A (en) MQ-based method for dynamically interacting data by self-defining data types
CN114390015A (en) Data pushing system, method and equipment based on object model and storage medium
CN111368522B (en) Information generation method and device, computer equipment and computer readable storage medium
CN114443343A (en) Method, device, equipment and storage medium for service interface to feed back abnormal information
CN114979989A (en) 5G message drop-back method, system and device
CN109688174A (en) A kind of virtual service implementation method and device based on more agents service
CN114374650B (en) Notification sending method based on routing middleware, 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