CN109933508B - Method and apparatus for transmitting information - Google Patents

Method and apparatus for transmitting information Download PDF

Info

Publication number
CN109933508B
CN109933508B CN201910228593.XA CN201910228593A CN109933508B CN 109933508 B CN109933508 B CN 109933508B CN 201910228593 A CN201910228593 A CN 201910228593A CN 109933508 B CN109933508 B CN 109933508B
Authority
CN
China
Prior art keywords
log data
application programming
data set
programming interface
returned
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.)
Active
Application number
CN201910228593.XA
Other languages
Chinese (zh)
Other versions
CN109933508A (en
Inventor
刘曾超前
路平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910228593.XA priority Critical patent/CN109933508B/en
Publication of CN109933508A publication Critical patent/CN109933508A/en
Application granted granted Critical
Publication of CN109933508B publication Critical patent/CN109933508B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephonic Communication Services (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for sending information. One embodiment of the method comprises: acquiring at least one piece of log data generated by a gateway server within a preset time length; dividing at least one piece of log data to obtain at least one log data set, wherein calling information included in the log data in the same log data set indicates the same application programming interface; analyzing the log data in at least one log data set to obtain the called times and the total returned data quantity of the application programming interface corresponding to the log data set; and sending the obtained called times and the total returned data amount of the application programming interface. According to the implementation mode, the called times and the total returned data volume of the application programming interfaces are analyzed according to the application programming interfaces, and the called times and the total returned data volume of each application programming interface are sent.

Description

Method and apparatus for transmitting information
Technical Field
The disclosed embodiments relate to the field of computer technologies, and in particular, to a method and an apparatus for transmitting information.
Background
An API (Application Programming Interface) is used to open the service capability of the capability server to the outside. In use, an API is typically called by the gateway to enable access to the energy server. Each time the API is called, the gateway generates an API call log data. The API calls log data is key data used in the processes of charging, monitoring and the like.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for sending information.
In a first aspect, an embodiment of the present disclosure provides a method for sending information, where the method includes: acquiring at least one piece of log data generated by a gateway server within a preset time length, wherein the log data comprises calling information and return data volume of an application programming interface; dividing the at least one piece of log data to obtain at least one log data set, wherein the call information included in the log data in the same log data set indicates the same application programming interface; analyzing the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set; and sending the obtained called times and the total returned data amount of the application programming interface.
In some embodiments, the above method further comprises: for the log data set in the at least one log data set, executing the following monitoring steps: performing exception identification on the number of times of being called and the total data volume of returning of the application programming interface corresponding to the log data set obtained through analysis; and sending an abnormality prompt message to a preset receiver in response to the fact that the called times and/or the returned total data volume of the application programming interface corresponding to the log data set are abnormal.
In some embodiments, the performing exception identification on the number of times of calling and the total amount of data returned of the application programming interface corresponding to the log data set obtained through analysis includes: comparing the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis with the historical called times and the historical total returned data volume; and determining an abnormal recognition result according to the comparison result.
In some embodiments, the above method further comprises: and storing the at least one log data set into a preset database, wherein the data in the database is classified according to an application programming interface.
In some embodiments, the above method further comprises: receiving a query request, wherein the query request comprises an interface identifier and a query time period; and acquiring log data from the database according to the interface identifier and the query time period, and transmitting the acquired log data.
In a second aspect, an embodiment of the present disclosure provides an apparatus for transmitting information, where the apparatus includes: the gateway server comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire at least one piece of log data generated by the gateway server within a preset time length, and the log data comprises calling information and return data volume of an application programming interface; the dividing unit is configured to divide the at least one piece of log data to obtain at least one log data set, wherein the call information included in the log data in the same log data set indicates the same application programming interface; the analysis unit is configured to analyze the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set; and a sending unit configured to send the obtained number of times the application programming interface is called and the total amount of data returned.
In some embodiments, the above apparatus further comprises: a monitoring unit configured to perform the following monitoring steps for the log data set of the at least one log data set: performing exception identification on the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis; and sending an abnormality prompt message to a preset receiver in response to the fact that the called times and/or the returned total data volume of the application programming interface corresponding to the log data set are abnormal.
In some embodiments, the performing exception identification on the number of times of call and the total amount of returned data of the application programming interface corresponding to the log data set obtained by analysis includes: comparing the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis with the historical called times and the historical total returned data volume; and determining an abnormal recognition result according to the comparison result.
In some embodiments, the above apparatus further comprises: and the storage unit is configured to store the at least one log data set into a preset database, wherein the data in the database is classified according to an application programming interface.
In some embodiments, the above apparatus further comprises: the device comprises a receiving unit, a sending unit and a processing unit, wherein the receiving unit is configured to receive a query request, and the query request comprises an interface identifier and a query time period; and the query unit is configured to acquire the log data from the database according to the interface identifier and the query time period, and send the acquired log data.
In a third aspect, an embodiment of the present disclosure provides a server, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The method and the device for sending the information provided by the embodiment of the disclosure firstly acquire at least one piece of log data generated by a gateway server within a preset time length, wherein the log data comprises calling information and return data volume of an application programming interface. And then, dividing at least one piece of log data to obtain at least one log data set, wherein the call information included in the log data in the same log data set indicates the same application programming interface. Then, for each log data set in at least one log data set, analyzing the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set. And finally, sending the obtained called times and the total returned data volume of the application programming interface. Therefore, the called times and the total returned data volume of the application programming interfaces are analyzed according to the application programming interfaces, and the called times and the total returned data volume of each application programming interface are sent.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for transmitting information, according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for transmitting information according to the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for transmitting information according to the present disclosure;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for transmitting information according to the present disclosure;
FIG. 6 is a schematic block diagram of a computer system suitable for use with a server embodying embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and the features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a method for transmitting information or an apparatus for transmitting information to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, a gateway server 105, a capability server 106, and a server 107. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the gateway server 105, between the gateway server 105 and the capability server 106, and between the gateway server 105 and the server 107. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to invoke APIs through the network 104 and the gateway server 105 to enable interaction with the capability server 106 to access the capability server 106. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It may be implemented as a plurality of software or software modules (for example to provide distributed services) or as a single software or software module. And is not particularly limited herein.
The gateway server 105 may provide various services, for example, to call an API of the capability server 106 according to an API call request sent by a user through the terminal devices 101, 102, 103, and to enable the user to access the capability server 106. For another example, the generated log data is transmitted to the server 107 to be analyzed and processed by the server 107.
The capability server 106 is a server that opens service capabilities to the outside through an API.
The server 107 may be a server that provides various services, such as a background server that analyzes and processes log data sent by the gateway server 105. The background web server may analyze the received log data, and send the processing result (for example, the number of times the application programming interface is called and the total amount of data returned).
The gateway server 105, the capability server 106, and the server 107 may be hardware or software. When the gateway server 105, the capability server 106, and the server 107 are hardware, they may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the gateway server 105, the capability server 106, and the server 107 are software, they may be implemented as a plurality of software or software modules (for example, for providing distributed services), or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, gateway servers, capability servers, and servers in fig. 1 are merely illustrative. There may be any number of terminal devices, networks, gateway servers, capability servers, and servers, as desired for an implementation.
It should be noted that the method for sending information provided by the embodiment of the present disclosure is generally executed by the server 107, and accordingly, the apparatus for sending information is generally disposed in the server 107.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for transmitting information in accordance with the present disclosure is shown. The method for transmitting information comprises the following steps:
step 201, at least one piece of log data generated by the gateway server within a preset time length is obtained.
In this embodiment, an execution subject (for example, the server 107 shown in fig. 1) of the method for sending information may obtain, by a wired connection manner or a wireless connection manner, at least one piece of log data generated by a gateway server (for example, the gateway server 105 shown in fig. 1) within a preset time period. The log data may include call information and return data volume of the application programming interface. Here, the preset time period may be set according to actual needs, for example, within one day, within one month, and the like.
In general, a user (or caller) who wants to use the processing capability provided by a capability server (e.g., the capability server 106 shown in fig. 1) may call an API of the capability server through a gateway server by using a terminal (e.g., the terminal devices 101, 102, 103 shown in fig. 1) to access the capability server. Each time the API is called, the gateway server generates a piece of log data. The log data may include call information and return data volume for the API. Here, the call information of the API may include a call time, a caller identification, and the like. The return data amount may refer to the data amount of data acquired from the capability server by the terminal used by the caller. In practice, the gateway server may manage multiple APIs. Therefore, the at least one piece of log data may be log data generated for a plurality of APIs.
Step 202, at least one piece of log data is divided to obtain at least one log data set.
In this embodiment, the executing entity may divide at least one piece of log data acquired in step 201, so as to obtain at least one log data set. And the log data in the same log data set comprise calling information indicating the same API. In particular, the executing agent may divide log data generated for the same API into the same log data set.
Step 203, analyzing the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set.
In this embodiment, for each log data set of the at least one log data set obtained by dividing in step 202, the executing entity may analyze the log data in the log data set, so as to obtain the number of times that the API to which the log data set is called and the total amount of returned data. As an example, the execution subject may count the number of pieces of log data included in the log data set, and use the obtained number as the number of times of being called of the API to which the log data set is directed. The execution main body can also add the return data volume in each piece of log information in the log data set, and use the added value as the total return data volume of the API for which the log data set is directed.
And step 204, sending the called times and the total returned data volume of the obtained application programming interface.
In this embodiment, the execution principal may send the called number and the total returned data amount for each API obtained in step 203 to a preset information recipient. Taking the financial system for which the information receiver is predetermined as an example, the execution body may transmit the number of times of being called and the total amount of returned data for each API to the financial system. The financial system may generate billing data according to the number of times called and the total amount of data returned for each API, and the billing data may be used as a basis and reference for charging to the publisher of the API. For example, the accounting system may specify in advance a billing unit price at which the API is called once, and a billing unit price at which a unit amount of data is returned. In this way, the financial system, in conjunction with the number of calls to each API and the total amount of data returned, can calculate the fee that needs to be charged to the publisher for that API. In some scenarios, a publisher may publish multiple APIs, and at this time, the fees of the multiple APIs published by the publisher may be superimposed, and the superimposed result is used as the fee that the publisher needs to pay.
In some optional implementation manners of this embodiment, the method for sending information may further include the following steps: and storing at least one log data set to a preset database, wherein the data in the database is classified according to the application programming interface.
In this implementation, the executing entity may store the at least one log data set obtained in step 202 in a preset database. Here, the data in the database may be classified by API. For example, the log data generated for the same API may be classified into the same type, and the log data of the same type may be sorted according to the call time and stored.
In some optional implementation manners, the method for sending information may further include:
first, a query request is received.
In this implementation, the execution subject may receive a query request sent by another device. The query request may include an interface identifier and a query time period. Here, the interface identifier may be used to uniquely identify an application programming interface. The query time period may include a query start time and a query end time.
Then, according to the interface identifier and the query time period, obtaining the log data from the database, and sending the obtained log data.
In this implementation, the execution subject may first determine a target API for the query according to the interface identifier in the query request. And then, acquiring the log data which corresponds to the target API and has calling time within the query time period from the database. Then, the acquired log data is transmitted to the device that transmitted the inquiry request.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for transmitting information according to the present embodiment. In the application scenario of fig. 3, the server 301 first obtains at least one piece of log data generated by the gateway server 302 within a preset time period, where the log data includes call information and return data volume of the API. Then, the server 301 divides at least one piece of log data to obtain at least one log data set, where call information included in the log data in the same log data set indicates the same API. Then, for each log data set in at least one log data set, the server 301 may analyze the log data in the log data set to obtain the called times and the total returned data amount of the API corresponding to the log data set. Finally, the server 301 transmits the obtained number of times of calling each API and the total amount of returned data. In the present application scenario, the server 301 may send the called times and the total returned data amount of each API to a predetermined financial system for the financial system to charge.
The method provided by the above embodiment of the present disclosure realizes analyzing the called times and the total returned data amount according to the application programming interfaces, and sending the called times and the total returned data amount of each application programming interface.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for transmitting information is shown. The process 400 of the method for transmitting information includes the following steps:
step 401, at least one piece of log data generated by the gateway server within a preset time length is obtained.
In this embodiment, step 401 is similar to step 201 of the embodiment shown in fig. 2, and is not described here again.
Step 402, at least one piece of log data is divided to obtain at least one log data set.
In this embodiment, step 402 is similar to step 202 in the embodiment shown in fig. 2, and is not described herein again.
Step 403, for a log data set in at least one log data set, analyzing the log data in the log data set to obtain the number of times of being called and the total data volume returned of the application programming interface corresponding to the log data set.
In this embodiment, step 403 is similar to step 203 of the embodiment shown in fig. 2, and is not described herein again.
And step 404, sending the obtained called times and the total returned data amount of the application programming interface.
In this embodiment, step 404 is similar to step 204 of the embodiment shown in fig. 2, and is not described here again.
Step 405, for the log data set of the at least one log data set, performing monitoring steps 4051-4052.
In this embodiment, for each log data set of the at least one log data set obtained in step 402, the executing main body may execute steps 4051 to 4052.
Step 4051, perform exception identification on the number of times the application programming interface corresponding to the log data set is called and the total amount of data returned.
In this embodiment, the execution subject may perform exception identification on the number of times the API corresponding to the log data set is called and the total amount of returned data, which are obtained through analysis. As an example, a threshold of the number of times of being called and a threshold of the total amount of returned data may be set in advance. In this way, if the called times of the API corresponding to the log data set exceed the preset called times threshold, it may be determined that the called times of the API corresponding to the log data set are abnormal. If the total data volume returned by the API corresponding to the log data set exceeds a preset total data volume returned threshold, it may be determined that the total data volume returned by the API corresponding to the log data set is abnormal.
In some optional implementations of this embodiment, step 4051 may specifically be performed as follows:
firstly, the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis are compared with the historical called times and the historical total returned data volume.
In this implementation, the execution main body may compare the number of times the API is called and the total data volume returned by the API corresponding to the log data set obtained through analysis with the historical number of times the API is called and the historical total data volume returned by the API, respectively. For example, the number of times the call is called and the total amount of data returned by the history within a preset time length on the API are compared.
Then, an abnormality recognition result is determined based on the comparison result.
In this implementation, the execution subject may determine the abnormality recognition result according to the comparison result. For example, if the difference between the called number of times of the API corresponding to the log data set and the historical called number of times of the API is greater than the preset threshold, it may be determined that the abnormality identification result of the called number of times of the API corresponding to the log data set is an abnormality. If the difference value between the total returned data volume of the API corresponding to the log data set and the total historical returned data volume of the API is greater than the preset threshold value, it may be determined that the abnormality identification result of the total returned data volume of the API corresponding to the log data set is abnormal.
Step 4052, in response to determining that the called number of times of the application programming interface corresponding to the log data set and/or the total amount of returned data are abnormal, sending an abnormal prompt message to a preset receiving party.
In this implementation, if it is determined that the called number of times and/or the total returned data volume of the API corresponding to the log data set is abnormal, the execution main body may send an abnormal prompt message to a preset receiving party. The exception prompt information may include an interface identifier of an API corresponding to the log data set. The exception prompting information may be used to prompt that the invocation of the API corresponding to the interface identifier of the receiving party is abnormal.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for sending information in the present embodiment highlights the step of monitoring the number of times the API is called and the total amount of returned data. Therefore, according to the scheme described in the embodiment, the called times and the total data volume returned are analyzed according to the API, the data is monitored, and the security of the API opening to the outside is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for sending information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 5, the apparatus 500 for transmitting information of the present embodiment includes: an acquisition unit 501, a division unit 502, an analysis unit 503, and a transmission unit 504. The obtaining unit 501 is configured to obtain at least one piece of log data generated by the gateway server within a preset time length, where the log data includes call information and a return data volume of an application programming interface; the dividing unit 502 is configured to divide the at least one piece of log data to obtain at least one log data set, where call information included in the log data in the same log data set indicates the same application programming interface; the analyzing unit 503 is configured to analyze the log data in the log data set to obtain the called times and the total returned data amount of the application programming interface corresponding to the log data set, for the log data set in the at least one log data set; the sending unit 504 is configured to send the obtained number of times of being called and the total amount of data returned of the application programming interface.
In this embodiment, specific processing of the obtaining unit 501, the dividing unit 502, the analyzing unit 503, and the sending unit 504 of the apparatus 500 for sending information and technical effects brought by the processing can refer to related descriptions of step 201, step 202, step 203, and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the apparatus 500 further includes: a monitoring unit (not shown in the figure) configured to perform the following monitoring steps for the log data set of the at least one log data set: performing exception identification on the number of times of being called and the total data volume of returning of the application programming interface corresponding to the log data set obtained through analysis; and sending an abnormality prompt message to a preset receiver in response to the fact that the called times and/or the returned total data volume of the application programming interface corresponding to the log data set are abnormal.
In some optional implementation manners of this embodiment, the performing exception identification on the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained through analysis includes: comparing the called times and the total data volume of the application programming interface corresponding to the log data set obtained by analysis with the historical called times and the historical total data volume returned; and determining an abnormal recognition result according to the comparison result.
In some optional implementations of this embodiment, the apparatus 500 further includes: and a storage unit (not shown in the figures) configured to store the at least one log data set into a preset database, wherein the data in the database is classified according to an application programming interface.
In some optional implementations of this embodiment, the apparatus 500 further includes: a receiving unit (not shown in the figure) configured to receive an inquiry request, wherein the inquiry request includes an interface identifier and an inquiry time period; and an inquiring unit (not shown in the figure) configured to acquire the log data from the database according to the interface identifier and the inquiring time period, and to transmit the acquired log data.
Referring now to FIG. 6, a schematic diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least one piece of log data generated by a gateway server within a preset time length, wherein the log data comprises calling information and return data volume of an application programming interface; dividing the at least one piece of log data to obtain at least one log data set, wherein the call information included in the log data in the same log data set indicates the same application programming interface; analyzing the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set; and sending the obtained called times and the total returned data amount of the application programming interface.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a division unit, an analysis unit, and a transmission unit. The names of the units do not form a limitation on the units themselves in some cases, and for example, the acquiring unit may also be described as a "unit that acquires at least one piece of log data generated by the gateway server within a preset time period".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (12)

1. A method for transmitting information, comprising:
the method comprises the steps of obtaining at least one piece of log data generated by a gateway server within a preset time length, wherein the log data comprises calling information and return data volume of an application programming interface, and the calling information comprises calling time and caller identification; the return data volume is the data volume of data acquired by a terminal used by a caller from a capability server; the at least one piece of log data comprises log data generated for a plurality of application programming interfaces;
dividing the at least one piece of log data to obtain at least one log data set, wherein calling information included in the log data in the same log data set indicates the same application programming interface;
analyzing the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set;
and sending the obtained called times and the total returned data amount of the application programming interface.
2. The method of claim 1, wherein the method further comprises:
for a log data set of the at least one log data set, performing the following monitoring steps: performing exception identification on the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis; and sending an abnormality prompt message to a preset receiver in response to the fact that the called times and/or the returned total data volume of the application programming interface corresponding to the log data set are abnormal.
3. The method according to claim 2, wherein the performing exception identification on the number of times of calls and the total amount of returned data of the application programming interface corresponding to the analyzed log data set includes:
comparing the called times and the total data volume of the application programming interface corresponding to the log data set obtained by analysis with the historical called times and the historical total data volume returned;
and determining an abnormal recognition result according to the comparison result.
4. The method of claim 1, wherein the method further comprises:
and storing the at least one log data set to a preset database, wherein the data in the database is classified according to an application programming interface.
5. The method of claim 4, wherein the method further comprises:
receiving a query request, wherein the query request comprises an interface identifier and a query time period;
and acquiring log data from the database according to the interface identifier and the query time period, and sending the acquired log data.
6. An apparatus for transmitting information, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire at least one piece of log data generated by a gateway server within a preset time length, the log data comprises calling information and a return data volume of an application programming interface, and the calling information comprises calling time and caller identification; the return data volume is the data volume of data acquired by a terminal used by a caller from a capability server; the at least one piece of log data comprises log data generated for a plurality of application programming interfaces;
the dividing unit is configured to divide the at least one piece of log data to obtain at least one log data set, wherein the call information included in the log data in the same log data set indicates the same application programming interface;
the analysis unit is configured to analyze the log data in the log data set to obtain the called times and the total returned data volume of the application programming interface corresponding to the log data set;
and a sending unit configured to send the obtained number of times of being called and the total amount of data returned of the application programming interface.
7. The apparatus of claim 6, wherein the apparatus further comprises:
a monitoring unit configured to perform the following monitoring steps for a log data set of the at least one log data set: performing exception identification on the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis; and sending an abnormality prompt message to a preset receiver in response to the fact that the called times and/or the returned total data volume of the application programming interface corresponding to the log data set are abnormal.
8. The apparatus of claim 7, wherein the performing exception identification on the number of times of calls and the total amount of returned data of the application programming interface corresponding to the analyzed log data set includes:
comparing the called times and the total returned data volume of the application programming interface corresponding to the log data set obtained by analysis with the historical called times and the historical total returned data volume;
and determining an abnormal recognition result according to the comparison result.
9. The apparatus of claim 6, wherein the apparatus further comprises:
a storage unit configured to store the at least one log data set to a preset database, wherein data in the database is classified according to an application programming interface.
10. The apparatus of claim 9, wherein the apparatus further comprises:
a receiving unit configured to receive a query request, wherein the query request includes an interface identifier and a query time period;
and the query unit is configured to acquire the log data from the database according to the interface identifier and the query time period, and send the acquired log data.
11. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN201910228593.XA 2019-03-25 2019-03-25 Method and apparatus for transmitting information Active CN109933508B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910228593.XA CN109933508B (en) 2019-03-25 2019-03-25 Method and apparatus for transmitting information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910228593.XA CN109933508B (en) 2019-03-25 2019-03-25 Method and apparatus for transmitting information

Publications (2)

Publication Number Publication Date
CN109933508A CN109933508A (en) 2019-06-25
CN109933508B true CN109933508B (en) 2023-02-24

Family

ID=66988096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910228593.XA Active CN109933508B (en) 2019-03-25 2019-03-25 Method and apparatus for transmitting information

Country Status (1)

Country Link
CN (1) CN109933508B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110673973B (en) * 2019-09-27 2024-02-13 聚好看科技股份有限公司 Abnormality determination method and device for application programming interface API
CN111756579A (en) * 2020-06-24 2020-10-09 北京百度网讯科技有限公司 Abnormity early warning method, device, equipment and storage medium
CN114185848A (en) * 2020-09-15 2022-03-15 中国移动通信集团山东有限公司 Interface state generation method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106096034A (en) * 2016-06-27 2016-11-09 乐视控股(北京)有限公司 application log management method and device
CN107330034A (en) * 2017-06-26 2017-11-07 百度在线网络技术(北京)有限公司 A kind of log analysis method and device, computer equipment, storage medium
CN108076090A (en) * 2016-11-11 2018-05-25 华为技术有限公司 Data processing method and storage management system
CN108933695A (en) * 2018-06-25 2018-12-04 百度在线网络技术(北京)有限公司 Method and apparatus for handling information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7895579B2 (en) * 2006-06-16 2011-02-22 Microsoft Corporation Automated method and system for collecting and reporting API performance profiles

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106096034A (en) * 2016-06-27 2016-11-09 乐视控股(北京)有限公司 application log management method and device
CN108076090A (en) * 2016-11-11 2018-05-25 华为技术有限公司 Data processing method and storage management system
CN107330034A (en) * 2017-06-26 2017-11-07 百度在线网络技术(北京)有限公司 A kind of log analysis method and device, computer equipment, storage medium
CN108933695A (en) * 2018-06-25 2018-12-04 百度在线网络技术(北京)有限公司 Method and apparatus for handling information

Also Published As

Publication number Publication date
CN109933508A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN108346028B (en) Business approval processing method, device and system
CN109040316B (en) HTTP service processing method and device
CN109933508B (en) Method and apparatus for transmitting information
CN108810047B (en) Method and device for determining information push accuracy rate and server
CN110377440B (en) Information processing method and device
CN109873863B (en) Asynchronous calling method and device of service
CN111177433A (en) Method and apparatus for parallel processing of information
CN111209060A (en) Capability development platform processing method and device
CN111881329A (en) Account balance management method and system
CN110737655B (en) Method and device for reporting data
CN111125503B (en) Method and apparatus for generating information
CN114840379A (en) Log generation method, device, server and storage medium
CN111787041B (en) Method and device for processing data
CN111385150A (en) Method and device for acquiring information
CN108933802B (en) Method and apparatus for monitoring operation
US20230418470A1 (en) Data processing method and apparatus, and electronic device
CN115187364A (en) Method and device for monitoring deposit risk under bank distributed scene
CN114924937A (en) Batch task processing method and device, electronic equipment and computer readable medium
CN114723455A (en) Service processing method and device, electronic equipment and storage medium
CN110187987B (en) Method and apparatus for processing requests
CN112367266A (en) Current limiting method, current limiting device, electronic equipment and computer readable medium
CN110378785B (en) Transaction processing method, apparatus, computing device and medium executed by server
CN113283891A (en) Information processing method and device and electronic equipment
CN113079085A (en) Business service interaction method, business service interaction device, business service interaction equipment and storage medium
CN112363716A (en) Method, system and device for dynamically assembling evaluation model

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
GR01 Patent grant
GR01 Patent grant