A data processing method, device, computer equipment and storage medium

By using the proxy interface to perform exception detection and preset data return in the microservice architecture, the service interruption problem caused by the microservice interface exception is solved, and rapid recovery and security improvement is achieved.

CN114185743BActive Publication Date: 2024-11-26CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111524244.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2024-11-26
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

In the microservice architecture, when a user requests a microservice for an application, the interface of the microservice is abnormal, which makes it impossible to provide service functions. The existing technology is difficult to quickly solve this problem, affecting the user experience and system stability.

Method used

By performing exception detection in the proxy interface of the target service interface and returning preset service data when an exception is detected, we ensure that the system can quickly resume services, while avoiding direct exposure of the target service interface, improving security.

Benefits of technology

It realizes the rapid and effective service provision when the service interface is abnormal, ensures user experience and system stability, and improves the security of the target service interface through the proxy interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114185743B_ABST
    Figure CN114185743B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, device, computer equipment and storage medium, including: receiving a service request for a target application service; determining a target service interface corresponding to the target application service from one or more service interfaces based on the service request; executing the target business logic encapsulated by the target service interface to obtain first data; obtaining monitoring data of the target service interface through a proxy interface corresponding to the target service interface, performing anomaly detection on the target service interface based on the monitoring data, and obtaining a detection result; if the detection result indicates that the target service interface has an anomaly, returning the second data as service data through the proxy interface; if the detection result indicates that the target service interface does not have an anomaly, returning the first data as service data through the proxy interface, and effective services can be quickly provided. The present application relates to blockchain technology, such as the second data can be written into the blockchain for use in scenarios such as obtaining the second data through the proxy interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer device and storage medium. Background Art

[0002] At present, with the development of computer technology, microservices is an emerging software architecture, which is to split a large single application into dozens of microservices, each of which can provide a service of the application. The strategy of microservices can make work easier. However, when a user requests a microservice of an application, the interface of the microservice is abnormal, resulting in the inability of the microservice to provide the corresponding service function. Summary of the invention

[0003] The embodiments of the present application provide a data processing method, apparatus, computer device and storage medium, which can quickly provide effective services when a service interface is abnormal.

[0004] A first aspect of an embodiment of the present application provides a data processing method, including:

[0005] receiving a service request for a target application service, the target application service being any one of a plurality of application services included in a target application, the service request being used to request service data of the target application service;

[0006] Determining a target service interface corresponding to the target application service from one or more service interfaces based on the service request;

[0007] Execute the target business logic encapsulated by the target service interface to obtain first data;

[0008] Acquire monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform abnormality detection on the target service interface based on the monitoring data to obtain a detection result;

[0009] If the detection result indicates that the target service interface is abnormal, returning second data as the service data through the proxy interface, where the second data is preset service data;

[0010] If the detection result indicates that there is no abnormality in the target service interface, the first data is returned as the service data through the proxy interface.

[0011] A second aspect of an embodiment of the present application provides a data processing device, including:

[0012] A receiving unit, configured to receive a service request for a target application service, wherein the target application service is any one of a plurality of application services included in a target application, and the service request is used to request service data of the target application service;

[0013] A processing unit, configured to determine a target service interface corresponding to the target application service from one or more service interfaces based on the service request;

[0014] The processing unit is further configured to execute the target business logic encapsulated by the target service interface to obtain the first data;

[0015] The processing unit is further configured to obtain monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform anomaly detection on the target service interface based on the monitoring data to obtain a detection result;

[0016] The processing unit is further configured to return second data as the service data through the proxy interface if the detection result indicates that the target service interface is abnormal, wherein the second data is preset service data;

[0017] The processing unit is further configured to return the first data as the service data through the proxy interface if the detection result indicates that there is no abnormality in the target service interface.

[0018] On the one hand, an embodiment of the present application provides a computer device, including a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the data processing method described above.

[0019] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the data processing method described above.

[0020] On the one hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the above-mentioned data processing method is executed.

[0021] In the embodiment of the present application, a service request for a target application service is received, the target application service is any one of the multiple application services included in the target application, and the service request is used to request service data of the target application service; based on the service request, the target service interface corresponding to the target application service is determined from one or more service interfaces; the target business logic encapsulated by the target service interface is executed to obtain the first data; the monitoring data of the target service interface when executing the target business logic is obtained through the proxy interface corresponding to the target service interface, and the target service interface is detected based on the monitoring data to obtain the detection result; if the detection result indicates that the target service interface is abnormal, the second data is returned as the service data through the proxy interface, and the second data is the preset service data; if the detection result indicates that the target service interface is not abnormal, the first data is returned as the service data through the proxy interface. The monitoring data can be quickly obtained through the proxy interface, and the service interface can be quickly detected based on the monitoring data. Whether there is an abnormality, without sending the monitoring data to the management and control platform, the platform analyzes it. Further, when there is an abnormality, the preset service data can be returned through the proxy interface to ensure that the target application service can provide services normally. And the target service interface can be avoided from being directly exposed through the proxy interface, which effectively improves the security of the target service interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 It is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;

[0024] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application;

[0025] Figure 3 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0026] Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] The embodiments of the present application can acquire and process service data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0029] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0030] The embodiment of the present application provides a data processing scheme, and the general principle of the data processing scheme is as follows: when a user wants to use an application service of an application, the application can be triggered, and after entering the application, a certain application service among the multiple application services included in the application can be selected. Correspondingly, when a service request for a target application service is received, a target service interface corresponding to the target application service can be determined from one or more service interfaces based on the service request. One or more business logics are encapsulated in the target service interface, and the target business logic can be determined from one or more business logics according to the service request, and the target business logic is executed to obtain first data, and the interface status of the target service interface when executing the target business logic is monitored through the proxy interface corresponding to the target service interface, and then it can be determined whether the target service interface is abnormal according to the interface status. If the target service interface is abnormal, the second data is returned through the proxy interface, and the second data is the preset service data; if the detection result indicates that the target service interface is not abnormal, the first data is obtained from the target service interface through the proxy interface, and the first data is returned through the proxy interface.

[0031] The above data processing scheme can achieve the following beneficial effects: the interface status of the target service interface can be quickly obtained through the proxy interface, so that it can be quickly determined whether the target service interface is abnormal according to the interface status. When the target service interface is abnormal, the preset service data is returned through the proxy interface; when the target service interface is not abnormal, the first data is returned through the proxy interface. In other words, regardless of whether the target service interface is abnormal, it can effectively ensure that the target application service can provide services normally. And the proxy interface can avoid direct exposure of the target service interface, effectively improving the security of the target service interface.

[0032] Based on the above data processing solution, the present application embodiment provides a data processing system, see Figure 1 , the data processing system may include at least one terminal device 101 and at least one server 102. The terminal device 101 may display different applications, which may be instant messaging applications, video applications, and the like. Optionally, the terminal device 101 may display the interface of the application service included in each application, and the user may perform corresponding operations in the interface of the application service. The server 102 may store one or more business logics encapsulated in each service interface, as well as service data related to each application service, and the like. Among them, the terminal device 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, and this application is not limited here. The terminal device 101 may be a smart device such as a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, etc. The above-mentioned server 102 includes multiple servers (also referred to as nodes), which may be independent physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0033] In a specific implementation, after receiving a service request for a target application, the terminal device 101 can determine the target service interface corresponding to the target application service from one or more service interfaces stored in the server 102 based on the service request, and execute the target business logic encapsulated by the target service interface to obtain the first data; obtain the monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform anomaly detection on the target service interface based on the monitoring data to obtain the detection result. If the detection result indicates that the target service interface is abnormal, the second data is obtained from the server 102 through the proxy interface, and the second data is returned as service data through the proxy interface, and the second data is the preset service data; if the detection result indicates that the target service interface is not abnormal, the first data is returned as service data through the proxy interface.

[0034] Based on the above data processing solution, this application embodiment provides a data processing method, see Figure 2 The data processing method may be executed by a computer device, which may be the terminal device 101 or the server 102 of the above data processing system; alternatively, the data processing method may be executed by a target application in the computer device. The data processing method may include the following steps S201-S206:

[0035] S201: Receive a service request for a target application service, where the target application service is any one of a plurality of application services included in a target application, and the service request is used to request service data of the target application service.

[0036] Among them, the target application can be any one of the multiple applications included in the computer device, each application can provide different application services for users, and each application service coordinates and cooperates with each other to provide ultimate value for users. Each application service runs in its independent process, and the application services communicate with each other using a lightweight communication mechanism. It should be noted that the application services included in each application can be called microservices. The target application can be an instant messaging application, a video application, a game application, a payment application, and the like. There are different application services for different applications. For example, the target application is a payment application, and the application service can be an order service, a data query service, and the like. For another example, the target application is an instant messaging application, and the application service can include a data query service, an information sending service, and the like. The service request can carry an interface identifier of the target service interface. The service data can be query data, verification data, interface data, and the like.

[0037] In one embodiment, when a user wants to obtain an application service of a certain application, the user can first enter the target application by clicking, double-clicking, etc. The computer device can detect the click or double-click operation on the target application and display the main interface where the target application is located, and the main interface includes multiple application services. Then the user can select the target application service from the multiple application services, and the computer device can receive a service request for the target application service sent by the user, and the service request carries a service interface identifier.

[0038] In one embodiment, the service request may also be sent by other application services other than the target application service. It can be understood that: there is data interaction between the two target application services, and at this time, a service level agreement needs to be used to implement data interaction between the two target application services. For example, application service 1 obtains data that needs to be verified, and application service 2 verifies the data obtained by application service 1. At this time, application service 2 needs to obtain the data that needs to be verified from application service 1.

[0039] S202: Determine a target service interface corresponding to the target application service from one or more service interfaces based on the service request.

[0040] Among them, the target application service can correspond to one or more service interfaces, and each service interface can implement part of the services of the target application service. For example, the target application service is an order query service, and the order query service can correspond to two service interfaces. Service interface 1 can execute the identity authentication service in the target application service, and service interface 2 can execute the identity-based order query service in the target application service. Optionally, each service interface can also encapsulate one or more business processing logics. For example, when performing identity authentication services, service interface 1 can obtain corresponding identity information from a database or a blockchain, and then verify the obtained identity information with the user identity information. Therefore, the business processing logic encapsulated in the service interface 1 can include obtaining the corresponding identity information from a database or obtaining the corresponding identity information from a blockchain.

[0041] In a specific implementation, the service request carries an interface identifier of the target service interface, and the computer device can determine the target service interface that matches the interface identifier from one or more service interfaces corresponding to the target application service. Alternatively, the service request is used to request service data of the target application service, and the computer device can determine the target service interface from one or more service interfaces corresponding to the target application service according to the service type of the service data to be requested by the service request.

[0042] In one embodiment, when the number of service interfaces is one, the computer device may directly use the service interface as the target service interface corresponding to the target application service. In another embodiment, when the number of service interfaces is multiple, the computer device may determine the target service interface corresponding to the target application service from multiple service interfaces according to the interface identifier of the target service interface carried in the service request.

[0043] S203: Execute the target business logic encapsulated by the target service interface to obtain first data.

[0044] In one embodiment, the target service interface is determined from multiple service interfaces, and the computer device can obtain one or more reference business logics encapsulated by the target service interface, and determine the storage location of the service data requested by the service request, and then determine the target business logic of the target service interface from the one or more reference business logics according to the storage location. The computer device executes the target business logic encapsulated in the target service interface to obtain the first data from the storage location. The first data can be understood as the data normally requested by the service request.

[0045] In one embodiment, when the number of service interfaces is one, the computer device can directly use the service interface as the target service interface corresponding to the target application service. At this time, the target service interface can include multiple business logics, each business logic corresponds to a service type, and the computer device can determine the target business logic from the multiple business logics according to the service type indicated by the service request.

[0046] In one embodiment, the target service interface is also encapsulated with security verification logic, and the computer device can execute the security verification logic to verify the legitimacy of the service request, and after the legitimacy verification is passed, obtain one or more reference business logics encapsulated by the target interface. Among them, the legitimacy verification here refers to determining whether the service data indicated by the service request is executed by the target service interface; or, the legitimacy verification here can also refer to whether the service data requested by the service request is legal. Then the computer device determines the storage location of the service data requested by the service request, and then determines the target business logic of the target service interface from one or more reference business logics based on the storage location, executes the target business logic of the target service interface, and obtains the first data. Optionally, according to the service type corresponding to the service request, from one or more reference business logics, for example, the service request is a data query, and the service type corresponding to the service request is a data query type, according to the data query type, the target business logic for implementing the data query can be determined from one or more reference business logics.

[0047] In one embodiment, in order to quickly obtain the interface status of the target service interface, the computer device can generate a corresponding proxy interface for the target service interface, and the proxy interface can quickly read the interface status of the target service interface. In a specific implementation, when the target application is started, the computer device obtains the proxy annotation information in the code file to which the target application belongs, and the proxy annotation information is used to indicate the location of the proxy interface information corresponding to the target service interface in the code file; then based on the proxy annotation information, the proxy interface information corresponding to the target service interface is obtained from the code file, and a proxy interface is generated for the target service interface based on the proxy interface information. Among them, the computer device can obtain the code file to which the target application belongs from the local storage space or the blockchain, and obtain the proxy annotation information from the code file to which the target application belongs, and the proxy annotation information may include an annotation identifier; then the computer device can determine the location of the proxy interface information in the code file according to the proxy annotation information, and after determining the location, extract the proxy interface information corresponding to the target service interface. Then a dynamic proxy mechanism can be used to generate a proxy interface for the target service interface based on the proxy interface information.

[0048] In one embodiment, the specific implementation method of generating a proxy interface for a target service interface based on the proxy interface information can be: the computer device can obtain the target class where the target service interface is located; based on the proxy interface information, the target class is dynamically generated into a proxy class through a dynamic proxy mechanism, and the proxy class includes a proxy interface. For example, the code file includes a UserService class, and the UserService class includes a getUserInfo interface, and a proxy interface needs to be generated for the getUserInfo interface. Specifically, the computer device can obtain the proxy interface information of the UserService class where the getUserInfo interface is located, and then based on the proxy interface information of the UserService class, the UserService class where the getUserInfo interface is located is generated into a UserServiceProxy proxy class through a dynamic proxy mechanism, and the UserServiceProxy proxy class includes a proxy interface of the getUserInfo interface. It should be understood that the proxy interface in the embodiment of the present application can be the same interface as the target service interface. At this time, it can be understood that a new business processing logic is added to the target service interface, so that the target service interface plays the role of a proxy interface. Alternatively, the proxy interface and the target service interface can also be different interfaces. For example, the remaining service interfaces in the target application service except the target service interface are upgraded to proxy interfaces so that the proxy interface monitors the interface status of the target service interface.

[0049] S204. Obtain monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform abnormal detection on the target service interface based on the monitoring data to obtain a detection result. The proxy interface encapsulates the proxy business logic. The monitoring data may include interface error reporting time, number of error reporting times, interface timeout duration, interface abnormality cause, interface abnormality type, etc.

[0050] In a specific implementation, when executing the target business logic, the computer device can obtain monitoring data for the target service interface through the proxy interface. Then, the target service interface is detected for anomalies according to the monitoring data to obtain a detection result. The detection result includes that the target service interface has an anomaly or the detection result includes that the target service interface does not have an anomaly. It should be noted that the detection of anomalies on the target service interface according to the monitoring data can be performed by the proxy interface.

[0051] In one embodiment, the specific implementation method of performing anomaly detection on the target service interface based on monitoring data and obtaining the detection result may be: the computer device obtains a monitoring configuration file from the code file to which the target application belongs, and the monitoring configuration file includes the monitoring interface to be monitored and the target abnormality type of the monitoring interface; the computer device may determine whether the target service interface is the monitoring interface. If it is determined that the target service interface is the monitoring interface, the abnormality type of the target service interface is determined based on the monitoring data, and it is determined whether the abnormality type of the target service interface is the target abnormality type. If it is determined that the abnormality type of the target service interface is the target abnormality type, it is determined that there is an abnormality in the target service interface. If it is determined that the abnormality type of the target service interface is not the target abnormality type, it is determined that there is no abnormality in the target service interface. Among them, the target abnormality type may be an interface timeout, a network abnormality, an interface data parsing abnormality, etc. Optionally, the target abnormality type may be a network abnormality, an interface data parsing abnormality, etc.

[0052] In one embodiment, if the abnormal type of the target service interface is the target abnormal type, the specific implementation method of determining that the target service interface has an abnormality can be: if the abnormal type of the target service interface is the target abnormal type, then the number of error reports for the abnormal type of the target service interface within a preset time period is counted from the monitoring data; and it is determined whether the number of error reports is greater than or equal to the error threshold. If the number of error reports is greater than or equal to the error threshold, it is determined that the target service interface has an abnormality. Among them, the error threshold can be set according to demand, for example, the error threshold is 10 times. As a specific implementation method, the monitoring data can include the error time of the abnormal type of the target service interface, and the computer device can be counted from the first error time that occurs. When the time period between the latest error time and the first error time is exactly the preset time period, the computer device can determine the number of errors in the preset time period, and determine whether the number of errors is greater than or equal to the error threshold. If the number of errors is greater than or equal to the error threshold, it is determined that the target service interface has an abnormality. If the number of errors is less than the error threshold, it is determined that the target service interface does not have an abnormality. As another specific implementation method, the computer device can start counting from the first error occurrence. When the counted number of errors reaches an error threshold, the error time of the first error is calculated and the difference is calculated from the error time when the error threshold is reached to obtain the difference; then a determination is made as to whether the difference is greater than a preset time period; if it is determined that the difference is greater than or equal to the preset time period, it is determined that an abnormality exists in the target service interface; if it is determined that the difference is less than the preset time period, it is determined that no abnormality exists in the target service interface.

[0053] For example, the preset time period is 1 minute, the error threshold is 10 times, and the target anomaly type is anomaly type 1; the monitoring data includes: under anomaly type 1: error 1, 2021-11-05 10:38:10:212, error 2, 2021-11-05 10:38:11:212; error 3, 2021-11-05 10:38:13:212; error 4, 2021-11-05 10:38:15:212; error 5, 2021-11-05 10:38:17:212: error 6, 2021-11-05 10:38:22:212; error 7, 2021-11-05 10:38:30:212; error 8, 2021-11-05 10:38:40:212; Error 9, 2021-11-05 10:38:43:212; Error 10, 2021-11-05 10:38:48:212; When the 10th error is reported, the computer device calculates the difference between the 10th error time and the first error time. The computer device determines that the difference is greater than or equal to 1 minute, and determines that there is an abnormality in the target service interface.

[0054] In one embodiment, when errors of the target exception type continue to exist in the monitoring data, the computer device can re-consider the second error time as the new first error time, and then calculate the difference in the above manner, and determine whether the difference is greater than the preset time period to determine whether there is an abnormality in the target service interface.

[0055] In one embodiment, the computer device can set the monitoring interface to be monitored and the target exception type of the monitoring interface according to the demand. Specifically, the computer device can determine the service type of each service interface in one or more service interfaces; and determine the monitoring interface to be monitored and the target exception type of the monitoring interface from one or more service interfaces based on the service type of each service interface. For example, if you want to monitor the service interface of the data query type, you can select the service interface corresponding to the service type that matches the data query type from one or more service interfaces as the monitoring interface. Then the computer device can set the target exception type of monitoring for the monitoring interface to be a network exception. In another embodiment, the computer device can randomly select the monitoring interface to be monitored and the target exception type of the monitoring interface from one or more service interfaces; then the computer device can generate a monitoring configuration file according to the monitoring interface to be monitored and the target exception type of the monitoring interface.

[0056] In one embodiment, the monitoring interface to be monitored and the target abnormality type of the monitoring interface can be changed periodically. The computer device can obtain the first time of setting the monitoring interface to be monitored, and then count the duration from the first time. If the duration is greater than or equal to the duration threshold, the computer device can re-determine the monitoring interface to be monitored from multiple service interfaces and determine the target abnormality type of the monitoring interface. Then, a monitoring configuration file can be generated based on the periodically changed monitoring interface and the target abnormality type of the monitoring interface.

[0057] Optionally, fallback data can be set to prevent the interface from being unable to provide services to users due to abnormalities. The computer device can obtain second data associated with the target application service, and the second data is preset service data. The preset service data includes at least one of the following: interface data for constructing the target application service, service jump link, service data requested by the application service request, and service data requested by the historical application service request. The service of the target application service can be obtained through the service jump link. A monitoring configuration file is then generated based on the second data, the monitoring interface that needs to be monitored, and the target abnormality type of the monitoring interface. The interface data may include but is not limited to the basic text, pictures, and components of the interface; the service data related to the target application service can be obtained through the service jump link. The preset service data can set the corresponding service data according to demand.

[0058] Optionally, after obtaining the monitoring configuration file, the monitoring configuration file may be packaged into a jar (computer file format) file, and the jar file is added to the code file to which the target application belongs.

[0059] It should be noted that in the embodiment of the present application, whether the target service interface is abnormal based on monitoring data can be determined by the proxy interface, so that any service interface can be detected for anomalies by its own proxy interface, thereby improving the efficiency of anomaly detection.

[0060] S205: If the detection result indicates that the target service interface is abnormal, return second data as service data through the proxy interface, where the second data is preset service data.

[0061] In a specific implementation, if the detection result indicates that there is an abnormality in the target service interface, the computer device can obtain the second data from the preset storage space or blockchain through the proxy interface, and return the second data as service data through the proxy interface.

[0062] In one embodiment, as can be seen from the foregoing, the monitoring configuration file includes second data; if the detection result indicates that the target service interface is abnormal, the computer device can obtain the second data from the monitoring configuration file through the proxy interface, and return the second data as service data through the proxy interface.

[0063] S206: If the detection result indicates that there is no abnormality in the target service interface, return the first data as service data through the proxy interface.

[0064] In a specific implementation, if the detection result indicates that there is no abnormality in the target service interface, the computer device obtains the first data from the target service interface through the proxy interface, and returns the first data as service data through the proxy interface.

[0065] In one embodiment, the computer device may use the private key of the target service interface to digitally sign the first data or the second data; and then send the first data with the digital signature or the second data with the digital signature to the blockchain node. Specifically, the blockchain node may verify the legitimacy of the first data with the digital signature or the second data with the digital signature, and after the legitimacy verification is passed, generate a block based on the first data with the digital signature or the second data with the digital signature, and send the block to other nodes for consensus, and after the consensus is passed, save it in the blockchain.

[0066] In an embodiment of the present application, a service request for a target application service is received, where the target application service is any one of a plurality of application services included in a target application, and the service request is used to request service data of the target application service; a target service interface corresponding to the target application service is determined from one or more service interfaces based on the service request; a target business logic encapsulated by the target service interface is executed to obtain first data; monitoring data of the target service interface when executing the target business logic is obtained through a proxy interface corresponding to the target service interface, and an abnormality detection is performed on the target service interface based on the monitoring data to obtain a detection result; if the detection result indicates that an abnormality exists in the target service interface, second data is returned as service data through the proxy interface, and the second data is preset service data; if the detection result indicates that there is no abnormality in the target service interface, the first data is returned as service data through the proxy interface, so that effective service can be quickly provided when the service interface is abnormal.

[0067] Based on the description of the above data processing method embodiment, the present application embodiment also discloses a data processing device, which can be a computer program (including program code) running on the above-mentioned computer device. The data processing device can execute Figure 2 See the method shown in Figure 3 , the data processing device can run the following units:

[0068] The receiving unit 301 is used to receive a service request for a target application service, where the target application service is any one of a plurality of application services included in a target application, and the service request is used to request service data of the target application service;

[0069] A processing unit 302 is configured to determine a target service interface corresponding to the target application service from one or more service interfaces based on the service request;

[0070] The processing unit 302 is further configured to execute the target service logic encapsulated by the target service interface to obtain the first data;

[0071] The processing unit 302 is further configured to obtain monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform anomaly detection on the target service interface based on the monitoring data to obtain a detection result;

[0072] The processing unit 302 is further configured to return second data as the service data through the proxy interface if the detection result indicates that the target service interface is abnormal, wherein the second data is preset service data;

[0073] The processing unit 302 is further configured to return the first data as the service data through the proxy interface if the detection result indicates that there is no abnormality in the target service interface.

[0074] In one embodiment, before acquiring the monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, the processing unit 302 is further configured to:

[0075] When the target application is started, obtaining proxy annotation information in a code file to which the target application belongs, the proxy annotation information being used to indicate a position of proxy interface information corresponding to the target service interface in the code file;

[0076] Based on the proxy annotation information, obtaining proxy interface information corresponding to the target service interface from the code file;

[0077] A proxy interface is generated for the target service interface based on the proxy interface information.

[0078] In one embodiment, when the processing unit 302 generates a proxy interface for the target service interface based on the proxy interface information, it can be specifically used to:

[0079] Get the target class where the target service interface is located;

[0080] Based on the proxy interface information, the target class is dynamically generated into a proxy class through a dynamic proxy mechanism, and the proxy class includes a proxy interface.

[0081] In one embodiment, when the processing unit 302 performs anomaly detection on the target service interface based on the monitoring data and obtains the detection result, it can be specifically used to:

[0082] Acquire a monitoring configuration file from a code file to which the target application belongs, wherein the monitoring configuration file includes a monitoring interface to be monitored and a target exception type of the monitoring interface;

[0083] Determining whether the target service interface is a monitoring interface, and if the target service interface is the monitoring interface, determining the abnormal type of the target service interface based on the monitoring data;

[0084] If the exception type of the target service interface is the target exception type, determining that an exception exists in the target service interface;

[0085] If the exception type of the target service interface is not the target exception type, it is determined that there is no exception in the target service interface.

[0086] In one embodiment, when the processing unit 302 determines that the target service interface has an exception if the exception type of the target service interface is the target exception type, it can be specifically used to:

[0087] If the exception type of the target service interface is the target exception type, the number of error reports corresponding to the target exception type within a preset time period from the monitoring data;

[0088] If the number of error reports is greater than or equal to the error report threshold, it is determined that an abnormality exists in the target service interface;

[0089] In one embodiment, the processing unit 302 is further configured to:

[0090] Determining a service type of each service interface of the one or more service interfaces;

[0091] Determining a monitoring interface to be monitored and a target abnormality type of the monitoring interface from the one or more service interfaces based on the service type of each service interface;

[0092] Generate a monitoring configuration file according to the monitoring interface to be monitored and the target abnormality type of the monitoring interface;

[0093] The monitoring configuration file is packaged into a jar file, and the jar file is added to the code file to which the target application belongs.

[0094] In one embodiment, the target service interface encapsulates security verification logic; when the processing unit 302 executes the target service logic encapsulated by the target service interface to obtain the first data, it can be specifically used to:

[0095] Execute the security verification logic to verify the legitimacy of the service request, and after the legitimacy verification passes, obtain one or more reference business logics encapsulated by the target service interface;

[0096] Determining a storage location of service data requested by the service request;

[0097] Determining, according to the storage location, a target business logic of the target service interface from one or more reference business logics;

[0098] Execute the target business logic of the target service interface to obtain first data.

[0099] It can be understood that the functional units of the data processing device of this embodiment can be based on the above method embodiment. Figure 2 The specific implementation process of the method in the embodiment can refer to the above method embodiment Figure 2 The relevant description will not be repeated here.

[0100] For further information, see Figure 4 , Figure 4 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 2 The computer device in the corresponding embodiment may be Figure 4 Computer equipment as shown. Figure 4 As shown, the computer device may include: a processor 401 and a memory 404. Optionally, the computer device may also include an input device 402 and an output device 403. The processor 401, the input device 402, the output device 403 and the memory 404 are connected via a bus 405. The memory 404 is used to store a computer program, the computer program includes program instructions, and the processor 401 is used to execute the program instructions stored in the memory 404.

[0101] In the embodiment of the present application, the processor 401 performs the following operations by running the executable program code in the memory 404:

[0102] receiving a service request for a target application service, the target application service being any one of a plurality of application services included in a target application, the service request being used to request service data of the target application service;

[0103] Determining a target service interface corresponding to the target application service from one or more service interfaces based on the service request;

[0104] Execute the target business logic encapsulated by the target service interface to obtain first data;

[0105] Acquire monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform abnormality detection on the target service interface based on the monitoring data to obtain a detection result;

[0106] If the detection result indicates that the target service interface is abnormal, returning second data as the service data through the proxy interface, where the second data is preset service data;

[0107] If the detection result indicates that there is no abnormality in the target service interface, the first data is returned as the service data through the proxy interface.

[0108] In one embodiment, before acquiring the monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, the processor 401 is further configured to:

[0109] When the target application is started, obtaining proxy annotation information in a code file to which the target application belongs, the proxy annotation information being used to indicate a position of proxy interface information corresponding to the target service interface in the code file;

[0110] Based on the proxy annotation information, obtaining proxy interface information corresponding to the target service interface from the code file;

[0111] A proxy interface is generated for the target service interface based on the proxy interface information.

[0112] In one embodiment, when the processor 401 generates a proxy interface for the target service interface based on the proxy interface information, it may be specifically configured to:

[0113] Get the target class where the target service interface is located;

[0114] Based on the proxy interface information, the target class is dynamically generated into a proxy class through a dynamic proxy mechanism, and the proxy class includes a proxy interface.

[0115] In one embodiment, when the processor 401 performs anomaly detection on the target service interface based on the monitoring data and obtains a detection result, it can be specifically used to:

[0116] Acquire a monitoring configuration file from a code file to which the target application belongs, wherein the monitoring configuration file includes a monitoring interface to be monitored and a target exception type of the monitoring interface;

[0117] Determining whether the target service interface is a monitoring interface, and if the target service interface is the monitoring interface, determining the abnormal type of the target service interface based on the monitoring data;

[0118] If the exception type of the target service interface is the target exception type, determining that an exception exists in the target service interface;

[0119] If the exception type of the target service interface is not the target exception type, it is determined that there is no exception in the target service interface.

[0120] In one embodiment, when the processor 401 determines that the target service interface has an exception if the exception type of the target service interface is the target exception type, it may be specifically configured to:

[0121] If the exception type of the target service interface is the target exception type, the number of error reports corresponding to the target exception type within a preset time period from the monitoring data;

[0122] If the number of error reports is greater than or equal to the error report threshold, it is determined that an abnormality exists in the target service interface;

[0123] In one embodiment, the processor 401 is further configured to:

[0124] Determining a service type of each service interface of the one or more service interfaces;

[0125] Determining a monitoring interface to be monitored and a target abnormality type of the monitoring interface from the one or more service interfaces based on the service type of each service interface;

[0126] Generate a monitoring configuration file according to the monitoring interface to be monitored and the target abnormality type of the monitoring interface;

[0127] The monitoring configuration file is packaged into a jar file, and the jar file is added to the code file to which the target application belongs.

[0128] In one embodiment, the target service interface encapsulates security verification logic; when the processor 401 executes the target service logic encapsulated by the target service interface and obtains the first data, it can be specifically used to:

[0129] Execute the security verification logic to verify the legitimacy of the service request, and after the legitimacy verification passes, obtain one or more reference business logics encapsulated by the target service interface;

[0130] Determining a storage location of service data requested by the service request;

[0131] Determining, according to the storage location, a target business logic of the target service interface from one or more reference business logics;

[0132] Execute the target business logic of the target service interface to obtain first data.

[0133] It should be understood that in the embodiment of the present application, the processor 401 may be a central processing unit (CPU), and the processor 401 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0134] The memory 404 may include a read-only memory and a random access memory, and provides instructions and data to the processor 401. A portion of the memory 404 may also include a nonvolatile random access memory.

[0135] The input device 402 may include a keyboard, etc., and input a service request to the processor 401; the output device 403 may include a display, etc.

[0136] In a specific implementation, the processor 401, input device 402, output device 403 and memory 404 described in the embodiments of the present application can execute the implementation methods described in all the above embodiments, and can also execute the implementation methods described in the above apparatus, which will not be repeated here.

[0137] In an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the steps performed in all the above embodiments can be executed.

[0138] An embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the methods in all the above embodiments are executed.

[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. It should be emphasized that in order to further ensure the privacy and security of the above-mentioned data, the service data involved can be stored in any node of the blockchain. Among them, the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0140] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present application are still within the scope of the invention.

Claims

1. A data processing method, characterized in that: include: receiving a service request for a target application service, the target application service being any one of a plurality of application services included in a target application, the service request being used to request service data of the target application service; Determining a target service interface corresponding to the target application service from one or more service interfaces based on the service request; Execute the target business logic encapsulated by the target service interface to obtain first data; Acquire monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform abnormality detection on the target service interface based on the monitoring data to obtain a detection result; If the detection result indicates that the target service interface is abnormal, returning second data as the service data through the proxy interface, where the second data is preset service data; If the detection result indicates that there is no abnormality in the target service interface, returning the first data as the service data through the proxy interface; Wherein, before acquiring the monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, the method further includes: When the target application is started, obtaining proxy annotation information in a code file to which the target application belongs, the proxy annotation information being used to indicate a position of proxy interface information corresponding to the target service interface in the code file; Based on the proxy annotation information, obtaining proxy interface information corresponding to the target service interface from the code file; generating a proxy interface for the target service interface based on the proxy interface information; The step of generating a proxy interface for the target service interface based on the proxy interface information includes: Get the target class where the target service interface is located; Based on the proxy interface information, dynamically generating a proxy class from the target class through a dynamic proxy mechanism, wherein the proxy class includes a proxy interface; The performing anomaly detection on the target service interface based on the monitoring data to obtain a detection result includes: Acquire a monitoring configuration file from a code file to which the target application belongs, wherein the monitoring configuration file includes a monitoring interface to be monitored and a target exception type of the monitoring interface; Determining whether the target service interface is a monitoring interface, and if the target service interface is the monitoring interface, determining the abnormal type of the target service interface based on the monitoring data; If the exception type of the target service interface is the target exception type, determining that an exception exists in the target service interface; If the exception type of the target service interface is not the target exception type, it is determined that there is no exception in the target service interface.

2. The method according to claim 1, characterized in that If the exception type of the target service interface is the target exception type, determining that the target service interface has an exception includes: If the exception type of the target service interface is the target exception type, the number of error reports corresponding to the target exception type within a preset time period from the monitoring data; If the number of error reports is greater than or equal to the error report threshold, it is determined that an abnormality exists in the target service interface.

3. The method according to claim 1, characterized in that The method further comprises: Determining a service type of each service interface of the one or more service interfaces; Determining a monitoring interface to be monitored and a target abnormality type of the monitoring interface from the one or more service interfaces based on the service type of each service interface; Generate a monitoring configuration file according to the monitoring interface to be monitored and the target abnormality type of the monitoring interface; The monitoring configuration file is packaged into a jar file, and the jar file is added to the code file to which the target application belongs.

4. The method according to any one of claims 1 to 3, characterized in that: The target service interface encapsulates security verification logic; The executing the target business logic encapsulated by the target service interface to obtain the first data includes: Execute the security verification logic to verify the legitimacy of the service request, and after the legitimacy verification passes, obtain one or more reference business logics encapsulated by the target service interface; Determining a storage location of service data requested by the service request; Determining, according to the storage location, a target business logic of the target service interface from one or more reference business logics; Execute the target business logic of the target service interface to obtain first data.

5. A data processing device, characterized in that: include: A receiving unit, configured to receive a service request for a target application service, wherein the target application service is any one of a plurality of application services included in a target application, and the service request is used to request service data of the target application service; A processing unit, configured to determine a target service interface corresponding to the target application service from one or more service interfaces based on the service request; The processing unit is further configured to execute the target business logic encapsulated by the target service interface to obtain the first data; The processing unit is further configured to obtain monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, and perform anomaly detection on the target service interface based on the monitoring data to obtain a detection result; The processing unit is further configured to return second data as the service data through the proxy interface if the detection result indicates that the target service interface is abnormal, wherein the second data is preset service data; The processing unit is further configured to return the first data as the service data through the proxy interface if the detection result indicates that there is no abnormality in the target service interface; Wherein, before the processing unit acquires the monitoring data of the target service interface when executing the target business logic through the proxy interface corresponding to the target service interface, it is further used to: When the target application is started, obtaining proxy annotation information in a code file to which the target application belongs, the proxy annotation information being used to indicate a position of proxy interface information corresponding to the target service interface in the code file; Based on the proxy annotation information, obtaining proxy interface information corresponding to the target service interface from the code file; generating a proxy interface for the target service interface based on the proxy interface information; Wherein, when the processing unit generates a proxy interface for the target service interface based on the proxy interface information, it is specifically used to: Get the target class where the target service interface is located; Based on the proxy interface information, dynamically generating a proxy class from the target class through a dynamic proxy mechanism, wherein the proxy class includes a proxy interface; Wherein, when the processing unit performs anomaly detection on the target service interface based on the monitoring data and obtains the detection result, it is specifically used to: Acquire a monitoring configuration file from a code file to which the target application belongs, wherein the monitoring configuration file includes a monitoring interface to be monitored and a target exception type of the monitoring interface; Determining whether the target service interface is a monitoring interface, and if the target service interface is the monitoring interface, determining the abnormal type of the target service interface based on the monitoring data; If the exception type of the target service interface is the target exception type, determining that an exception exists in the target service interface; If the exception type of the target service interface is not the target exception type, it is determined that there is no exception in the target service interface.

6. A computer device, characterized in that: include: Memory for storing computer programs; A processor, calling the computer program in the memory, to execute the data processing method according to any one of claims 1 to 4.

7. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the data processing method according to any one of claims 1 to 4 is executed.