CN114185743A - Data processing method and device, computer equipment and storage medium - Google Patents
Data processing method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN114185743A CN114185743A CN202111524244.6A CN202111524244A CN114185743A CN 114185743 A CN114185743 A CN 114185743A CN 202111524244 A CN202111524244 A CN 202111524244A CN 114185743 A CN114185743 A CN 114185743A
- Authority
- CN
- China
- Prior art keywords
- interface
- service
- target
- data
- target service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3017—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is implementing multitasking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/0715—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a system implementing multitasking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/079—Root cause analysis, i.e. error or fault diagnosis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3089—Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
- G06F9/4856—Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
- G06F9/4862—Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration the task being a mobile agent, i.e. specifically designed to migrate
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Debugging And Monitoring (AREA)
Abstract
An embodiment of the application provides a data processing method, a data processing device, computer equipment and a storage medium, and the data processing method comprises the following steps: 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 target service logic packaged by a target service interface to obtain first data; acquiring monitoring data of a target service interface through an agent interface corresponding to the target service interface, and performing anomaly 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 serving as service data through the proxy interface; if the detection result indicates that the target service interface is not abnormal, the first data is returned through the proxy interface to serve as service data, and effective service can be rapidly provided. The application relates to a blockchain technology, such as second data can be written into a blockchain, so as to be used for acquiring scenes such as the second data through a proxy interface.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, a computer device, and a storage medium.
Background
At present, with the development of computer technology, micro-services are an emerging software architecture, that is, a large-scale single application program is divided into dozens of micro-services, each micro-service can provide one service of the application program, and the strategy of the micro-services can make the work more convenient. However, currently, when a user requests a micro service of an application, an abnormality occurs in an interface of the micro service, so that the micro service cannot provide a corresponding service function.
Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device, computer equipment and a storage medium, which can quickly provide effective service when a service interface is abnormal.
A first aspect of an embodiment of the present application provides a data processing method, including:
receiving a service request aiming at 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 for requesting 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;
executing the target service logic encapsulated by the target service interface to obtain first data;
acquiring monitoring data of the target service interface when the target service logic is executed through an agent interface corresponding to the target service interface, and performing anomaly 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 serving as the service data through the proxy interface, wherein the second data is preset service data;
and if the detection result indicates that the target service interface is not abnormal, returning the first data as the service data through the proxy interface.
A second aspect of the embodiments of the present application provides a data processing apparatus, including:
a receiving unit, configured 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;
the processing unit is used for determining 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 a target service logic encapsulated by the target service interface to obtain first data;
the processing unit is further configured to acquire, through an agent interface corresponding to the target service interface, monitoring data of the target service interface when the target service logic is executed, 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, where 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 the target service interface is not abnormal.
In one aspect, the present invention provides a computer device, including a processor and a memory, where the processor and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the data processing method described above.
An aspect of the embodiments of the present application provides a computer-readable storage medium, in which program instructions are stored, and when the program instructions are executed, the computer-readable storage medium is used for implementing the data processing method described above.
An aspect of the embodiments of the present application provides a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium, and when the computer instructions are executed by a processor of a computer device, the computer instructions perform the data processing method described above.
In the embodiment of the application, a service request for a target application service is received, 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 for requesting 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; executing target service logic packaged by a target service interface to obtain first data; acquiring monitoring data of a target service interface when target service logic is executed through an agent interface corresponding to the target service interface, and performing anomaly 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 serving as service data through the proxy interface, wherein the second data is preset service data; and if the detection result indicates that the target service interface is not abnormal, returning the first data as service data through the proxy interface. The monitoring data can be rapidly acquired through the agent interface, whether the service interface is abnormal or not can be rapidly detected based on the monitoring data, the monitoring data does not need to be sent to the control platform, and the monitoring data is analyzed by the platform. Further, when there is an abnormality, preset service data may be returned through the proxy interface to ensure that the target application service can normally provide a service. And the target service interface can be prevented from being directly exposed through the proxy interface, and the safety of the target service interface is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a block diagram of a data processing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application can acquire and process the service data and the like based on the artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The embodiment of the 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 a certain application, the application may be triggered, and after entering the application, a certain application service of a plurality of application services included in the application is selected, and accordingly, when a service request for a target application service is received, a target service interface corresponding to the target application service may be determined from one or more service interfaces based on the service request. One or more service logics are packaged in the target service interface, the target service logic can be determined from the one or more service logics according to the service request, the target service logic is executed to obtain first data, the interface condition of the target service interface when the target service logic is executed is monitored through a proxy interface corresponding to the target service interface, whether the target service interface is abnormal or not can be determined according to the interface condition, if the target service interface is abnormal, second data are returned through the proxy interface, and the second data are preset service data; and if the detection result indicates that the target service interface is not abnormal, acquiring first data from the target service interface through the proxy interface, and returning the first data through the proxy interface.
Through the data processing scheme, the following beneficial effects can be achieved: the interface condition of the target service interface can be quickly obtained through the proxy interface, so that whether the target service interface is abnormal or not can be quickly judged according to the interface condition, and when the target service interface is abnormal, preset service data are returned through the proxy interface; and when the target service interface has no abnormity, returning the first data through the proxy interface. That is to say, whether the target service interface is abnormal or not, the target application service can be effectively ensured to provide the service normally. And the target service interface can be prevented from being directly exposed through the proxy interface, and the safety of the target service interface is effectively improved.
Based on the above data processing scheme, an embodiment of the present application provides a data processing system, please refer to fig. 1, which 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 an instant messaging application, a video application, etc. Alternatively, the terminal device 101 may display an interface of an application service included in each application, and the user may perform a corresponding operation in the interface of the application service. The server 102 may store one or more business logic encapsulated in each service interface, service data associated with each application service, and the like. The terminal device 101 and the server 102 may be directly or indirectly connected through wired or wireless communication, and the present application is not limited thereto. The terminal device 101 may be an intelligent device such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), and a wearable device. The server 102 includes a plurality of servers (also referred to as nodes), which may be independent physical servers, and may also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, web services, cloud communications, middleware services, domain name services, security services, Content Delivery Networks (CDNs), and big data and artificial intelligence platforms.
In a specific implementation, after receiving a service request for a target application, the terminal device 101 may determine, based on the service request, a target service interface corresponding to a target application service from one or more service interfaces stored in the server 102, and execute a target service logic encapsulated by the target service interface to obtain first data; and acquiring monitoring data of the target service interface when the target service logic is executed through the agent interface corresponding to the target service interface, and performing anomaly 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, 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, wherein the second data is preset service data; and if the detection result indicates that the target service interface is not abnormal, returning the first data as service data through the proxy interface.
Based on the data processing scheme provided above, an embodiment of the present application provides a data processing method, please refer to fig. 2, which may be executed by a computer device, where the computer device may be the terminal device 101 or the server 102 of the data processing system; alternatively, the data processing method may be executed by a target application in a computer device. The data processing method may include the following steps S201 to S206:
s201, receiving a service request aiming at a target application service, wherein the target application service is any one of a plurality of application services included in the target application, and the service request is used for requesting service data of the target application service.
The target application can be any one of a plurality of applications included in the computer device, each application can provide different application services for the user, and each application service is coordinated and matched with each other to provide final value for the user. Each application service runs in an independent process, and the application services are communicated with each other by adopting a lightweight communication mechanism. It should be noted that each application includes an application service, which may be referred to as a microservice. The target application may be an instant messaging application, a video application, a gaming application, a payment application, and the like. Application services differ for different applications. For example, the target application is a payment application, and the application service may be an order service, a data query service, and the like, and for example, the target application is an instant messaging application, and the application service may include a data query service, an information transmission service, and the like. The service request may carry an interface identifier of the target service interface. The service data may be query data, validation data, interface data, and the like.
In one embodiment, when a user wants to obtain an application service of a certain application, the user may first enter a target application by clicking, double-clicking, and the like, and the computer device may detect a click or double-clicking operation for the target application and display a main interface where the target application is located, where the main interface includes a plurality of application services. Then, the user can select a target application service from the plurality of application services, and the computer device can receive a service request sent by the user and aiming at the target application service, wherein the service request carries the service interface identifier.
In one embodiment, the service request may also be sent by an application service other than the target application service. It can be understood that: data interaction exists between the two target application services, and at the moment, the data interaction exists between the two target application services by utilizing the service level protocol. For example, the application service 1 is to acquire data to be verified, and the application service 2 is to verify the data acquired by the application service 1, and at this time, the application service 2 needs to acquire the data to be verified from the application service 1.
S202, determining a target service interface corresponding to the target application service from one or more service interfaces based on the service request.
The target application service may correspond to one or more service interfaces, and each service interface may implement a part of the service of the target application service. For example, the target application service is an order query service, the order query service may correspond to 2 service interfaces, the service interface 1 may execute an authentication service in the target application service, and the service interface 2 may execute an identity-based query order service in the target application service. Optionally, each service interface may also be encapsulated with one or more business processing logic. For example, when the service interface 1 performs the authentication service, it may obtain corresponding identity information from a database or a blockchain, and then verify the obtained identity information with the user identity information, so that the service processing logic encapsulated in the service interface 1 may include obtaining the corresponding identity information from the database or obtaining the corresponding identity information from the blockchain.
In a specific implementation, the service request carries an interface identifier of the target service interface, and the computer device may determine, from one or more service interfaces corresponding to the target application service, a target service interface matching the interface identifier. Alternatively, the service request is used to request service data of a target application service, and the computer device may determine a target service interface from one or more service interfaces corresponding to the target application service according to a service type of the service data to be requested by the service request.
In one embodiment, when the number of the service interfaces is one, the computer device may directly use the service interface as a target service interface corresponding to the target application service. In another embodiment, when the number of the service interfaces is multiple, the computer device may determine, from the multiple service interfaces, a target service interface corresponding to the target application service according to an interface identifier of the target service interface carried in the service request.
S203, executing the target service logic packaged by the target service interface to obtain first data.
In one embodiment, the target service interface is determined from a plurality of service interfaces, and the computer device may obtain one or more reference business logics encapsulated by the target service interface, determine a storage location of 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 data normally requested by the service request.
In one embodiment, when the number of the service interfaces is one, the computer device may directly use the service interface as a target service interface corresponding to the target application service, in this case, the target service interface may include a plurality of service logics, each service logic corresponds to one service type, and the computer device may determine the target service logic from the plurality of service logics according to the service type indicated by the service request.
In one embodiment, the target service interface further encapsulates security verification logic, and the computer device may execute the security verification logic to perform validity verification on the service request, and obtain one or more reference business logic encapsulated by the target interface after the validity verification is passed. Here, the validity verification here refers to determining whether the service data indicated by the service request is executed by the target service interface; alternatively, the validity verification here may also refer to whether the service data requested by the service request is valid. The computer device then determines a storage location of service data requested by the service request, then determines a target service logic of the target service interface from the one or more reference service logics according to the storage location, and executes the target service logic of the target service interface to obtain the first data. Optionally, the service request is a data query, the service type corresponding to the service request is a data query, and a target service logic for implementing the data query may be determined from the one or more reference service logics according to the data query type.
In one embodiment, in order to quickly obtain the interface state of the target service interface, the computer device may generate a corresponding proxy interface for the target service interface, and the proxy interface may quickly read the interface state of the target service interface. In a specific implementation, when a target application is started, the computer equipment acquires agent annotation information in a code file to which the target application belongs, wherein the agent annotation information is used for indicating the position of agent interface information corresponding to a target service interface in the code file; and then acquiring agent interface information corresponding to the target service interface from the code file based on the agent annotation information, and generating an agent interface for the target service interface based on the agent interface information. The computer equipment can acquire a code file to which the target application belongs from a local storage space or a block chain, and acquire proxy annotation information from the code file to which the target application belongs, wherein the proxy annotation information can include annotation identification; then the computer device can determine the position of the proxy interface information in the code file according to the proxy annotation information, and extract the proxy interface information corresponding to the target service interface after determining the position. A dynamic proxy mechanism may then be employed to generate a proxy interface for the target service interface based on the proxy interface information.
In one embodiment, a specific implementation manner of generating the proxy interface for the target service interface based on the proxy interface information may be: the computer equipment can obtain a target class where a target service interface is located; and dynamically generating the proxy class from the target class through a dynamic proxy mechanism based on the proxy interface information, wherein the proxy class comprises the proxy interface. For example, the UserService class included in the code file includes a getUserInfo interface, and a proxy interface needs to be generated for the getUserInfo interface. Specifically, the computer device may obtain proxy interface information of a UserService class where the getUserInfo interface is located, and then generate a UserServiceProxy class from the UserService class where the getUserInfo interface is located through a dynamic proxy mechanism based on the proxy interface information of the UserService class, where the UserServiceProxy class includes a proxy interface of the getUserInfo interface. It should be understood that, the proxy interface in the embodiment of the present application may be the same interface as the target service interface, and at this time, it may be understood that a new business processing logic is added to the target service interface, so that the target service interface plays a role as the proxy interface. Alternatively, the proxy interface and the target service interface may be different interfaces. For example, the rest service interfaces except the target service interface in the target application service are upgraded to the proxy interface, so that the proxy interface monitors the interface state of the target service interface.
S204, acquiring monitoring data of the target service interface when the target service logic is executed through the agent interface corresponding to the target service interface, and performing anomaly detection on the target service interface based on the monitoring data to obtain a detection result. Wherein, the proxy interface is packaged with proxy service logic. The monitoring data may include interface error reporting time, error reporting times, interface timeout duration, interface exception cause, interface exception type, and the like.
In a specific implementation, the computer device may obtain monitoring data for the target service interface through the proxy interface when executing the target business logic. And then carrying out anomaly detection on the target service interface according to the monitoring data to obtain a detection result. Wherein, the detection result includes that the target service interface is abnormal or the detection result includes that the target service interface is not abnormal. It should be noted that, the anomaly detection of the target service interface according to the monitoring data may be performed by the proxy interface.
In an embodiment, the anomaly detection is performed on the target service interface based on the monitoring data, and the specific implementation manner of obtaining the detection result may be: the method comprises the steps that computer equipment obtains a monitoring configuration file from a code file to which a target application belongs, wherein the monitoring configuration file comprises a monitoring interface to be monitored and a target abnormal type of the monitoring interface; the computer device may determine whether the target service interface is the monitoring interface, determine, if the target service interface is determined to be the monitoring interface, an exception type of the target service interface based on the monitoring data, determine whether the exception type of the target service interface is the target exception type, and determine that the target service interface is abnormal if the exception type of the target service interface is determined to be the target exception type. And if the exception type of the target service interface is determined not to be the target exception type, determining that the target service interface has no exception. The target exception type may be an interface timeout, a network exception, an interface data parsing exception, and the like. Alternatively, the target exception type may be a network exception, an interface data parsing exception, or the like.
In an embodiment, if the exception type of the target service interface is the target exception type, the specific implementation manner for determining that the exception exists in the target service interface may be: if the abnormal type of the target service interface is the target abnormal type, counting error reporting times aiming at the abnormal type of the target service interface in a preset time period from the monitoring data; and judging whether the error reporting times are more than or equal to an error reporting threshold, and if the error reporting times are more than or equal to the error reporting threshold, determining that the target service interface is abnormal. The error threshold may be set according to a requirement, for example, the error threshold is 10 times. As a specific implementation manner, the monitoring data may include an error reporting time of an abnormal type of the target service interface, the computer device may perform statistics from a first error reporting time that occurs, when a time period from a latest error reporting time to the first error reporting time is just a preset time period, the computer device may determine the number of error reports in the preset time period, and determine whether the number of error reports is greater than or equal to an error reporting threshold, and if the number of error reports is greater than or equal to the error reporting threshold, determine that the target service interface is abnormal. And if the error reporting times are less than the error reporting threshold, determining that the target service interface is not abnormal. As another specific implementation manner, the computer device may start to count from the occurrence of the first error report, and when the counted error report times reach an error report threshold, calculate the error report time of the first error report and the error report time when the error report threshold is reached to perform difference processing, so as to obtain a difference value; then judging whether the difference value is greater than a preset time period; if the difference is determined to be greater than or equal to the preset time period, determining that the target service interface is abnormal; and if the difference is smaller than the preset time period, determining that the target service interface is not abnormal.
For example, the preset time period is 1 minute, the error reporting threshold is 10 times, and the target exception type is exception type 1; the monitoring data includes: exception type 1 is: error reporting 1, 2021-11-0510: 38:10:212, error reporting 2, 2021-11-0510: 38:11: 212; error reporting 3, 2021-11-0510: 38:13: 212; error reporting 4, 2021-11-0510: 38:15: 212; error report 5, 2021-11-0510: 38:17: 212: error reporting 6, 2021-11-0510: 38:22: 212; error reporting 7, 2021-11-0510: 38:30: 212; error 8, 2021-11-0510: 38:40: 212; error reporting 9, 2021-11-0510: 38:43: 212; error reporting 10, 2021-11-0510: 38:48: 212; when 10 times of error reporting are achieved, the computer equipment calculates the difference value between the 10 th error reporting time and the first error reporting time, and the computer equipment determines that the difference value is more than or equal to 1 minute and determines that the target service interface is abnormal.
In one embodiment, when the error report of the target abnormal type continues to exist in the monitored data, the computer device may regard the second error report time as a new first error report time, and then may calculate the difference value in the above manner, and determine whether the difference value is greater than the preset time period to determine whether the target service interface has an abnormality.
In one embodiment, the computer device may set the monitoring interface to be monitored and the target exception type of the monitoring interface according to the requirement. In particular, the computer device may determine a service type for each of the one or more service interfaces; and determining a monitoring interface to be monitored and a target exception type of the monitoring interface from one or more service interfaces based on the service type of each service interface. For example, a service interface that wants to monitor the data query type may select a service interface corresponding to a service type that matches the data query type from one or more service interfaces as the monitoring interface. The computer device may then set the monitored target anomaly type for the monitor interface as a network anomaly. In another embodiment, a computer device may randomly select a monitoring interface to be monitored and a target anomaly type for the monitoring interface from one or more service interfaces; the computer device may then generate a monitoring profile based on the monitoring interface to be monitored and the target anomaly type for the monitoring interface.
In one embodiment, the monitoring interface that needs to be monitored and the target exception type for that monitoring interface may be changed periodically. The computer device may obtain a first time for setting a monitoring interface to be monitored, count a time duration from the first time, and if the time duration is greater than or equal to a time duration threshold, the computer device may determine the monitoring interface to be monitored again from the plurality of service interfaces and determine a target exception type of the monitoring interface. A monitoring profile may then be generated based on the periodically changing monitoring interface and the target anomaly type for the monitoring interface.
Optionally, the bibliographic data may be set to prevent the interface from being abnormal and unable to provide service for the user. The computer device may obtain second data associated with the target application service, where the second data is preset service data, and the preset service data includes at least one of the following: and constructing interface data of the target application service, service jump links, service data requested by application service requests and service data requested by historical application service requests. And the service of the target application service can be acquired through the service jump link. And then generating a monitoring configuration file according to the second data, the monitoring interface to be monitored and the target abnormal type of the monitoring interface. Interface data may include, but is not limited to, elementary documentation, pictures, components of the interface; service data related to the target application service can be acquired through the service jump link. The preset service data can be set with corresponding service data according to requirements.
Optionally, after the monitoring configuration file is obtained, 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.
It should be noted that, in the embodiment of the present application, it is determined whether the target service interface is abnormal based on the monitoring data, and the proxy interface may determine whether the target service interface is abnormal, so that the proxy interface may perform abnormality detection on any service interface, and the abnormality detection efficiency is improved.
And S205, if the detection result indicates that the target service interface is abnormal, returning second data serving as service data through the proxy interface, wherein the second data is preset service data.
In a specific implementation, if the detection result indicates that the target service interface is abnormal, the computer device may obtain the second data from the preset storage space or the block chain through the proxy interface, and return the second data as the service data through the proxy interface.
In one embodiment, as can be seen from the foregoing, the monitoring profile includes second data; and if the detection result indicates that the target service interface is abnormal, the computer equipment can acquire second data from the monitoring configuration file through the proxy interface and return the second data as service data through the proxy interface.
And S206, if the detection result indicates that the target service interface is not abnormal, returning the first data as service data through the proxy interface.
In a specific implementation, if the detection result indicates that the target service interface is not abnormal, the computer device obtains first data from the target service interface through the proxy interface, and returns the first data as service data through the proxy interface.
In one embodiment, the computer device may digitally sign the first data or the second data with a private key of the target service interface; the first data with the digital signature or the second data with the digital signature is then sent to the blockchain node. Specifically, the block link point may perform validity verification on the first data with the digital signature or the second data with the digital signature, generate a block according to the first data with the digital signature or the second data with the digital signature after the validity verification passes, send the block to other nodes for consensus, and store the block in the block chain after the consensus passes.
In the embodiment of the application, a service request aiming at a target application service is received, wherein the target application service is any one of a plurality of application services included by a target application, and the service request is used for requesting 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; executing target service logic packaged by a target service interface to obtain first data; acquiring monitoring data of a target service interface when target service logic is executed through an agent interface corresponding to the target service interface, and performing anomaly 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 serving as service data through the proxy interface, wherein the second data is preset service data; if the detection result indicates that the target service interface is not abnormal, the first data serving as the service data is returned through the proxy interface, and effective service can be rapidly provided when the service interface is abnormal.
Based on the description of the above data processing method embodiment, the present application embodiment also discloses a data processing apparatus, which may be a computer program (including program code) running in the above mentioned computer device. The data processing apparatus may perform the method shown in fig. 2. Referring to fig. 3, the data processing apparatus may operate as follows:
a receiving unit 301, configured 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;
a processing unit 302, configured to determine, based on the service request, a target service interface corresponding to the target application service from among one or more service interfaces;
the processing unit 302 is further configured to execute a target service logic encapsulated by the target service interface, so as to obtain first data;
the processing unit 302 is further configured to obtain, through an agent interface corresponding to the target service interface, monitoring data of the target service interface when the target service logic is executed, and perform anomaly detection on the target service interface based on the monitoring data to obtain a detection result;
the processing unit 302 is further configured to, if the detection result indicates that the target service interface is abnormal, return second data as the service data through the proxy interface, where the second data is preset service data;
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 the target service interface is not abnormal.
In an embodiment, before the processing unit 302 acquires, through the proxy interface corresponding to the target service interface, monitoring data of the target service interface when the target service logic is executed, the processing unit is further configured to:
when the target application is started, acquiring proxy annotation information in a code file to which the target application belongs, wherein the proxy annotation information is used for indicating the position of proxy interface information corresponding to the target service interface in the code file;
acquiring agent interface information corresponding to the target service interface from the code file based on the agent annotation information;
generating a proxy interface for the target service interface based on the proxy interface information.
In an embodiment, when the processing unit 302 generates a proxy interface for the target service interface based on the proxy interface information, it may specifically be configured to:
acquiring a target class where the target service interface is located;
and dynamically generating an agent class from the target class through a dynamic agent mechanism based on the agent interface information, wherein the agent class comprises an agent interface.
In an embodiment, when the processing unit 302 performs anomaly detection on the target service interface based on the monitoring data to obtain a detection result, it may specifically be configured to:
acquiring a monitoring configuration file from the code file to which the target application belongs, wherein the monitoring configuration file comprises a monitoring interface to be monitored and a target abnormal type of the monitoring interface;
judging whether the target service interface is a monitoring interface or not, 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 the target service interface has exception;
and if the exception type of the target service interface is not the target exception type, determining that the target service interface has no exception.
In an embodiment, if the exception type of the target service interface is the target exception type, the processing unit 302 may specifically be configured to:
if the exception type of the target service interface is the target exception type, reporting error times corresponding to the target exception type in a preset time period from the monitoring data;
if the error reporting times are larger than or equal to an error reporting threshold value, determining that the target service interface is abnormal;
in one embodiment, the processing unit 302 is further configured to:
determining a service type for each of the one or more service interfaces;
determining a monitoring interface needing to be monitored and a target exception type of the monitoring interface from the one or more service interfaces based on the service type of each service interface;
generating a monitoring configuration file according to the monitoring interface to be monitored and the target exception type of the monitoring interface;
and encapsulating the monitoring configuration file into a jar file, and adding the jar file into a code file to which the target application belongs.
In one embodiment, the target service interface is encapsulated with security validation logic; when the processing unit 302 executes the target service logic encapsulated by the target service interface to obtain the first data, it may specifically be configured to:
executing the safety verification logic to carry out validity verification on the service request, and acquiring one or more reference service logics packaged by the target service interface after the validity verification is passed;
determining a storage location of service data requested by the service request;
determining a target business logic of the target service interface from one or more reference business logics according to the storage position;
and executing the target service logic of the target service interface to obtain first data.
It can be understood that each functional unit of the data processing apparatus in this embodiment can be specifically implemented according to the method in the foregoing method embodiment fig. 2, and the specific implementation process thereof can refer to the related description of the foregoing method embodiment fig. 2, which is not described herein again.
Further, please refer to fig. 4, where fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device in the corresponding embodiment of fig. 2 may be the computer device shown in fig. 4. As shown in fig. 4, 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 by a bus 405. The memory 404 is used to store a computer program comprising program instructions and the processor 401 is used to execute the program instructions stored by the memory 404.
In the embodiment of the present application, the processor 401 executes the executable program code in the memory 404 to perform the following operations:
receiving a service request aiming at 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 for requesting 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;
executing the target service logic encapsulated by the target service interface to obtain first data;
acquiring monitoring data of the target service interface when the target service logic is executed through an agent interface corresponding to the target service interface, and performing anomaly 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 serving as the service data through the proxy interface, wherein the second data is preset service data;
and if the detection result indicates that the target service interface is not abnormal, returning the first data as the service data through the proxy interface.
In an embodiment, before the processor 401 acquires, through the proxy interface corresponding to the target service interface, the monitoring data of the target service interface when the target service logic is executed, the processor is further configured to:
when the target application is started, acquiring proxy annotation information in a code file to which the target application belongs, wherein the proxy annotation information is used for indicating the position of proxy interface information corresponding to the target service interface in the code file;
acquiring agent interface information corresponding to the target service interface from the code file based on the agent annotation information;
generating a proxy interface for the target service interface based on the proxy interface information.
In an embodiment, when the processor 401 generates the proxy interface for the target service interface based on the proxy interface information, it may specifically be configured to:
acquiring a target class where the target service interface is located;
and dynamically generating an agent class from the target class through a dynamic agent mechanism based on the agent interface information, wherein the agent class comprises an agent interface.
In an embodiment, when the processor 401 performs anomaly detection on the target service interface based on the monitoring data to obtain a detection result, the processor may specifically be configured to:
acquiring a monitoring configuration file from the code file to which the target application belongs, wherein the monitoring configuration file comprises a monitoring interface to be monitored and a target abnormal type of the monitoring interface;
judging whether the target service interface is a monitoring interface or not, 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 the target service interface has exception;
and if the exception type of the target service interface is not the target exception type, determining that the target service interface has no exception.
In an embodiment, if the exception type of the target service interface is the target exception type, the processor 401 may specifically be configured to:
if the exception type of the target service interface is the target exception type, reporting error times corresponding to the target exception type in a preset time period from the monitoring data;
if the error reporting times are larger than or equal to an error reporting threshold value, determining that the target service interface is abnormal;
in one embodiment, the processor 401 is further configured to:
determining a service type for each of the one or more service interfaces;
determining a monitoring interface needing to be monitored and a target exception type of the monitoring interface from the one or more service interfaces based on the service type of each service interface;
generating a monitoring configuration file according to the monitoring interface to be monitored and the target exception type of the monitoring interface;
and encapsulating the monitoring configuration file into a jar file, and adding the jar file into a code file to which the target application belongs.
In one embodiment, the target service interface is encapsulated with security validation logic; when the processor 401 executes the target service logic encapsulated by the target service interface to obtain the first data, the processor may specifically be configured to:
executing the safety verification logic to carry out validity verification on the service request, and acquiring one or more reference service logics packaged by the target service interface after the validity verification is passed;
determining a storage location of service data requested by the service request;
determining a target business logic of the target service interface from one or more reference business logics according to the storage position;
and executing the target service logic of the target service interface to obtain first data.
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 (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
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 non-volatile random access memory.
The input device 402 may include a keyboard or the like and inputs a service request to the processor 401; the output device 403 may include a display or the like.
In a specific implementation, the processor 401, the input device 402, the output device 403, and the memory 404 described in this embodiment may execute the implementation described in all the embodiments above, and may also execute the implementation described in the apparatus above, which is not described herein again.
A computer-readable storage medium is provided in an embodiment of the present application, and stores a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, can perform the steps performed in all the above embodiments.
Embodiments of the present application further provide a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium, and when the computer instructions are executed by a processor of a computer device, the computer instructions perform the methods in all the embodiments described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. It is emphasized that the service data involved may be stored in any node of the blockchain in order to further ensure privacy and security of the data. The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (10)
1. A data processing method, comprising:
receiving a service request aiming at 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 for requesting 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;
executing the target service logic encapsulated by the target service interface to obtain first data;
acquiring monitoring data of the target service interface when the target service logic is executed through an agent interface corresponding to the target service interface, and performing anomaly 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 serving as the service data through the proxy interface, wherein the second data is preset service data;
and if the detection result indicates that the target service interface is not abnormal, returning the first data as the service data through the proxy interface.
2. The method according to claim 1, wherein before the obtaining, through the agent interface corresponding to the target service interface, the monitoring data of the target service interface when the target business logic is executed, the method further comprises:
when the target application is started, acquiring proxy annotation information in a code file to which the target application belongs, wherein the proxy annotation information is used for indicating the position of proxy interface information corresponding to the target service interface in the code file;
acquiring agent interface information corresponding to the target service interface from the code file based on the agent annotation information;
generating a proxy interface for the target service interface based on the proxy interface information.
3. The method of claim 2, wherein generating a proxy interface for the target service interface based on the proxy interface information comprises:
acquiring a target class where the target service interface is located;
and dynamically generating an agent class from the target class through a dynamic agent mechanism based on the agent interface information, wherein the agent class comprises an agent interface.
4. The method according to claim 1, wherein the performing anomaly detection on the target service interface based on the monitoring data to obtain a detection result comprises:
acquiring a monitoring configuration file from the code file to which the target application belongs, wherein the monitoring configuration file comprises a monitoring interface to be monitored and a target abnormal type of the monitoring interface;
judging whether the target service interface is a monitoring interface or not, 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 the target service interface has exception;
and if the exception type of the target service interface is not the target exception type, determining that the target service interface has no exception.
5. The method of claim 4, wherein the determining that the target service interface has the exception if the exception type of the target service interface is the target exception type comprises:
if the exception type of the target service interface is the target exception type, reporting error times corresponding to the target exception type in a preset time period from the monitoring data;
and if the error reporting times are more than or equal to the error reporting threshold, determining that the target service interface is abnormal.
6. The method of claim 4, further comprising:
determining a service type for each of the one or more service interfaces;
determining a monitoring interface needing to be monitored and a target exception type of the monitoring interface from the one or more service interfaces based on the service type of each service interface;
generating a monitoring configuration file according to the monitoring interface to be monitored and the target exception type of the monitoring interface;
and encapsulating the monitoring configuration file into a jar file, and adding the jar file into a code file to which the target application belongs.
7. The method of any of claims 1-6, wherein the target service interface is encapsulated with security validation logic; the executing the target service logic encapsulated by the target service interface to obtain first data includes:
executing the safety verification logic to carry out validity verification on the service request, and acquiring one or more reference service logics packaged by the target service interface after the validity verification is passed;
determining a storage location of service data requested by the service request;
determining a target business logic of the target service interface from one or more reference business logics according to the storage position;
and executing the target service logic of the target service interface to obtain first data.
8. A data processing apparatus, comprising:
a receiving unit, configured 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;
the processing unit is used for determining 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 a target service logic encapsulated by the target service interface to obtain first data;
the processing unit is further configured to acquire, through an agent interface corresponding to the target service interface, monitoring data of the target service interface when the target service logic is executed, 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, where 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 the target service interface is not abnormal.
9. A computer device, comprising: a memory for storing a computer program;
a processor calling said computer program in said memory for performing the data processing method of any of claims 1 to 7.
10. A computer storage medium, characterized in that it stores a computer program comprising program instructions which, when executed by a processor, perform the data processing method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111524244.6A CN114185743A (en) | 2021-12-14 | 2021-12-14 | Data processing method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111524244.6A CN114185743A (en) | 2021-12-14 | 2021-12-14 | Data processing method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114185743A true CN114185743A (en) | 2022-03-15 |
Family
ID=80543584
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111524244.6A Pending CN114185743A (en) | 2021-12-14 | 2021-12-14 | Data processing method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114185743A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114827260A (en) * | 2022-04-13 | 2022-07-29 | 度小满科技(北京)有限公司 | Data transmission method and related device |
CN116468232A (en) * | 2023-04-06 | 2023-07-21 | 宝驷智慧物流(珠海)有限公司 | Method, device, equipment and medium for exception handling |
-
2021
- 2021-12-14 CN CN202111524244.6A patent/CN114185743A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114827260A (en) * | 2022-04-13 | 2022-07-29 | 度小满科技(北京)有限公司 | Data transmission method and related device |
CN114827260B (en) * | 2022-04-13 | 2023-08-25 | 度小满科技(北京)有限公司 | Data transmission method and related device |
CN116468232A (en) * | 2023-04-06 | 2023-07-21 | 宝驷智慧物流(珠海)有限公司 | Method, device, equipment and medium for exception handling |
CN116468232B (en) * | 2023-04-06 | 2024-01-19 | 宝驷智慧物流(珠海)有限公司 | Method, device, equipment and medium for exception handling |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111401903B (en) | Block chain message processing method, device, computer and readable storage medium | |
US11171977B2 (en) | Unsupervised spoofing detection from traffic data in mobile networks | |
CN111786950B (en) | Network security monitoring method, device, equipment and medium based on situation awareness | |
EP3178011B1 (en) | Method and system for facilitating terminal identifiers | |
CN112035258A (en) | Data processing method, device, electronic equipment and medium | |
CN114185743A (en) | Data processing method and device, computer equipment and storage medium | |
CN111901327A (en) | Cloud network vulnerability mining method and device, electronic equipment and medium | |
CN111885050B (en) | Data storage method and device based on block chain network, related equipment and medium | |
CN109189509B (en) | Interface calling method, interface calling response method and server | |
CN114024972B (en) | Long connection communication method, system, device, equipment and storage medium | |
CN113867913A (en) | Business request processing method, device, equipment and storage medium for microservice | |
CN115147956B (en) | Data processing method, device, electronic equipment and storage medium | |
CN113259429B (en) | Session maintenance management and control method, device, computer equipment and medium | |
CN110930254A (en) | Data processing method, device, terminal and medium based on block chain | |
CN113806110A (en) | Event-driven message processing method, device, equipment and storage medium | |
CN112364059A (en) | Correlation matching method, device, equipment and storage medium under multi-rule scene | |
CN111752819B (en) | Abnormality monitoring method, device, system, equipment and storage medium | |
CN113162971A (en) | Block link point management method, device, computer and readable storage medium | |
CN114785526B (en) | Multi-user multi-batch weight distribution calculation and storage processing system based on block chain | |
CN114979109A (en) | Behavior track detection method and device, computer equipment and storage medium | |
CN113886493B (en) | System log security query method, device, equipment and storage medium | |
CN114531486B (en) | Industrial Internet data processing method, device, equipment and storage medium | |
CN115842716B (en) | Method, device, equipment and storage medium for determining fault server | |
CN114389988B (en) | Remote procedure call method, device, equipment and medium based on network architecture | |
CN117040929B (en) | Access processing method, device, equipment, medium and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |