Method and device for service probe, storage medium and electronic equipment

CN116126578BActive Publication Date: 2026-09-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310105042.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-30
Publication Date
2026-09-18
Estimated Expiration
2043-01-30

AI Technical Summary

Technical Problem

[0004]本发明实施例提供了一种业务服务的探活方法、装置、存储介质及电子设备,以至少解决现有技术中在应用的生产和运行过程中无法发现业务服务存在的错误的技术问题

Benefits of technology

[0017] In the above process, a first request is sent to the target business service through the business probe service, providing a data basis for subsequent determination of whether the sender of the first request is a business probe. By returning a simulated response to the business probe service, a data basis is provided for subsequent determination of whether the business probe service should perform anomaly decision-making. By assigning independent business probes to business services, active probing of business services is achieved, enabling timely detection of business errors during production operations. This allows for rapid identification of the corresponding error code and timely resolution of the current business error, improving the efficiency of error resolution and thus enhancing system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126578B_ABST
    Figure CN116126578B_ABST
Patent Text Reader

Abstract

The application discloses a service service alive detection method and device, a storage medium and electronic equipment, and relates to the technical field of distribution. The method comprises the following steps: according to a preset detection frequency, a service probe service generates an alive detection task for target service service; according to the alive detection task, a first request is generated, and the first request is sent to the target service service through the service probe service; the first request is transmitted to a target aspect of the target service service, and whether the first request is sent by the service probe is judged through the target aspect; in the case that the first request is sent by the service probe, a simulated response is returned to the service probe service, and whether the service probe service makes an abnormal decision is determined according to the simulated response. The application solves the technical problem that the existing technology cannot find errors existing in the service in the production and operation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed technology, and more specifically, to a method, apparatus, storage medium, and electronic device for detecting the activity of a business service. Background Technology

[0002] Currently, most applications perform deep health checks during production and operation to detect technical aspects such as node availability and database availability. However, technical detection cannot detect errors in business code, thus failing to discover errors in business services, causing business operations to fail and affecting the reliability of business systems.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a method, apparatus, storage medium, and electronic device for detecting the activity of business services, in order to at least solve the technical problem in the prior art that errors in business services cannot be detected during the production and operation of applications.

[0005] According to one aspect of the present invention, a method for detecting the activity of a service is provided, comprising: controlling a service probe service to generate a detection task for detecting the activity of a target service according to a preset detection frequency, wherein the service probe service includes at least a service probe used to detect the operation status of the target service; generating a first request according to the detection task and sending the first request to the target service through the service probe service, wherein the first request is a simulated service request; transmitting the first request to a target aspect of the target service and determining whether the sender of the first request is a service probe through the target aspect, wherein the target aspect is used to intercept the first request; if the sender of the first request is a service probe, returning a simulated response to the service probe service and determining whether the service probe service performs anomaly decision processing according to the simulated response, wherein the simulated response is used to simulate the response to the first request, and the anomaly decision processing is used to determine the resolution strategy corresponding to the anomaly code, wherein the anomaly code is the anomaly code of the target service detected during the detection process.

[0006] Furthermore, the business probe service also includes a processing service and an access service. The detection method of the business service also includes: according to a preset detection frequency, controlling the processing service to send a detection command to the access service, wherein the detection command is used to generate a detection task.

[0007] Furthermore, the method for detecting the activity of a business service also includes: accessing the service response to the detection command, invoking the business probe, and determining whether the business probe is in an available state; if the business probe is in an available state, generating a first request.

[0008] Furthermore, the method for detecting the activity of a business service also includes: before generating a detection task to detect the activity of a target business service according to a preset detection frequency, constructing a business probe service through the target server and configuring the calling relationship between the business probe service and the target business service; constructing a target aspect in the target business service and configuring the simulated response corresponding to the business probe.

[0009] Furthermore, the method for detecting the activity of a business service also includes: parsing the first request message corresponding to the first request through a target aspect to obtain the message information of the first request message, wherein the message information includes at least the identifier of the business probe; matching the identifier of the business probe with the identifiers in a target identifier set to obtain a matching result, wherein the target identifier set is a set of business probe identifiers pre-agreed upon by the business probe service and the target business service, and the matching result indicates whether the identifier of the business probe matches the identifiers in the target identifier set successfully; if the identifier of the business probe matches the identifiers in the target identifier set successfully, the sender of the first request is determined to be a business probe; if the identifier of the business probe fails to match the identifiers in the target identifier set, the sender of the first request is determined to be a non-business probe.

[0010] Furthermore, the business service activation method also includes: after determining that the sender of the first request is a non-business probe, sending the first request to the business system so that the business system generates a real response to the first request.

[0011] Furthermore, the business probe method also includes: parsing the simulated message corresponding to the simulated response to obtain the message information of the simulated message; if the message information of the simulated message includes a preset error code, controlling the business probe service to perform anomaly decision processing, wherein the preset error code is used to characterize the error type corresponding to the anomaly code.

[0012] Furthermore, the method for detecting the activity of business services also includes: determining the resolution strategy corresponding to the exception code based on the preset error code; and repairing the exception code according to the resolution strategy.

[0013] According to another aspect of the present invention, a service activation detection apparatus is also provided, comprising: a processing module, configured to control a service probe service to generate an activation detection task for a target service according to a preset detection frequency, wherein the service probe service includes at least a service probe for detecting the operation status of the target service; a sending module, configured to generate a first request according to the activation detection task and send the first request to the target service through the service probe service, wherein the first request is a simulated service request; a judging module, configured to transmit the first request to a target aspect of the target service and judge whether the sender of the first request is a service probe through the target aspect, wherein the target aspect is used to intercept the first request; and a determining module, configured to return a simulated response to the service probe service when the sender of the first request is a service probe, and determine whether the service probe service performs an exception decision processing according to the simulated response, wherein the simulated response is used to simulate the response to the first request, and the exception decision processing is used to determine the resolution strategy corresponding to the exception code, wherein the exception code is the exception code of the target service detected during the activation detection process.

[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to perform the above-described method for detecting the activity of the business service at runtime.

[0015] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to run the programs, wherein the programs are configured to execute the above-described business service activation method during runtime.

[0016] In this embodiment of the invention, a method of probing the activity of a business service is adopted by adding a new business probe service. First, according to a preset detection frequency, the business probe service generates a probing task to probe the activity of the target business service. Then, according to the probing task, a first request is generated and sent to the target business service through the business probe service. The first request is then transmitted to the target aspect of the target business service, and the target aspect determines whether the sender of the first request is a business probe. If the sender of the first request is a business probe, a simulated response is returned to the business probe service, and based on the simulated response, it is determined whether the business probe service should perform anomaly decision handling. The business probe service includes at least a business probe used to detect the operation of the target business service, a simulated business request, a target aspect used to intercept the first request, a simulated response used to simulate the response to the first request, and anomaly decision handling used to determine the resolution strategy corresponding to the anomaly code, where the anomaly code is the anomaly code of the target business service detected during the probing process.

[0017] In the above process, a first request is sent to the target business service through the business probe service, providing a data basis for subsequent determination of whether the sender of the first request is a business probe. By returning a simulated response to the business probe service, a data basis is provided for subsequent determination of whether the business probe service should perform anomaly decision-making. By assigning independent business probes to business services, active probing of business services is achieved, enabling timely detection of business errors during production operations. This allows for rapid identification of the corresponding error code and timely resolution of the current business error, improving the efficiency of error resolution and thus enhancing system reliability.

[0018] Therefore, the technical solution of this invention achieves the goal of detecting business services during the production and operation of applications, thereby enabling timely detection of business errors during production and operation, rapid response and resolution of business-related problems encountered in production, reduction of business-related risks during online application operation, and improvement of system reliability. This solves the technical problem in the prior art that errors in business services cannot be detected during the production and operation of applications. Attached Figure Description

[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0020] Figure 1 This is a flowchart of an optional business service activation method according to an embodiment of the present invention;

[0021] Figure 2This is an optional flowchart for exploring business services according to an embodiment of the present invention;

[0022] Figure 3 This is a schematic diagram of an optional business service detection device according to an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] It should be noted that all relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this invention are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with the relevant user or organization. Before obtaining relevant information, it needs to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.

[0027] Example 1

[0028] According to an embodiment of the present invention, an embodiment of a method for detecting the activity of a business service is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0029] Figure 1 This is a flowchart of an optional service activation method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0030] Step S101: According to the preset detection frequency, control the business probe service to generate a detection task to detect the target business service. The business probe service includes at least a business probe, which is used to detect the operation status of the target business service.

[0031] In the above steps, a reasonable probe frequency can be pre-configured (e.g., once per minute). Based on the preset probe frequency, the business probe service is controlled to generate probe tasks to detect the target business service. Optionally, detecting the target business service can be done by detecting the target business code of the target business service. The target business service can be a payment transaction service, a transfer transaction service, etc., and the target business code can be the core business code of the application, such as the main process class.

[0032] Step S102: Based on the liveness detection task, generate a first request and send the first request to the target business service through the business probe service, wherein the first request is a simulated business request.

[0033] In the above steps, the business probe service generates a first request based on the liveness detection task. Optionally, sending the first request to the target business service through the business probe service can be done by sending a first request message to the target interface of the target business service. The first request message can be a simulated business request message, and the target interface can be an RPC interface or an HTTP interface.

[0034] Optionally, applications (e.g., applications used by financial institutions) may lack the ability to probe key transaction execution logic (e.g., processing logic for verifying message length and the validity of message fields during payment transactions) at the business level during production operations, thus failing to detect business-related anomalies or error codes. In this embodiment, a new business probe service is added to probe the business code (main process class), enabling the timely detection of anomalies or error codes related to the business service.

[0035] Figure 2 This is an optional flowchart for exploring business services according to an embodiment of the present invention, such as... Figure 2As shown, the business probe of the business probe service sends the first request message to the RPC interface and HTTP interface of the main process class. The RPC interface and HTTP interface are implemented through the access class. The first request message is a simulated request message generated to simulate a transaction. For example, if a payment transaction is simulated through the business probe service, the first request message is a payment request message.

[0036] It should be noted that in the above process, the activation of the business service (i.e., the activation of the business code) was achieved by simulating the transaction business request initiated by the user. This can detect the running status of the business code, thereby knowing whether the business service can run normally and whether the processing logic of the business service can be executed normally, and thus can promptly detect business errors in the production operation process.

[0037] Step S103: The first request is transmitted to the target aspect of the target service, and the target aspect is used to determine whether the sender of the first request is a service probe. The target aspect is used to intercept the first request.

[0038] In the above steps, the first request is received by the target business service and then transmitted to the target aspect of the target business service. Optionally, the target aspect can be a Mock aspect class, which intercepts the first request and determines whether the sender of the first request is a business probe.

[0039] It should be noted that by using the target aspect, requests can be intercepted to determine whether the current request is issued by a business probe or by the actual business. This allows for the detection of business services during application operation without affecting the normal operation of the business, thereby enabling timely detection of business errors during operation and reducing business-related risks during online application operation.

[0040] Step S104: If the sender of the first request is a business probe, return the simulated response to the business probe service, and determine whether the business probe service should perform exception decision processing based on the simulated response. The simulated response is used to simulate the response to the first request, and the exception decision processing is used to determine the resolution strategy corresponding to the exception code. The exception code is the exception code of the target business service detected during the probe process.

[0041] In the above steps, the simulated response can be a response pre-configured for different simulated transactions. For example, if the simulated transaction is a payment transaction, the simulated response is the response to the payment transaction; if the simulated transaction is a transfer transaction, the simulated response is the response to the transfer transaction.

[0042] Optionally, the resolution strategy corresponding to the exception code can be a pre-defined resolution strategy for a specific error, or a pre-defined exception alarm strategy for an unknown error. For example, exception A is insufficient memory space, and the pre-defined resolution strategy corresponding to exception A is a restart strategy. If the error code in the message information of the simulated response (i.e., the response message) is exception A, then the business probe service performs exception decision processing to determine the resolution strategy (i.e., the restart strategy) corresponding to exception A. Optionally, if the message information of the simulated response (i.e., the response message) does not contain an error code, then it is assumed that the business code does not have any exceptions or error codes, and no exception decision processing is required.

[0043] Optional, such as Figure 2 As shown, the business probe service also includes an exception decision processing service, which can determine the solution strategy corresponding to the exception code.

[0044] It should be noted that the above process can quickly identify the corresponding solution strategy for the error code and resolve the current business error in a timely manner, thereby improving the efficiency of resolving business errors and thus enhancing the reliability of the system.

[0045] Based on the scheme defined in steps S101 to S104 above, it can be understood that in this embodiment of the invention, the method of probing the activity of a business service by adding a new business probe service is adopted. First, according to a preset detection frequency, the business probe service is controlled to generate a probing task to probe the activity of the target business service. Then, according to the probing task, a first request is generated and sent to the target business service through the business probe service. The first request is then transmitted to the target aspect of the target business service, and the target aspect determines whether the sender of the first request is a business probe. If the sender of the first request is a business probe, a simulated response is returned to the business probe service, and based on the simulated response, it is determined whether the business probe service should perform anomaly decision processing. The business probe service includes at least a business probe used to detect the operation of the target business service. The first request is a simulated business request. The target aspect is used to intercept the first request. The simulated response is used to simulate the response to the first request. The anomaly decision processing is used to determine the solution strategy corresponding to the anomaly code. The anomaly code is the anomaly code of the target business service detected during the probing process.

[0046] In the above process, a first request is sent to the target business service through the business probe service, providing a data basis for subsequent determination of whether the sender of the first request is a business probe. By returning a simulated response to the business probe service, a data basis is provided for subsequent determination of whether the business probe service should perform anomaly decision-making. By assigning independent business probes to business services, active probing of business services is achieved, enabling timely detection of business errors during production operations. This allows for rapid identification of the corresponding error code and timely resolution of the current business error, improving the efficiency of error resolution and thus enhancing system reliability.

[0047] Therefore, the technical solution of this invention achieves the goal of detecting business services during the production and operation of applications, thereby enabling timely detection of business errors during production and operation, rapid response and resolution of business-related problems encountered in production, reduction of business-related risks during online application operation, and improvement of system reliability. This solves the technical problem in the prior art that errors in business services cannot be detected during the production and operation of applications.

[0048] In an optional embodiment, the business probe service further includes a processing service and an access service. During the process of controlling the business probe service to generate a probe task to detect the target business service according to a preset detection frequency, the processing service is controlled to issue a probe command to the access service according to the preset detection frequency, wherein the probe command is used to generate the probe task.

[0049] In an optional embodiment, during the process of generating the first request according to the liveness detection task, the access service responds to the liveness detection command, calls the business probe, and determines whether the business probe is in an available state. Then, if the business probe is in an available state, the first request is generated.

[0050] Optional, such as Figure 2 As shown, the processing service, namely the stock detection service, sends a detection command to the access service according to the preset detection frequency, instructing the access service to perform a business detection task.

[0051] Furthermore, the access service responds to the activation command, invokes the service probe, and determines whether the service probe is in an available state. If the service probe is in an available state, a first request is generated. Specifically, the state of the service probe's enable switch, i.e., the CMC switch, is detected. If the service probe's enable switch is in an on state, i.e., the CMC switch is on, then the service probe is determined to be in an available state, the request message entity is initialized, and a first request message is generated.

[0052] It should be noted that in this embodiment, a business probe is used to construct a virtual user and simulate various transaction businesses initiated by the user, thereby realizing the processing of simulated businesses by the business service. This allows us to know whether the business service can be executed normally and to promptly detect business errors in the production operation process.

[0053] In an optional embodiment, before the business probe service generates a probe task to probe the target business service according to a preset probe frequency, the business probe service is first built through the target server, and the calling relationship between the business probe service and the target business service is configured. Then, the target aspect is built in the target business service, and the simulated response corresponding to the business probe is configured.

[0054] Optionally, the target server can be a server corresponding to a newly added server node in the application's container runtime environment, and the call relationship can be that the business probe service calls the main process class. Specifically, a new server node is added in the container, the business probe service is deployed (i.e., added) on the server, and a new interface class (Class) for the business probe service is added, which then calls the main process class. For example, Figure 2 As shown, the business probe service includes business probes, stock detection service (i.e., processing service), access service, and anomaly decision processing service.

[0055] Furthermore, such as Figure 2 As shown, building a target aspect in the target business service can be achieved by adding a Mock aspect class to the main process class of the front-end service. This class is used to identify business probes and return pre-configured response messages. The front-end service is an already running service, such as a money transfer service or a payment transaction service.

[0056] Optionally, independent business probes can be assigned to different business services, and simulated responses corresponding to the business probes can be configured. Each business probe corresponds to a unique business probe identifier ID. For example, the business probe ID corresponding to the payment transaction service is business probe1, and the business probe ID corresponding to the transfer transaction service is business probe2.

[0057] Optionally, a monitoring interface for the service probe can be added to the current monitoring system to monitor the probe's detection process and generate a detection log to record the probe's detection process. Optionally, in this embodiment, an enable switch for the service probe can be configured, such as a CMC switch. If the CMC switch is enabled, the service probe is determined to be in an available state.

[0058] Optionally, in this embodiment, a reasonable detection frequency (e.g., 1 minute / time) and a threshold for executing the resolution strategy can also be pre-configured. For example, the threshold for the restart strategy can be configured to be 3 times. If the number of times the returned detection result indicates insufficient memory space (i.e., the message information of the simulated message contains insufficient memory space) exceeds 3 times, the container running the business code will be restarted.

[0059] It should be noted that by configuring separate business probes for business services, the business services can be monitored and tested. By adding a Mock aspect class to the main process class, the Mock aspect class can distinguish between the request messages sent by the business probe and the request messages sent by the real business based on the ID of the business probe. This allows for the timely detection of business errors during operation without affecting the normal operation of the business, thereby reducing business-related risks during the online operation of the application.

[0060] In one optional embodiment, in determining whether the sender of the first request is a service probe through the target aspect, the first request message corresponding to the first request is first parsed through the target aspect to obtain the message information of the first request message. Then, the identifier of the service probe is matched with the identifiers in the target identifier set to obtain a matching result. If the identifier of the service probe matches successfully with the identifiers in the target identifier set, the sender of the first request is determined to be a service probe. If the identifier of the service probe fails to match the identifiers in the target identifier set, the sender of the first request is determined to be a non-service probe. The message information includes at least the identifier of the service probe, the target identifier set is a set of identifiers of service probes pre-agreed upon by the service probe service and the target service, and the matching result indicates whether the identifier of the service probe matches successfully with the identifiers in the target identifier set.

[0061] Optionally, the identifier for a service probe can be its ID. For example... Figure 2 As shown, the main process class receives the first request through the RPC interface and the HTTP interface, and after performing conventional processing such as data conversion, service information acquisition, service routing, and service degradation, it sends the first request message corresponding to the first request to the Mock aspect class. The Mock aspect class intercepts and parses the first request message to obtain message information, such as the ID of the business probe.

[0062] Optionally, the Mock aspect class can determine whether the sender of the first request message is a business probe based on the parsed message information. For example, if the ID of the business probe included in the message information is the ID pre-agreed between the business probe service and the main process class, then the sender of the first request message is considered to be a business probe, and the simulated message is returned to the business probe service.

[0063] Specifically, the Mock aspect class matches the ID of the business probe included in the message information with the IDs in the target identifier set to determine whether the sender of the current request (i.e., the sender of the first request message) is a business probe. Optionally, if the ID of the business probe successfully matches the ID in the target identifier set, the sender of the first request is determined to be a business probe; if the ID of the business probe fails to match the ID in the target identifier set, the sender of the first request is determined to be a non-business probe, i.e., the sender of the first request message is a user conducting a real transaction.

[0064] It should be noted that, in the above process, obtaining the message information of the first request message provides a data basis for subsequent determination of whether the sender of the first request message is a business probe.

[0065] In an optional embodiment, after determining that the sender of the first request is a non-business probe, the first request is sent to the business system so that the business system generates a real response to the first request.

[0066] Optional, such as Figure 2 As shown, the Mock aspect class determines that the sender of the current request (i.e., the first request) is a regular user, and continues to execute subsequent service request calls, returning a real message. Specifically, if the sender of the first request is a user conducting a real transaction, the first request message corresponding to the first request is sent to the business system, so that the business system generates a real response message to the first request message, ensuring the normal operation of the business.

[0067] In one optional embodiment, during the process of determining whether the business probe service should perform anomaly decision processing based on the simulated response, the simulated message corresponding to the simulated response is parsed to obtain the message information of the simulated message. Then, if the message information of the simulated message includes a preset error code, the business probe service is controlled to perform anomaly decision processing, wherein the preset error code is used to characterize the error type corresponding to the anomaly code.

[0068] In one optional embodiment, when the message information of the simulated message includes a preset error code, during the process of controlling the business probe service to make anomaly decision-making, the solution strategy corresponding to the error code is first determined according to the preset error code, and then the error code is repaired according to the solution strategy.

[0069] Optionally, the simulated message can be a response message pre-configured for different simulated services. For example, if the simulated service is a payment service, the simulated message is the response message for the payment service; if the simulated service is a transfer service, the simulated message is the response message for the transfer service.

[0070] Optionally, the preset error code can be an error code for a specific error or an error code for an unknown error. For example, based on expert experience, error codes A1, A2, and A3 can be configured for specific errors that can be resolved by restarting strategies, such as failure to obtain CMC parameters, service call timeout, and failure to obtain database connection pool. For unknown error 1, error code B1 can be configured.

[0071] Optionally, the business probe service parses the simulated message (i.e., the response message) to obtain the message information of the simulated message. Further, if the message information of the simulated message (i.e., the response message) does not contain an error code, it is assumed that the business service does not have any exceptions or error codes, and no exception handling is required.

[0072] Optionally, if the simulated message includes a preset error code, it is considered that the business probe has detected an error in the business service, and the business probe service is controlled to perform anomaly decision-making. Specifically, the anomaly decision-making service of the business probe service can determine the corresponding resolution strategy based on the preset error code, and then repair the anomaly code according to the resolution strategy. For example, if the error code corresponds to insufficient balance, the preset error code is C1, and the error type is normal error 1, then its resolution strategy can be selected as the ignore strategy through configuration; if the error code corresponds to card number not found, the preset error code is C2, and the error type is normal error 2, then its resolution strategy can be selected as the alarm strategy through configuration, and an alarm will be triggered for manual intervention and investigation; if the error code corresponds to insufficient memory space, the preset error code is exception A, the error type is exception error 2, and the corresponding pre-defined resolution strategy is the restart strategy, then restarting the container to release memory will repair the anomaly code, allowing the business to operate smoothly.

[0073] It should be noted that in the above process, after the error of the business service is discovered by the business probe, the corresponding solution strategy can be determined according to the preset error code. In this way, the abnormal code can be repaired according to the solution strategy, realizing the self-healing process after the error of the business service is discovered, and improving the reliability of the system.

[0074] Therefore, the technical solution of this invention achieves the goal of detecting business services during the production and operation of applications, thereby enabling timely detection of business errors during production and operation, rapid response and resolution of business-related problems encountered in production, reduction of business-related risks during online application operation, and improvement of system reliability. This solves the technical problem in the prior art that errors in business services cannot be detected during the production and operation of applications.

[0075] Example 2

[0076] According to an embodiment of the present invention, an embodiment of a business service activation detection device is provided, wherein, Figure 3 This is a schematic diagram of an optional business service activation device according to an embodiment of the present invention, such as... Figure 3 As shown, the device includes: a processing module 301, configured to control a business probe service to generate a probe task to detect the activity of a target business service according to a preset detection frequency, wherein the business probe service includes at least a business probe used to detect the operation status of the target business service; a sending module 302, configured to generate a first request according to the probe task and send the first request to the target business service through the business probe service, wherein the first request is a simulated business request; a judging module 303, configured to transmit the first request to a target aspect of the target business service and determine whether the sender of the first request is a business probe through the target aspect, wherein the target aspect is used to intercept the first request; and a determining module 304, configured to return a simulated response to the business probe service if the sender of the first request is a business probe, and determine whether the business probe service should perform anomaly decision processing based on the simulated response, wherein the simulated response is used to simulate the response to the first request, and the anomaly decision processing is used to determine the resolution strategy corresponding to the anomaly code, wherein the anomaly code is the anomaly code of the target business service detected during the probe process.

[0077] It should be noted that the above-mentioned processing module 301, sending module 302, judging module 303 and determining module 304 correspond to steps S101 to S104 in the above embodiments. The four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in the above embodiment 1.

[0078] Optionally, the business probe service also includes a processing service and an access service. The processing module includes: a first processing module, used to control the processing service to send a liveness detection command to the access service according to a preset detection frequency, wherein the liveness detection command is used to generate a liveness detection task.

[0079] Optionally, the sending module includes: a second processing module, used to access the service response activation command, invoke the service probe, and determine whether the service probe is in an available state; and a third processing module, used to generate a first request if the service probe is in an available state.

[0080] Optionally, the business service probe device further includes: a first configuration module, used to build a business probe service through the target server and configure the calling relationship between the business probe service and the target business service; and a second configuration module, used to build a target aspect in the target business service and configure the simulated response corresponding to the business probe.

[0081] Optionally, the judgment module includes: a fourth processing module, used to parse and process the first request message corresponding to the first request through the target aspect to obtain the message information of the first request message, wherein the message information includes at least the identifier of the service probe; a matching module, used to match the identifier of the service probe with the identifiers in the target identifier set to obtain a matching result, wherein the target identifier set is a set of identifiers of service probes pre-agreed between the service probe service and the target service, and the matching result indicates whether the identifier of the service probe matches the identifiers in the target identifier set successfully; a first determination module, used to determine that the sender of the first request is a service probe if the identifier of the service probe matches the identifiers in the target identifier set successfully; and a second determination module, used to determine that the sender of the first request is a non-service probe if the identifier of the service probe fails to match the identifiers in the target identifier set.

[0082] Optionally, the business service detection device further includes: a first sending module, used to send the first request to the business system so that the business system generates a real response to the first request.

[0083] Optionally, the determining module includes: a fifth processing module, used to parse and process the simulated message corresponding to the simulated response to obtain the message information of the simulated message; and a sixth processing module, used to control the business probe service to perform abnormal decision processing when the message information of the simulated message includes a preset error code, wherein the preset error code is used to characterize the error type corresponding to the abnormal code.

[0084] Optionally, the sixth processing module includes: a third determining module, used to determine the resolution strategy corresponding to the exception code based on the preset error code; and a seventh processing module, used to perform repair processing on the exception code according to the resolution strategy.

[0085] Example 3

[0086] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to perform the above-described method for detecting the activity of the business service at runtime.

[0087] Example 4

[0088] According to another aspect of the present invention, an electronic device is also provided, wherein, Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as... Figure 4As shown, the electronic device includes one or more processors; a memory for storing one or more programs. When one or more programs are executed by one or more processors, the one or more processors are configured to run the programs, wherein the programs are set to execute the aforementioned business service activation method during runtime. When the processor executes the program, it performs the following steps: Based on a preset detection frequency, it controls a business probe service to generate an activation task to detect the target business service, wherein the business probe service includes at least a business probe used to detect the operation status of the target business service; based on the activation task, it generates a first request and sends the first request to the target business service through the business probe service, wherein the first request is a simulated business request; it transmits the first request to a target aspect of the target business service and determines whether the sender of the first request is a business probe through the target aspect, wherein the target aspect is used to intercept the first request; if the sender of the first request is a business probe, it returns a simulated response to the business probe service and determines whether the business probe service performs an exception decision processing based on the simulated response, wherein the simulated response is used to simulate the response to the first request, and the exception decision processing is used to determine the resolution strategy corresponding to the exception code, wherein the exception code is the exception code of the target business service detected during the activation process.

[0089] Optionally, the business probe service also includes a processing service and an access service. When the processor executes the program, it also implements the following steps: according to the preset probe frequency, the processing service is controlled to send a liveness detection command to the access service, wherein the liveness detection command is used to generate a liveness detection task.

[0090] Optionally, the processor may also perform the following steps when executing the program: accessing the service response activation command, invoking the service probe, and determining whether the service probe is in an available state; if the service probe is in an available state, generating a first request.

[0091] Optionally, the processor may also perform the following steps when executing the program: before the business probe service generates a probe task to probe the target business service according to the preset probe frequency, the business probe service is constructed through the target server and the calling relationship between the business probe service and the target business service is configured; the target aspect is constructed in the target business service and the simulated response corresponding to the business probe is configured.

[0092] Optionally, the processor, when executing the program, further implements the following steps: parsing the first request message corresponding to the first request through the target aspect to obtain the message information of the first request message, wherein the message information includes at least the identifier of the service probe; matching the identifier of the service probe with the identifiers in the target identifier set to obtain a matching result, wherein the target identifier set is a set of identifiers of service probes pre-agreed upon by the service probe service and the target service, and the matching result indicates whether the identifier of the service probe matches the identifiers in the target identifier set successfully; if the identifier of the service probe matches the identifiers in the target identifier set successfully, the sender of the first request is determined to be a service probe; if the identifier of the service probe fails to match the identifiers in the target identifier set, the sender of the first request is determined to be a non-service probe.

[0093] Optionally, the processor may also perform the following steps when executing the program: after determining that the sender of the first request is a non-business probe, the first request is sent to the business system so that the business system generates a real response to the first request.

[0094] Optionally, when the processor executes the program, it also performs the following steps: parsing the simulated message corresponding to the simulated response to obtain the message information of the simulated message; if the message information of the simulated message includes a preset error code, controlling the service probe service to perform anomaly decision processing, wherein the preset error code is used to characterize the error type corresponding to the anomaly code.

[0095] Optionally, the processor may also perform the following steps when executing the program: determine the resolution strategy corresponding to the exception code based on the preset error code; and perform repair processing on the exception code according to the resolution strategy.

[0096] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0097] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0098] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0099] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0100] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0101] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0103] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method of service reachability probing, characterized by, include: According to a preset detection frequency, the service probe service is controlled to generate a detection task to detect the target service. The service probe service includes at least a service probe, which is used to detect the operation status of the target service. Based on the activity detection task, a first request is generated and sent to the target business service through the business probe service, wherein the first request is a simulated business request; The first request is transmitted to the target aspect of the target service, and the target aspect is used to determine whether the sender of the first request is the service probe, wherein the target aspect is used to intercept the first request; If the sender of the first request is the business probe, a simulated response is returned to the business probe service, and based on the simulated response, it is determined whether the business probe service performs anomaly decision processing. The simulated response is used to simulate the response to the first request, and the anomaly decision processing is used to determine the resolution strategy corresponding to the anomaly code. The anomaly code is the anomaly code of the target business service detected during the activity detection process. The anomaly code is a preset error code configured based on expert experience to characterize a violation of business rules. Based on the simulated response, determining whether the service probe service should perform anomaly decision processing includes: parsing the simulated message corresponding to the simulated response to obtain the message information of the simulated message; if the message information of the simulated message includes a preset error code, controlling the service probe service to perform the anomaly decision processing, wherein the preset error code is used to characterize the error type corresponding to the anomaly code.

2. The method of claim 1, wherein, The business probe service also includes a processing service and an access service. Based on a preset probe frequency, the business probe service generates activation tasks to probe the target business service, including: According to the preset detection frequency, the processing service is controlled to send a liveness detection command to the access service, wherein the liveness detection command is used to generate the liveness detection task.

3. The method according to claim 2, characterized in that, Based on the liveness detection task, a first request is generated, including: The access service responds to the activation command by invoking the service probe and determining whether the service probe is in an available state. If the service probe is in the available state, the first request is generated.

4. The method according to claim 1, characterized in that, Before generating a probe task to detect the target service based on a preset detection frequency, the method further includes: The business probe service is constructed through the target server, and the calling relationship between the business probe service and the target business service is configured. The target aspect is constructed in the target business service, and the simulated response corresponding to the business probe is configured.

5. The method according to claim 1, characterized in that, Determining whether the sender of the first request is the service probe through the target aspect includes: The target face is used to parse and process the first request message corresponding to the first request to obtain the message information of the first request message, wherein the message information includes at least the identifier of the service probe; The identifier of the service probe is matched with the identifier in the target identifier set to obtain a matching result. The target identifier set is a set of identifiers of service probes that are pre-agreed upon by the service probe service and the target service. The matching result indicates whether the identifier of the service probe is successfully matched with the identifier in the target identifier set. If the identifier of the service probe successfully matches the identifier in the target identifier set, the sender of the first request is determined to be the service probe. If the identifier of the service probe fails to match the identifier in the target identifier set, the sender of the first request is determined to be a non-service probe.

6. The method according to claim 5, characterized in that, After determining that the sender of the first request is a non-business probe, the method further includes: The first request is sent to the business system so that the business system generates a real response to the first request.

7. The method according to claim 1, characterized in that, If the simulated message includes a preset error code, the service probe service is controlled to perform the anomaly decision processing, including: Based on the preset error code, determine the corresponding resolution strategy for the exception code; The abnormal code is repaired according to the aforementioned solution strategy.

8. A business service activity detection device, characterized in that, include: The processing module is used to control the business probe service to generate a probe activity task to probe the target business service according to a preset probe frequency. The business probe service includes at least a business probe, which is used to probe the operation status of the target business service. The sending module is configured to generate a first request based on the activity detection task, and send the first request to the target service through the service probe service, wherein the first request is a simulated service request; The judgment module is used to transmit the first request to the target aspect of the target business service, and to determine whether the sender of the first request is the business probe through the target aspect, wherein the target aspect is used to intercept the first request; The determination module is used to return a simulated response to the business probe service when the sender of the first request is the business probe, and to determine whether the business probe service should perform anomaly decision processing based on the simulated response. The simulated response is used to simulate the response to the first request, and the anomaly decision processing is used to determine the resolution strategy corresponding to the anomaly code. The anomaly code is the anomaly code of the target business service detected during the activity detection process. The anomaly code is a preset error code configured based on expert experience to represent a violation of business rules. The determining module includes: a fifth processing module, used to parse the simulated message corresponding to the simulated response to obtain the message information of the simulated message; and a sixth processing module, used to control the service probe service to perform the abnormal decision processing when the message information of the simulated message includes a preset error code, wherein the preset error code is used to characterize the error type corresponding to the abnormal code.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the activation method of the business service as described in any one of claims 1 to 7 when it is run.

10. An electronic device, characterized in that, The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to run the programs, wherein the programs are configured to execute the activation method for the business service as described in any one of claims 1 to 7 at runtime.

Citation Information

Patent Citations

  • AI service open center station and method

    CN110245031A

  • Method and system for applying health examination based on Kubernetes container

    CN110825490A