A service chain detection system, method, device and electronic equipment
The service chain detection system detects and locates abnormalities in the service chain, which solves the problem of abnormal diagnosis of the service chain under the SFC network framework and realizes rapid diagnosis of the service chain and location of the abnormal source.
Patent Information
- Application Number
- CN202211415266.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Under the SFC network framework, when an exception occurs in the service chain, it is difficult to diagnose the entire service chain and locate the source of the exception, making troubleshooting difficult.
Provide a service chain detection system that selects the starting service function module among multiple service function modules through the detection module, sends detection messages and queries the identity consistency. If they are inconsistent, forward them, and if they are consistent, return a response message. Based on the response The message determines the detection result, enabling detection and abnormal location of the service chain.
It can sense abnormal areas and causes, realize overall investigation and diagnosis of the service chain, locate the source of abnormality in the service chain, and improve the efficiency of abnormal location.
Smart Images

Figure CN115766536B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, and specifically to cloud computing and cloud network technologies, and can be applied in intelligent cloud scenarios. Background Art
[0002] SFC (Service Function Chain) is a technology that provides orderly services to the application layer. It is used to connect multiple services on network devices at the logical level to form an orderly service combination. Under the SFC network framework, multiple services are connected to a service chain. If any service in the service chain is abnormal, such as packet loss, high latency, service skipping, service looping, message forwarding errors between services, etc., the entire service chain will be abnormal. Summary of the invention
[0003] The present disclosure provides a service chain detection system, method, device and electronic device.
[0004] According to one aspect of the present disclosure, a service chain detection system is provided, including a detection module and a service chain, wherein the service chain includes a plurality of service function modules arranged in sequence, wherein:
[0005] The detection module is used to select a starting service function module from a plurality of service function modules and send a detection message to the starting service function module, wherein the detection message includes a first identifier of a target service function module;
[0006] The service function module is used to query whether the first identifier in the detection message is consistent with its own identifier when receiving the detection message; if the first identifier is inconsistent with its own identifier, forward the detection message to the next service function module; if the first identifier is consistent with its own identifier, return a first response message to the detection module;
[0007] The detection module is further used to determine a detection result based on the first response message.
[0008] According to another aspect of the present disclosure, a service chain detection method is provided, which is applied to a detection module, and includes:
[0009] A starting service function module is selected from multiple service function modules, and a detection message is sent to the starting service function module, so that when the starting service function module receives the detection message, it inquires whether the first identifier in the detection message is consistent with its own identifier, and when the first identifier is inconsistent with its own identifier, it forwards the detection message to the next service function module, and when the first identifier is consistent with its own identifier, it returns a first response message to the detection module, wherein the detection message includes the first identifier of the target service function module;
[0010] A detection result is determined based on the first response message.
[0011] According to another aspect of the present disclosure, a service chain detection method is provided, which is applied to a service function module, and includes:
[0012] When receiving a detection message sent by the detection module, query whether the first identifier in the detection message is consistent with its own identifier, wherein the first identifier is the identifier of the target service function module included in the detection message;
[0013] When the first identifier is inconsistent with its own identifier, the detection message is forwarded to the next service function module; when the first identifier is consistent with its own identifier, a first response message is returned to the detection module, so that the detection module determines the detection result based on the first response message.
[0014] According to another aspect of the present disclosure, a service chain detection device is provided, which is applied to a detection module, including:
[0015] A detection message sending module, used for selecting a starting service function module from a plurality of service function modules, and sending a detection message to the starting service function module, so that the starting service function module, when receiving the detection message, inquires whether the first identifier in the detection message is consistent with its own identifier, and forwards the detection message to the next service function module when the first identifier is inconsistent with its own identifier, and returns a first response message to the detection module when the first identifier is consistent with its own identifier, wherein the detection message includes the first identifier of the target service function module;
[0016] A detection result determination module is used to determine the detection result based on the first response message.
[0017] According to another aspect of the present disclosure, a service chain detection device is provided, which is applied to a service function module, including:
[0018] an identification query module, configured to query whether a first identification in the detection message is consistent with its own identification when receiving the detection message sent by the detection module, wherein the first identification is an identification of a target service function module included in the detection message;
[0019] A detection processing module is used to forward the detection message to the next service function module when the first identifier is inconsistent with its own identifier; and return a first response message to the detection module when the first identifier is consistent with its own identifier, so that the detection module determines the detection result based on the first response message.
[0020] The service chain detection system provided by the present disclosure includes a detection module and a service chain, wherein the service chain includes a plurality of service function modules arranged in sequence. Among them, the detection module first selects a starting service function module from a plurality of service function modules, and sends a detection message to the starting service function module, wherein the detection message includes a first identifier of the target service function module; then, when the service function module receives the detection message, it inquires whether the first identifier in the detection message is consistent with its own identifier. When the first identifier is inconsistent with its own identifier, the detection message is forwarded to the next service function module; when the first identifier is consistent with its own identifier, a first response message is returned to the detection module. The detection module determines the detection result based on the first response message. The present disclosure realizes the detection of the service chain.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0023] Figure 1a is a structural diagram of a service chain detection system provided according to the present disclosure;
[0024] Figure 1b This is an example diagram of a message header definition of a detection message provided in the present disclosure;
[0025] Figure 1c is a diagram showing an example of the contents of a detection message provided in the present disclosure;
[0026] Figure 1d is a diagram showing an example of a message format definition of a response message provided in the present disclosure;
[0027] Figure 1e is a diagram showing an example of the content of a response message provided in the present disclosure;
[0028] Figure 1f is an example diagram of a service chain detection provided according to the present disclosure;
[0029] Figure 2 is a flow chart of a first service chain detection method provided by the present disclosure;
[0030] Figure 3 This is a possible implementation of step S22 provided in the present disclosure;
[0031] Figure 4 is a flow chart of a second service chain detection method provided by the present disclosure;
[0032] Figure 5 This is a possible implementation of step S21 provided in the present disclosure;
[0033] Figure 6 is a flow chart of a third service chain detection method provided by the present disclosure;
[0034] Figure 7 is a structural schematic diagram of a first service chain detection device provided according to the present disclosure;
[0035] Figure 8 is a structural schematic diagram of a second service chain detection device provided according to the present disclosure;
[0036] Fig. 9 It is a block diagram of an electronic device used to implement the service chain detection method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0037] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0038] Since there are many services connected to the service chain, there are also many business network elements involved. When an abnormality occurs in the service chain, it is difficult to detect and troubleshoot the abnormality, and it is difficult to diagnose the service chain as a whole.
[0039] In order to solve the above problem, the present disclosure provides a service chain detection system, including a detection module and a service chain, wherein the service chain includes a plurality of service function modules arranged in sequence, wherein:
[0040] The detection module is used to select a starting service function module from a plurality of service function modules and send a detection message to the starting service function module, wherein the detection message includes a first identifier of a target service function module;
[0041] The service function module is used to query whether the first identifier in the detection message is consistent with its own identifier when receiving the detection message; if the first identifier is inconsistent with its own identifier, forward the detection message to the next service function module; if the first identifier is consistent with its own identifier, return a first response message to the detection module;
[0042] The detection module is further used to determine a detection result based on the first response message.
[0043] As can be seen from the above, in the service chain detection system provided by the present disclosure, the detection module first selects the starting service function module from multiple service function modules, and sends a detection message including the first identifier of the target service function module to the starting service function module. When the service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier. In the case of inconsistency, the detection message is forwarded to the next service function module; in the case of consistency, the first response message is returned to the detection module. The final detection module determines the detection result based on the first response message. The present disclosure detects each service function module in the service chain through the detection module. When an abnormality occurs in the service chain, the service function modules of the service chain and the paths between them are detected to perceive the abnormal area and the cause of the abnormality, such as some service function module services are not executed or the business processing is abnormal. The current detection result of the service chain can be determined based on the response message finally received. When an abnormality occurs in the service chain, the overall investigation and diagnosis of the service chain can be realized based on this, so as to locate the source of the service chain abnormality.
[0044] The service chain detection system provided by the present disclosure is described in detail below through specific embodiments.
[0045] The system of the embodiment of the present disclosure is applied to a smart terminal and can be implemented through the smart terminal. In actual use, the smart terminal can be a computer, a server, a data center, etc.
[0046] See also Figure 1a , Figure 1a The present disclosure provides a structural diagram of a service chain detection system, including a detection module and a service chain, wherein the service chain includes a plurality of service function modules arranged in sequence, wherein:
[0047] The detection module is used to select a starting service function module from a plurality of service function modules and send a detection message to the starting service function module, wherein the detection message includes a first identifier of a target service function module;
[0048] The service function module is used to query whether the first identifier in the detection message is consistent with its own identifier when receiving the detection message; if the first identifier is inconsistent with its own identifier, forward the detection message to the next service function module; if the first identifier is consistent with its own identifier, return a first response message to the detection module;
[0049] The detection module is further used to determine a detection result based on the first response message.
[0050] The service chain includes multiple service function modules arranged in sequence, each service function module is independent of each other and has its own service function. When the service chain detection system starts detection, the detection module first selects a service function module from multiple service function modules in the service chain as the starting service function module. Specifically, the detection module can be selected randomly or according to pre-set conditions, for example, a service function module whose location meets the conditions, such as a certain connection with the location of the target service function module; or a service function module whose service function meets the conditions, such as a service function that is consistent with the target service function module and is related to the service chain anomaly detected this time.
[0051] The detection module sends a detection message to the selected starting service function module, and the detection message includes the first identifier of the target service function module, which is the final target of this detection. Specifically, the first identifier is an identifier that can uniquely represent the target service function module, such as the ID (Identity document) of the target service function module. In an example, when the detection module selects the starting service function module, it may not consider the relationship between the starting service function module and the target service function module, so the starting service function module and the target service function module may be the same module or may not be the same module. Specifically, since the service function modules in the service chain are arranged in order, the starting service function module may be before the target service function module or after the target service function module.
[0052] Therefore, when the starting service function module receives the detection message, it first checks whether the first identifier in the detection message is consistent with its own identifier. Its own identifier can be the ID of the starting service function module itself. If they are inconsistent, it means that the starting service function module is not the target service function module. At this time, the starting service function module forwards the detection message to the next service function module arranged in sequence in the service chain. After the next service function module receives the detection message, it also checks whether the first identifier is consistent with its own identifier. If they are inconsistent, it continues to forward the next service function module according to the arrangement order in the service chain until the target service function module receives the detection message.
[0053] If the service function module checks that the first identifier is consistent with its own identifier, it indicates that the service function module is the target service function module, and the service function module returns a first response message to the detection module. After receiving the first response message, the detection module can determine the detection result based on the first response message.
[0054] As can be seen from the above, in the service chain detection system provided by the present disclosure, the detection module first selects the starting service function module from multiple service function modules, and sends a detection message including the first identifier of the target service function module to the starting service function module. When the service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier. In the case of inconsistency, the detection message is forwarded to the next service function module; in the case of consistency, the first response message is returned to the detection module. The final detection module determines the detection result based on the first response message. The present disclosure detects each service function module in the service chain through the detection module. When an abnormality occurs in the service chain, the service function modules of the service chain and the paths between them are detected to perceive the abnormal area and the cause of the abnormality, such as some service function module services are not executed or the business processing is abnormal. The current detection result of the service chain can be determined based on the response message finally received. When an abnormality occurs in the service chain, the overall investigation and diagnosis of the service chain can be realized based on this, so as to locate the source of the service chain abnormality.
[0055] In one embodiment of the present disclosure, the service function module is also used to return a second response message to the detection module when there is a forwarding anomaly during the process of forwarding the detection message to the next service function module, wherein the second response message includes an exception type field indicating the exception type.
[0056] The above-mentioned service function module may have a forwarding exception in the process of forwarding the detection message to the next service function module. In this case, the service function module stops forwarding and returns a second response message to the detection module. At this time, the second response message includes an exception type field for indicating the type of this abnormal situation.
[0057] The service chain detection system provided by the present disclosure directly returns a response message including an abnormality type when the service function module fails to forward the detection message, so that the detection module can obtain the service chain abnormality in time and locate it.
[0058] In one embodiment of the present disclosure, the detection message includes a message lifetime, and the exception type includes at least one of the following: the starting service function module is after the target service function module, the service function module fails to forward the detection message to the next service function module, and the message lifetime is reset to zero.
[0059] The above-mentioned abnormality types include that the starting service function module is after the target service function module, which means that in the arrangement order of the service chain, the starting service function module is after the target service function module. In this case, the starting service function module forwards the detection message to the next service function module, and the detection message cannot reach the target service function module. Specifically, the starting service function module can make a judgment based on its own identifier and the first identifier. In an example, the identifier of each service function module includes a field corresponding to the arrangement order. Specifically, it can be a numerical value with a size order assigned according to the arrangement order. Based on this field, the order of the starting service function module and the target service function module can be judged. For example, the field in the identifier of the starting service function module is 12, and the field in the first identifier is 17. The field in the identifier of the starting service function module is smaller than the field in the first identifier, indicating that the starting service function module is after the target service function module, and an abnormality occurs.
[0060] In one example, when the service function module forwards the detection message to the next service function module, it may reduce the field in its own identifier by one, and then forward the detection message to the service function module corresponding to the identifier including the reduced field.
[0061] The above service function module fails to forward the detection message to the next service function module. This may be caused by a connection anomaly, or the service function module cannot find the next service function module and cannot forward the message.
[0062] The above-mentioned message lifetime is reset to zero means that the field representing the message lifetime (TTL, Time ToLive) included in the detection message is reset to zero, which means that the message can no longer be forwarded.
[0063] The occurrence of any of the above abnormal situations indicates that there is a forwarding abnormality in the process of the service function module forwarding the detection message to the next service function module. At this time, the service function module returns a second response message including a corresponding abnormal type field to the detection module.
[0064] As can be seen from the above, in the service chain detection system provided by the present invention, when an abnormal situation occurs in the process of a service function module forwarding a detection message to the next service function module, the service function module returns a second response message including an exception type field indicating the exception type to the detection module, so that the detection module can clearly determine where the exception is, thereby locating the service chain exception and facilitating subsequent processing of the exception.
[0065] In one embodiment of the present disclosure, the response message further includes a second identifier of the service function module that returns the response message to the detection module;
[0066] The detection module is specifically used to respond to a received response message. When the second identifier is consistent with the first identifier and the exception type field does not exist, determine that the detection result is a normal service chain; when the second identifier is inconsistent with the first identifier and / or the exception type field exists, determine that the detection result is a service chain abnormality, and locate the service chain abnormality based on the exception type field, wherein the response message is the first response message or the second response message.
[0067] The detection module determines the detection result of this detection based on the received response message. When the second identifier in the received response message is consistent with the first identifier, it indicates that the response message is the first response message normally returned by the target service function module, which means that the service chain is normal at this time, or that the service chain from the starting service function module to the target service function module is normal. If there is still an abnormality in the service chain at this time, the target service function module and the starting service function module are reselected for re-detection.
[0068] When the second identifier in the received response message is inconsistent with the first identifier, it means that the response message is not the first response message normally returned by the target service function module, but the second response message returned by other service function modules, which may contain an exception type field indicating the exception type. At this time, the detection module can determine that the result of this detection is that there is an exception in this service chain, and specifically determine the type of exception based on the exception type field in the response message, and then locate the service chain exception.
[0069] In one example, the response message may include a code field, and different codes are preset to correspond to different exception types. For example, a code field of 0 indicates no exception; a code field of 1 indicates that the service function module fails to forward the detection message to the next service function module; a code field of 2 indicates that the message lifetime is reset to zero; a code field of 3 indicates that the starting service function module is after the target service function module. The detection module can quickly locate the exception based on the code field.
[0070] As can be seen from the above, in the service chain detection system provided by the present invention, the detection module determines the service chain detection result according to the second identifier in the received response message and the abnormality type field that may be included, and locates the service chain abnormality based on this, thereby being able to achieve an overall and rapid diagnosis of the service chain, thereby improving the efficiency of locating the service chain abnormality.
[0071] In one embodiment of the present disclosure, the detection module is further used to record the sending time of the detection message and the receiving time of the response message, and obtain the delay of the service chain based on the sending time and the receiving time.
[0072] In one example, the detection module calculates the delay of the service chain by subtracting the sending time from the receiving time, and then determines whether there is a delay anomaly in the service chain.
[0073] As can be seen from the above, the service chain detection system provided by the present disclosure, the detection module also calculates the delay of the service chain, and then determines whether there is a delay anomaly in the service chain, so as to evaluate the communication quality of the service chain and provide more comprehensive possibilities for locating the anomaly of the service chain.
[0074] In one embodiment of the present disclosure, the detection module is also used to determine that there is a packet loss anomaly in the service chain if the response message is not received after a preset period of time starting from the moment when the detection message is sent; when there is a packet loss anomaly in the service chain, for each service function module in the service function module set, the service function module is used as a new target service function module, and a new starting service function module is selected to send a detection message, wherein the service function module set includes each service function module in the service chain from the starting service function module to the target service function module and the starting service function module.
[0075] In the embodiment of the present disclosure, if the detection module has not received a response message after a preset period of time from the time the detection message is sent, it is determined that there is a packet loss anomaly in the service chain. Specifically, the preset period of time can be set according to actual needs or historical experience, indicating that the normal response time has been exceeded.
[0076] The packet loss anomaly may exist in the path between the detection module and the starting service function module, or it may exist in any service function module between the starting service function module and the target service function module or the path between them. The detection module targets each service function module in the service function module set, takes the service function module as the target service function module, and re-detects it in turn until the packet loss anomaly is located.
[0077] As can be seen from the above, in the service chain detection system provided by the present disclosure, the detection module determines whether there is a packet loss anomaly in the service chain after a preset time after sending the detection message, and then re-detects the service chain, thereby achieving a more comprehensive positioning of the service chain anomaly.
[0078] In one embodiment of the present disclosure, the system further includes: a service function proxy module, wherein:
[0079] The detection module is used to send the detection message to the starting service function module when the starting service function module senses other service function modules; and send the detection message to the service function proxy module corresponding to the starting service function module when the starting service function module does not sense other service function modules;
[0080] The service function proxy module is used to query whether the identifier of the starting service function module is consistent with the first identifier when receiving the detection message; if they are inconsistent, forward the detection message to the next service function module of the starting service function module; if they are consistent, return a first response message to the detection module; in the process of forwarding the detection message to the next service function module, when there is a forwarding anomaly, return a second response message to the detection module.
[0081] In the disclosed embodiment, if the starting service function module is of a type that is unaware of other service function modules (SF-unware type), that is, it does not interact with other service function modules, the detection module sends the detection message to the service function proxy module (SFC proxy) corresponding to the starting service function module, so that the service function proxy module answers on behalf of the starting service function module.
[0082] Correspondingly, when the other service function modules or the target service function module are of a type that is not aware of other service function modules, the previous service function module forwards the detection message to the service function proxy module corresponding to the service function module, so that it answers on behalf of the module.
[0083] As can be seen from the above, the service chain detection system provided by the present invention also includes a service function proxy module, which can act on behalf of a service function module that is unaware of other service function modules, so that the detection of the service chain is not affected by the type of service function module, thereby improving the adaptability of the service chain detection.
[0084] In one embodiment of the present disclosure, the detection message further includes at least one of an encapsulation protocol type, a service chain ID (SPI, Service Path ID) where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates a current detection identifier, and the security integrity level field is used to record the first identifier;
[0085] The response message also includes the encapsulation protocol type, the service chain ID of the service function module returning the response message, the request value, the security integrity level field, and at least one of the addresses of the service function module returning the response message, the request value represents the current response identifier, and the security integrity level field is the second identifier.
[0086] In the disclosed embodiment, the service chain system may be applied to OAM (Operation Administration and Maintenance) of SFC.
[0087] When initiating a detection, the detection module encapsulates the detection message, and the destination IP address in the IP header of the encapsulated message is the address of the starting service function module, and the source IP address is the IP address of the host where the detection module is located. The response message encapsulates the IP address of the service function module that returns the response message, and returns the response message with the source IP address as the destination address.
[0088] The above-mentioned detection message and response message both include NSH (Network Service Header), and the next protocol (next encapsulation protocol type) therein is filled with OAM protocol (OAM protocol). It also includes an OAM message header, which includes a Msg Type (message type) field and a SIL (Safety Integrity Level) field. Specifically, the Msg Type field represents detection and response, for example, the field in the detection message is 16, and the field in the response message that responds to the detection message is 17; the SIL field in the detection message is the first identifier of the target service function module, and the SIL field in the response message is the identifier of the service function module that returns the response message.
[0089] In an example, the above-mentioned service function modules may be deployed in a cluster, that is, each service function module may work together on multiple devices, and the detection message is forwarded by ECMP (Equal-Cost Multi-Path, equal-cost routing) in the intermediate network device according to the quintuple of the outer message header, so that the detection message can cover each device. Specifically, multiple detection messages can be sent at one time, and the source port of the UDP (User Datagram Protocol) message header in the quintuple of the outer message header can be changed.
[0090] That is to say, the detection module can send one or more detection messages at a time, thereby initiating one or more detection requests, so the detection message and response message need to include a request value (Requste ID) that distinguishes each detection request and response. Specifically, each time the detection module sends a detection message, the request value in the detection message is increased by one. For example, the request value of this detection is 16, and the request value of the next detection is 17.
[0091] like Figure 1b As shown, an example diagram of the message header definition of a detection message is provided. Figure 1c A diagram showing an example of the contents included in a probe message is also provided, wherein Ver1CRRRRRRR indicates the version of the current message, Length indicates the length, MD-type (Metadata Type) indicates the metadata format carried by the NSH, OAM Protocol indicates the OAM protocol, ServiceIndex indicates the identifier of the service function module, Mandatory Context Header indicates data that is required to be carried compulsorily, reserve indicates a reserved field, OAM PING indicates a probe request, Msg Type value indicates the value of Msg Type, and different values of MsgType value are described as a probe (oam ping request) and a response (oam ping reply).
[0092] like Figure 1d As shown, a sample diagram of the message format definition of a response message is also provided. Figure 1e A diagram showing an example of the content included in a response message is also provided, wherein Replyer Host IP represents the IP address of the service function module that returns the response message, and code value is the value of the code field.
[0093] In the SFC service chain application scenario, you can also add and enable the SFC OAM PING module in each service function module (SF, ServiceFunction) of the service chain. At the same time, deploy the oam-controller (detection) module on a separate machine. When a service chain fails, such as when one or some SF services are not executed, resulting in abnormal business processing, the oam-controller module initiates an OAM ping detection, and diagnoses the fault domain and fault cause based on the received response message.
[0094] like Figure 1f As shown, an example diagram of service chain detection is also provided, wherein classifier represents a classifier, SFC-oam-controller (detection module) sends a detection message of an OAM ping request detection request to the starting SF (starting service function module), and the starting SF forwards it to the next SF. If the next SF finds that the forwarding is abnormal, it returns a response message to the SFC-oam-controller to indicate that an abnormality has occurred; if there is no abnormality, it continues to forward it to the destination SF (target service function module), and the destination SF returns a response message normally to perform an OAM ping reply (detection response).
[0095] As can be seen from the above, the service chain detection system provided by the present disclosure also defines the specific formats of the detection message and the response message, thereby providing a higher possibility and operability for the implementation of the service chain detection.
[0096] See also Figure 2 The present disclosure also provides a flow chart of a first service chain detection method, which is applied to a detection module and includes:
[0097] Step S21: Select a starting service function module from multiple service function modules, and send a detection message to the starting service function module, so that when the starting service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier; if the first identifier is inconsistent with its own identifier, it forwards the detection message to the next service function module; if the first identifier is consistent with its own identifier, it returns a first response message to the detection module.
[0098] Wherein, the detection message includes a first identifier of a target service function module;
[0099] Step S22: Determine a detection result based on the first response message.
[0100] As can be seen from the above, in the service chain detection method provided by the present disclosure, the detection module first selects the starting service function module from multiple service function modules, and sends a detection message including the first identifier of the target service function module to the starting service function module. When the service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier. In the case of inconsistency, the detection message is forwarded to the next service function module; in the case of consistency, the first response message is returned to the detection module. The final detection module determines the detection result based on the first response message. The present disclosure detects each service function module in the service chain through the detection module. When an abnormality occurs in the service chain, the service function modules of the service chain and the paths between them are detected to perceive the abnormal area and the cause of the abnormality, such as some service function module services are not executed or the business processing is abnormal. The current detection result of the service chain can be determined based on the response message finally received. When an abnormality occurs in the service chain, the overall investigation and diagnosis of the service chain can be realized based on this, so as to locate the source of the service chain abnormality.
[0101] In one possible implementation, Figure 3 As shown, the response message also includes a second identifier of the service function module that returns the response message to the detection module, and the above step S22 determines the detection result based on the first response message, including:
[0102] Step S31: In response to the received response message, if the second identifier is consistent with the first identifier and there is no abnormal type field, it is determined that the detection result is that the service chain is normal.
[0103] Among them, the response message is the first response message or the second response message, and the second response message is the response message returned by the starting service function module to the detection module when there is a forwarding exception during the process of forwarding the detection message to the next service function module.
[0104] Step S32: when the second identifier is inconsistent with the first identifier and / or the abnormality type field exists, determine that the detection result is a service chain abnormality, and locate the service chain abnormality based on the abnormality type field.
[0105] As can be seen from the above, in the service chain detection method provided by the present invention, the detection module determines the service chain detection result according to the second identifier in the received response message and the abnormality type field that may be included, and locates the service chain abnormality based on this, thereby being able to achieve an overall and rapid diagnosis of the service chain, thereby improving the efficiency of locating the service chain abnormality.
[0106] In one embodiment of the present disclosure, it also includes:
[0107] The sending time of the detection message and the receiving time of the response message are recorded, and the delay of the service chain is obtained based on the sending time and the receiving time.
[0108] As can be seen from the above, in the service chain detection method provided by the present disclosure, the detection module also calculates the delay of the service chain, and then determines whether there is a delay anomaly in the service chain, so as to evaluate the communication quality of the service chain and provide more comprehensive possibilities for locating the anomaly of the service chain.
[0109] In one embodiment of the present disclosure, Figure 4 As shown, Figure 4 A flow chart of the second service chain detection method is provided, including:
[0110] Step S41: starting from the time when the detection message is sent, if the response message is not received after a preset time, it is determined that there is a packet loss anomaly in the service chain;
[0111] Step S42: When there is a packet loss exception in the service chain, for each service function module in the service function module set, the service function module is used as a new target service function module, and a new start service function module is selected to send a detection message.
[0112] The service function module set includes each service function module in the service chain from the starting service function module to the target service function module and the starting service function module.
[0113] In the service chain detection method provided by the present disclosure, the detection module determines whether there is a packet loss anomaly in the service chain after a preset period of time after sending the detection message, and then re-detects the service chain, thereby achieving a more comprehensive positioning of the service chain anomaly.
[0114] In one embodiment of the present disclosure, Figure 5 As shown, a possible implementation method of step S21 is provided. The above step S21 selects a starting service function module from multiple service function modules and sends a detection message to the starting service function module, so that the starting service function module, when receiving the detection message, queries whether the first identifier in the detection message is consistent with its own identifier. When the first identifier is inconsistent with its own identifier, the detection message is forwarded to the next service function module. When the first identifier is consistent with its own identifier, a first response message is returned to the detection module, including:
[0115] Step S51: When the starting service function module senses other service function modules, the detection message is sent to the starting service function module;
[0116] Step S52: When the starting service function module does not perceive other service function modules, the detection message is sent to the service function proxy module corresponding to the starting service function module, so that when the service function proxy module receives the detection message, it queries whether the identifier of the starting service function module is consistent with the first identifier. If they are inconsistent, the detection message is forwarded to the next service function module of the starting service function module. If they are consistent, the first response message is returned to the detection module. In the process of forwarding the detection message to the next service function module, if there is a forwarding exception, the second response message is returned to the detection module.
[0117] The service chain detection method provided by the present disclosure is that the service function proxy module can answer for the service function module that is not aware of other service function modules, so that the detection of the service chain is not affected by the type of service function module, thereby improving the adaptability of the service chain detection.
[0118] In one embodiment of the present disclosure,
[0119] The detection message also includes at least one of the encapsulation protocol type, the service chain ID where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates the current detection identifier, and the security integrity level field is used to record the first identifier;
[0120] The response message also includes the encapsulation protocol type, the service chain ID of the service function module returning the response message, the request value, the security integrity level field, and at least one of the addresses of the service function module returning the response message, the request value represents the current response identifier, and the security integrity level field is the second identifier.
[0121] The service chain detection method provided by the present disclosure also defines the specific formats of the detection message and the response message, thereby providing a higher possibility and operability for the implementation of the service chain detection.
[0122] See also Figure 6 The present disclosure also provides a flow chart of a third service chain detection method, which is applied to a service function module and includes:
[0123] Step S61: when receiving a detection message sent by a detection module, query whether the first identifier in the detection message is consistent with its own identifier.
[0124] The first identifier is an identifier of a target service function module included in the detection message.
[0125] Step S62: When the first identifier is inconsistent with its own identifier, forward the detection message to the next service function module; when the first identifier is consistent with its own identifier, return a first response message to the detection module, so that the detection module determines the detection result based on the first response message.
[0126] As can be seen from the above, in the service chain detection method provided by the present disclosure, the detection module first selects the starting service function module from multiple service function modules, and sends a detection message including the first identifier of the target service function module to the starting service function module. When the service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier. In the case of inconsistency, the detection message is forwarded to the next service function module; in the case of consistency, the first response message is returned to the detection module. The final detection module determines the detection result based on the first response message. The present disclosure detects each service function module in the service chain through the detection module. When an abnormality occurs in the service chain, the service function modules of the service chain and the paths between them are detected to perceive the abnormal area and the cause of the abnormality, such as some service function module services are not executed or the business processing is abnormal. The current detection result of the service chain can be determined based on the response message finally received. When an abnormality occurs in the service chain, the overall investigation and diagnosis of the service chain can be realized based on this, so as to locate the source of the service chain abnormality.
[0127] In one embodiment of the present disclosure, it includes:
[0128] In the process of forwarding the detection message to the next service function module, when there is a forwarding exception, a second response message is returned to the detection module, wherein the second response message includes an exception type field indicating the exception type.
[0129] The service chain detection method provided by the present disclosure directly returns a response message including an abnormality type when the service function module fails to forward the detection message, so that the detection module can obtain the service chain abnormality in time and locate it.
[0130] In one embodiment of the present disclosure,
[0131] The detection message includes a message lifetime, and the abnormal type includes at least one of the following: the starting service function module is behind the target service function module, the service function module fails to forward the detection message to the next service function module, and the message lifetime returns to zero.
[0132] The service chain detection method provided by the present invention, when an abnormal situation occurs in the process of a service function module forwarding a detection message to a next service function module, the service function module returns a second response message including an abnormality type field indicating the abnormality type to the detection module, so that the detection module can clearly determine where the abnormality is, thereby locating the service chain abnormality and facilitating subsequent processing of the abnormality.
[0133] In one embodiment of the present disclosure,
[0134] The detection message also includes at least one of the encapsulation protocol type, the service chain ID where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates the current detection identifier, and the security integrity level field is used to record the first identifier;
[0135] The response message also includes at least one of the encapsulation protocol type, the service chain ID of the service function module that returns the response message, the request value, the security integrity level field, and the address of the service function module that returns the response message, wherein the request value represents the current response identifier, and the security integrity level field is the second identifier of the service function module that returns the response message to the detection module.
[0136] The service chain detection method provided by the present disclosure also defines the specific formats of the detection message and the response message, thereby providing a higher possibility and operability for the implementation of the service chain detection.
[0137] See also Figure 7 The present disclosure also provides a structural schematic diagram of a first service chain detection device, which is applied to a detection module and includes:
[0138] A detection message sending module 701 is used to select a starting service function module from multiple service function modules, and send a detection message to the starting service function module, so that when the starting service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier, and when the first identifier is inconsistent with its own identifier, it forwards the detection message to the next service function module, and when the first identifier is consistent with its own identifier, it returns a first response message to the detection module, wherein the detection message includes the first identifier of the target service function module;
[0139] The detection result determination module 702 is used to determine the detection result based on the first response message.
[0140] The service chain detection device provided by the present disclosure, the detection module first selects the starting service function module from multiple service function modules, and sends a detection message including the first identifier of the target service function module to the starting service function module. When the service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier. In the case of inconsistency, the detection message is forwarded to the next service function module; in the case of consistency, the first response message is returned to the detection module. The final detection module determines the detection result based on the first response message. The present disclosure detects each service function module in the service chain through the detection module. When an abnormality occurs in the service chain, the service function modules of the service chain and the paths between them are detected to perceive the abnormal area and the cause of the abnormality, such as some service function module services are not executed or the business processing is abnormal. The current detection result of the service chain can be determined based on the response message finally received. When an abnormality occurs in the service chain, the overall investigation and diagnosis of the service chain can be realized based on this, so as to locate the source of the service chain abnormality.
[0141] In one embodiment of the present disclosure, the response message also includes a second identifier of the service function module that returns the response message to the detection module, and the detection result determination module 702 is specifically configured to:
[0142] In response to the received response message, when the second identifier is consistent with the first identifier and there is no exception type field, it is determined that the detection result is that the service chain is normal, wherein the response message is the first response message or the second response message, and the second response message is a response message returned by the starting service function module to the detection module when there is a forwarding exception in the process of forwarding the detection message to the next service function module;
[0143] When the second identifier is inconsistent with the first identifier and / or the abnormality type field exists, the detection result is determined to be a service chain abnormality, and the service chain abnormality is located based on the abnormality type field.
[0144] The service chain detection device provided by the present invention has a detection module that determines the service chain detection result according to the second identifier in the received response message and the abnormality type field that may be included, and locates the service chain abnormality based on this, which can realize the overall and rapid diagnosis of the service chain, thereby improving the efficiency of locating the service chain abnormality.
[0145] In one embodiment of the present disclosure, it also includes:
[0146] The delay determination module is used to record the sending time of the detection message and the receiving time of the response message, and obtain the delay of the service chain based on the sending time and the receiving time.
[0147] The service chain detection device provided by the present disclosure has a detection module that also calculates the delay of the service chain, and then determines whether there is a delay anomaly in the service chain, so as to evaluate the communication quality of the service chain and provide more comprehensive possibilities for locating the anomaly of the service chain.
[0148] In one embodiment of the present disclosure, it also includes:
[0149] an abnormality determination module, configured to determine that a packet loss abnormality exists in the service chain if the response message is not received after a preset time period starting from the time when the detection message is sent;
[0150] The re-detection module is used to, when there is a packet loss anomaly in the service chain, for each service function module in the service function module set, take the service function module as a new target service function module, select a new starting service function module and send a detection message, wherein the service function module set includes each service function module in the service chain from the starting service function module to the target service function module and the starting service function module.
[0151] The service chain detection device provided by the present disclosure has a detection module that determines whether there is a packet loss anomaly in the service chain after a preset period of time after sending a detection message, and then re-detects the service chain, thereby achieving a more comprehensive positioning of the service chain anomaly.
[0152] In one embodiment of the present disclosure,
[0153] The detection message also includes at least one of an encapsulation protocol type, a serial peripheral interface where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates a current detection identifier, and the security integrity level field is used to record the first identifier;
[0154] The response message also includes at least one of the encapsulation protocol type, the serial peripheral interface where the service function module that returns the response message is located, the request value, the security integrity level field, and the address of the service function module that returns the response message, the request value represents the current response identifier, and the security integrity level field is the second identifier.
[0155] The service chain detection device provided by the present disclosure also defines the specific formats of the detection message and the response message, thereby providing a higher possibility and operability for the implementation of the service chain detection.
[0156] See also Figure 8 The present disclosure also provides a structural diagram of a second service chain detection device, which is applied to a service function module and includes:
[0157] The identification query module 801 is used to query whether the first identification in the detection message is consistent with its own identification when receiving the detection message sent by the detection module, wherein the first identification is the identification of the target service function module included in the detection message;
[0158] The detection processing module 802 is used to forward the detection message to the next service function module when the first identifier is inconsistent with its own identifier; and return a first response message to the detection module when the first identifier is consistent with its own identifier, so that the detection module determines the detection result based on the first response message.
[0159] The service chain detection device provided by the present disclosure, the detection module first selects the starting service function module from multiple service function modules, and sends a detection message including the first identifier of the target service function module to the starting service function module. When the service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier. In the case of inconsistency, the detection message is forwarded to the next service function module; in the case of consistency, the first response message is returned to the detection module. The final detection module determines the detection result based on the first response message. The present disclosure detects each service function module in the service chain through the detection module. When an abnormality occurs in the service chain, the service function modules of the service chain and the paths between them are detected to perceive the abnormal area and the cause of the abnormality, such as some service function module services are not executed or the business processing is abnormal. The current detection result of the service chain can be determined based on the response message finally received. When an abnormality occurs in the service chain, the overall investigation and diagnosis of the service chain can be realized based on this, so as to locate the source of the service chain abnormality.
[0160] In one embodiment of the present disclosure, it also includes:
[0161] The message return module is used to return a second response message to the detection module when there is a forwarding exception during the process of forwarding the detection message to the next service function module, wherein the second response message includes an exception type field indicating the exception type.
[0162] The service chain detection device provided by the present disclosure directly returns a response message including an abnormality type when the service function module fails to forward the detection message, so that the detection module can obtain the service chain abnormality in time and locate it.
[0163] In one embodiment of the present disclosure,
[0164] The detection message includes a message lifetime, and the abnormal type includes at least one of the following: the starting service function module is behind the target service function module, the starting service function module fails to forward the detection message to the next service function module, and the message lifetime returns to zero.
[0165] The service chain detection device provided by the present invention, when an abnormal situation occurs in the process of a service function module forwarding a detection message to a next service function module, the service function module returns a second response message including an abnormality type field indicating the abnormality type to the detection module, so that the detection module can clearly determine where the abnormality is, thereby locating the service chain abnormality and facilitating subsequent processing of the abnormality.
[0166] In one embodiment of the present disclosure,
[0167] The detection message also includes at least one of an encapsulation protocol type, a serial peripheral interface where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates a current detection identifier, and the security integrity level field is used to record the first identifier;
[0168] The response message also includes at least one of the encapsulation protocol type, the serial peripheral interface where the service function module that returns the response message is located, the request value, the security integrity level field, and the address of the service function module that returns the response message, wherein the request value represents the current response identifier, and the security integrity level field is the second identifier of the service function module that returns the response message to the detection module.
[0169] The service chain detection device provided by the present disclosure also defines the specific formats of the detection message and the response message, thereby providing a higher possibility and operability for the implementation of the service chain detection.
[0170] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0171] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0172] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0173] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0174] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the service chain detection method. For example, in some embodiments, the service chain detection method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the service chain detection method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the service chain detection method in any other appropriate manner (e.g., by means of firmware).
[0175] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0176] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0177] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0178] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0179] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0180] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0181] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0182] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A service chain detection system, comprising a detection module and a service chain, wherein the service chain comprises a plurality of service function modules arranged in sequence, wherein: The detection module is used to select a starting service function module from a plurality of service function modules and send a detection message to the starting service function module, wherein the detection message includes a first identifier of a target service function module; The service function module is used to query whether the first identifier in the detection message is consistent with its own identifier when receiving the detection message; if the first identifier is inconsistent with its own identifier, forward the detection message to the next service function module; if the first identifier is consistent with its own identifier, return a first response message to the detection module; The service function module is further configured to return a second response message to the detection module when there is a forwarding exception during the process of forwarding the detection message to the next service function module, wherein the second response message includes an exception type field indicating the exception type; the forwarding exception includes: an abnormal connection with the next service function module or failure to query the next service function module; The detection module is further used to determine the detection result based on the response message, and the response message is the first response message or the second response message.
2. The system according to claim 1, wherein the detection message includes a message lifetime; The abnormality type includes at least one of the following: the starting service function module is behind the target service function module, the service function module fails to forward the detection message to the next service function module, and the message lifetime returns to zero.
3. The system according to claim 1, wherein the response message further comprises a second identifier of the service function module that returns the response message to the detection module; The detection module is specifically used to respond to the received response message, and when the second identifier is consistent with the first identifier and the exception type field does not exist, determine that the detection result is a normal service chain; when the second identifier is inconsistent with the first identifier and / or the exception type field exists, determine that the detection result is an abnormal service chain, and locate the service chain abnormality based on the exception type field.
4. The system according to claim 3, wherein: The detection module is further used to record the sending time of the detection message and the receiving time of the response message, and obtain the delay of the service chain based on the sending time and the receiving time.
5. The system according to claim 3, wherein: The detection module is also used to determine that there is a packet loss anomaly in the service chain if the response message is not received after a preset period of time starting from the moment when the detection message is sent; if there is a packet loss anomaly in the service chain, for each service function module in the service function module set, the service function module is used as a new target service function module, and a new starting service function module is selected to send a detection message, wherein the service function module set includes each service function module in the service chain from the starting service function module to the target service function module and the starting service function module.
6. The system according to claim 3, further comprising: Service function proxy module, where: The detection module is used to send the detection message to the starting service function module when the starting service function module senses other service function modules; and send the detection message to the service function proxy module corresponding to the starting service function module when the starting service function module does not sense other service function modules; The service function proxy module is used to query whether the identifier of the starting service function module is consistent with the first identifier when receiving the detection message; if they are inconsistent, forward the detection message to the next service function module of the starting service function module; if they are consistent, return a first response message to the detection module; in the process of forwarding the detection message to the next service function module, when there is a forwarding anomaly, return a second response message to the detection module.
7. The system according to claim 3, wherein: The detection message also includes at least one of the encapsulation protocol type, the service chain ID where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates the current detection identifier, and the security integrity level field is used to record the first identifier; The response message also includes the encapsulation protocol type, the service chain ID of the service function module returning the response message, the request value, the security integrity level field, and at least one of the addresses of the service function module returning the response message, the request value represents the current response identifier, and the security integrity level field is the second identifier.
8. A service chain detection method, applied to a detection module, comprising: A starting service function module is selected from multiple service function modules, and a detection message is sent to the starting service function module, so that when the starting service function module receives the detection message, it queries whether the first identifier in the detection message is consistent with its own identifier, and forwards the detection message to the next service function module when the first identifier is inconsistent with its own identifier, and returns a first response message to the detection module when the first identifier is consistent with its own identifier, and in the process of forwarding the detection message to the next service function module, when there is a forwarding exception, returns a second response message to the detection module, wherein the detection message includes the first identifier of the target service function module; the second response message includes an exception type field indicating the exception type; the forwarding exception includes: a connection exception with the next service function module or the next service function module cannot be queried; A detection result is determined based on a response message, where the response message is the first response message or the second response message.
9. The method according to claim 8, wherein the response message further includes a second identifier of the service function module that returns the response message to the detection module, and the determining of the detection result based on the first response message includes: In response to the received response message, if the second identifier is consistent with the first identifier and there is no abnormal type field, determining that the detection result is that the service chain is normal; When the second identifier is inconsistent with the first identifier and / or the abnormality type field exists, the detection result is determined to be a service chain abnormality, and the service chain abnormality is located based on the abnormality type field.
10. The method according to claim 9, further comprising: The sending time of the detection message and the receiving time of the response message are recorded, and the delay of the service chain is obtained based on the sending time and the receiving time.
11. The method according to claim 9, further comprising: Starting from the time when the detection message is sent, if the response message is not received after a preset time, determining that there is a packet loss anomaly in the service chain; In the case where the service chain has a packet loss anomaly, for each service function module in the service function module set, the service function module is used as a new target service function module, and a new starting service function module is selected to send a detection message, wherein: The service function module set includes each service function module in the service chain from the starting service function module to the target service function module and the starting service function module.
12. The method according to claim 8, wherein the step of selecting a starting service function module from a plurality of service function modules and sending a detection message to the starting service function module, so that the starting service function module, when receiving the detection message, queries whether the first identifier in the detection message is consistent with its own identifier, forwards the detection message to the next service function module when the first identifier is inconsistent with its own identifier, and returns a first response message to the detection module when the first identifier is consistent with its own identifier, comprising: When the starting service function module senses other service function modules, sending the detection message to the starting service function module; When the starting service function module is unaware of other service function modules, the detection message is sent to the service function proxy module corresponding to the starting service function module, so that when the service function proxy module receives the detection message, it inquires whether the identifier of the starting service function module is consistent with the first identifier. If they are inconsistent, the detection message is forwarded to the next service function module of the starting service function module. If they are consistent, the first response message is returned to the detection module. In the process of forwarding the detection message to the next service function module, if there is a forwarding exception, the second response message is returned to the detection module.
13. The method according to claim 9, wherein: The detection message also includes at least one of the encapsulation protocol type, the service chain ID where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates the current detection identifier, and the security integrity level field is used to record the first identifier; The response message also includes the encapsulation protocol type, the service chain ID of the service function module returning the response message, the request value, the security integrity level field, and at least one of the addresses of the service function module returning the response message, the request value represents the current response identifier, and the security integrity level field is the second identifier.
14. A service chain detection method, applied to a service function module, comprising: When receiving a detection message sent by the detection module, query whether the first identifier in the detection message is consistent with its own identifier, wherein the first identifier is the identifier of the target service function module included in the detection message; When the first identifier is inconsistent with its own identifier, forward the detection message to the next service function module; when the first identifier is consistent with its own identifier, return a first response message to the detection module; in the process of forwarding the detection message to the next service function module, when there is a forwarding anomaly, return a second response message to the detection module, so that the detection module determines the detection result based on the response message; wherein, the response message is the first response message or the second response message; the second response message includes an exception type field indicating the exception type; the forwarding anomaly includes: connection abnormality with the next service function module or the next service function module cannot be queried.
15. The method according to claim 14, wherein: The detection message includes a message lifetime, and the abnormal type includes at least one of the following: the starting service function module is behind the target service function module, the service function module fails to forward the detection message to the next service function module, and the message lifetime returns to zero.
16. The method according to claim 15, wherein: The detection message also includes at least one of the encapsulation protocol type, the service chain ID where the target service function module is located, a request value, and a security integrity level field, wherein the request value indicates the current detection identifier, and the security integrity level field is used to record the first identifier; The response message also includes at least one of the encapsulation protocol type, the service chain ID of the service function module that returns the response message, the request value, the security integrity level field, and the address of the service function module that returns the response message, wherein the request value represents the current response identifier, and the security integrity level field is the second identifier of the service function module that returns the response message to the detection module.
17. A service chain detection device, applied to a detection module, comprising: A detection message sending module is used to select a starting service function module from multiple service function modules and send a detection message to the starting service function module, so that the starting service function module, when receiving the detection message, inquires whether the first identifier in the detection message is consistent with its own identifier, forwards the detection message to the next service function module when the first identifier is inconsistent with its own identifier, returns a first response message to the detection module when the first identifier is consistent with its own identifier, and in the process of forwarding the detection message to the next service function module, returns a second response message to the detection module when there is a forwarding exception, wherein the detection message includes the first identifier of the target service function module; the second response message includes an exception type field indicating the exception type; the forwarding exception includes: abnormal connection with the next service function module or failure to query the next service function module; A detection result determination module is used to determine the detection result based on a response message, where the response message is the first response message or the second response message.
18. A service chain detection device, applied to a service function module, comprising: an identification query module, configured to query whether a first identification in the detection message is consistent with its own identification when receiving the detection message sent by the detection module, wherein the first identification is an identification of a target service function module included in the detection message; A detection processing module, configured to forward the detection message to a next service function module when the first identifier is inconsistent with its own identifier; and return a first response message to the detection module when the first identifier is consistent with its own identifier; A message return module is used to return a second response message to the detection module when there is a forwarding anomaly during the process of forwarding the detection message to the next service function module, so that the detection module determines the detection result based on the response message; wherein, the response message is the first response message or the second response message; the second response message includes an exception type field indicating the exception type; the forwarding anomaly includes: an abnormal connection with the next service function module or the next service function module cannot be queried.
19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 8 to 16.
20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 8-16.
21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 8 to 16.
