CN104731564A - Generation method and device for system interface call records - Google Patents

Generation method and device for system interface call records Download PDF

Info

Publication number
CN104731564A
CN104731564A CN201310699613.4A CN201310699613A CN104731564A CN 104731564 A CN104731564 A CN 104731564A CN 201310699613 A CN201310699613 A CN 201310699613A CN 104731564 A CN104731564 A CN 104731564A
Authority
CN
China
Prior art keywords
system interface
recalls information
record
calls
layer
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
Application number
CN201310699613.4A
Other languages
Chinese (zh)
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.)
Qingdao Haier Air Conditioner Gen Corp Ltd
Haier Group Corp
Original Assignee
Qingdao Haier Air Conditioner Gen Corp Ltd
Haier Group Corp
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 Qingdao Haier Air Conditioner Gen Corp Ltd, Haier Group Corp filed Critical Qingdao Haier Air Conditioner Gen Corp Ltd
Priority to CN201310699613.4A priority Critical patent/CN104731564A/en
Publication of CN104731564A publication Critical patent/CN104731564A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a generation method and device for system interface call records. The generation method includes: comparing whether the call information called by the same system interface continuously for N times is identical, and if the call information is identical, merging and generating the call records according to the call information called for N times, wherein N is an integer which is larger than 1. According to the comparison of the corresponding call information, the identical call information is merged to generate the call records. Therefore, the generation method and device for the system interface call records can achieve the transparency of the service codes and accurate statistics without the need of program adjustment in the service codes.

Description

System interface calls the generation method and apparatus of record
Technical field
The present invention relates to the communications field, particularly relate to the generation method and apparatus that a kind of system interface calls record.
Background technology
Along with the development of computer technology, user can install application program miscellaneous in computer systems, which to meet its different user demand, for various application program, obtain the frequency that it uses, the frequency of utilization according to each application program carrys out optimization system.
Current major part all follows MVC(model view controller model-view-controller based on the program of j2ee) framework, realized by software hierarchy, based on the application system that this framework is built, the business operation that the basic correspondence one of each action is concrete, an independent action as created order, how to count each business operation and call record at the system interface of server end, still there is no good solution at present.
Summary of the invention
Provide hereinafter about brief overview of the present invention, to provide about the basic comprehension in some of the present invention.Should be appreciated that this general introduction is not summarize about exhaustive of the present invention.It is not that intention determines key of the present invention or pith, and nor is it intended to limit the scope of the present invention.Its object is only provide some concept in simplified form, in this, as the preorder in greater detail discussed after a while.
On the one hand, the invention provides a kind of generation method that system interface calls record, comprising: be relatively whether more identical to the secondary recalls information called of the N continuous of identical systems interface, if identical, then merge generation according to N recalls information and call record, N be greater than 1 integer.
On the other hand, the invention provides the generating apparatus that a kind of system interface calls record, comprising: recalls information memory module, for storing the recalls information to identical systems interface interchange; Whether recalls information comparison module is identical for comparing the recalls information stored; Call record generation module, for when described recalls information comparison module feeds back identical signal, merge identical recalls information.
The system interface that the present invention proposes calls the generation method and apparatus of record, by obtaining the recalls information of system interface, relatively whether the repeatedly recalls information of identical systems is identical, and record is called in identical recalls information merging generation one, the method can accurate count recalls information and synthesis call record, accomplish the object of accurate count, again without the need to doing program adjustment in service code everywhere, implementation is simple.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the generation method flow diagram that in the embodiment of the present invention, system interface calls record;
Fig. 2 to Fig. 6 is that respectively to tackle object when system interface recalls information obtains in the embodiment of the present invention stacked and to pop schematic diagram;
Fig. 7 is the optional function structure chart of generation method that in the embodiment of the present invention, system interface calls record.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.The element described in an accompanying drawing of the present invention or a kind of embodiment and feature can combine with the element shown in one or more other accompanying drawing or embodiment and feature.It should be noted that for purposes of clarity, accompanying drawing and eliminate expression and the description of unrelated to the invention, parts known to persons of ordinary skill in the art and process in illustrating.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not paying creative work, all belongs to the scope of protection of the invention.
Embodiment one:
Be illustrated in figure 1 the generation method flow diagram that system interface in the embodiment of the present invention calls record, the invention provides a kind of generation method that system interface calls record, comprise step:
S11: relatively whether more identical to the secondary recalls information called of the N continuous of identical systems interface;
S12: if identical, then merge generation according to N recalls information and call record, N be greater than 1 integer.
In actual use, can call system interface, there will be the situation that same system interface is repeatedly called, recalls information when at every turn calling all can store, account for the storage space of system more, need to be combined to the repeatedly recalls information of identical systems interface, generate one and call record, and record the number of times called.The repeatedly identical record that calls is merged the space can saving internal memory, and only needs when checking to check identical record and call number, convenient to operation.
Before repeatedly recalls information is combined general, first need relatively whether more identical to the secondary recalls information called of the N continuous of identical systems interface, described recalls information is the call request sent system interface, namely whether the call request that receives of more same system interface identical, N be greater than 1 integer;
If compare when obtaining repeatedly call request that same system interface receives identical, recalls information according to comparing the call request that obtains identical is combined, record is called in generation, and describedly merges calling of generating and record the cumulative frequency that comprises based on the continuous calling system interface of identical recalls information.
Described calling records the cumulative frequency that calls in addition except recalls information, and user can view the information and record called very easily when checking, user friendlyly checks and operates.
Before whether the call request received at above-mentioned more same system interface is identical, needs the recalls information first obtaining system interface, to the acquisition methods of system interface recalls information be:
The call request of each layer system interface is tackled respectively and generates interception object,
The sequencing called according to each layer by each interception object is stacked;
By the order that last in, first out each interception object in storehouse carried out popping and process and add end time stamp corresponding to moment of popping;
According to the recalls information of the corresponding each layer system interface of each interception object acquisition after popping.
First, in system, the interface of different layers can send call request, first the call request of different system interfaces tackled and generate interception object respectively, optionally, described interception object comprises the call request of corresponding system interface and calls start time stamp, namely obtains and calls the call request of needs and the time starting to call to corresponding system interface.Described interception is not all tackle all call request, the optional call request in the face of each layer system interface, and the specified services operation will tackled according to pre-conditioned selection or rejecting do not need the address of tackling.Such as, the number of times of certain link of statistic of user accessing, needs the access of interception to described link, does not then need interception to the access of other links.
Then the sequencing called according to each layer by each interception object is stacked, and optionally, described system interface is divided into according to the sequencing called: WEB layer, operation layer, data Layer; In operation system, different layers is called, and stacked according to the order called.
According to the order that last in, first out, each interception object in storehouse is carried out process of popping subsequently, namely to the call request of corresponding system interface with call start time stamp and to pop process, the end time of adding correspondence while popping stabs.
Last basis pop after each interception object, described interception object is the call request to system interface, call the start time stamp and call the end time stamp, according to the recalls information of the corresponding each layer system of above-mentioned acquisition of information.
Asynchronous mode is adopted to send described recalls information to the acquisition methods of system interface recalls information.Described asynchronous be a kind of communication modes, both sides do not need common clock, and transmit leg can at any time send, send information in have prompting take over party start receive information, there is stop bit such as start bit when end.The signal that the prompting take over party mentioned in the present invention starts to receive or terminate receipt message is, calls start time stamp and calls end time stamp.
In order to clearly describe the embodiment of the present invention, the relevant technical terms first related to the embodiment of the present invention is done some and is introduced:
Hornetq is one and supports cluster and various protocols, can embed, high performance asynchronous message system.
Struts2 blocker implemented interception before or after certain method of certain Action or Action of access.
Spring framework is that a lightweight controls reversion and the container frame towards tangent plane.
AOP is the abbreviation of Aspect Oriented Programming, means: towards tangent plane programming, is realized the unified a kind of technology safeguarded of program function by precompile mode and runtime dynamic proxy.
Below with the application of acquisition methods in hornetq system of the present embodiment system interface recalls information, further illustrate technical scheme of the present invention.Optionally, blocker of the present invention can be Struts2 blocker.
Operation system, by statistics, is collected client-side program, is saved in the database of monitor supervision platform by hornetq message server by data, and user checks allocating stack information by Surveillance center is unified.
The business operation that the basic correspondence one of each action is concrete, the present embodiment adopts the blocker technology of struts2 to realize to the statistics of action, can configure in this blocker and whether enable this statistical function, by arranging a marker bit in this blocker, described marker bit acquiescence is enabled, also be provided with at this blocker the name single-unit needing the name single-unit of interception and do not need to tackle in addition: include and exclude name single-unit, namely operation system can select to tackle the business operation of specifying or according to actual needs not needing the address of tackling to weed out
Call operation layer below web layer, the unified aop function of spring framework that uses of operation layer calling data layer carries out unifying interception, namely records time and the contextual information of execution when carried out in this manner.
For example: create user operation
http://192.168.1.102:8080/user/createUser.action
Programmed logic corresponding to this function is:
CreateUserAction.java
---the createUser method of UserService.java class
The saveUser method of------UserDAO.java class
1, user accesses some business operations link (a corresponding action), is tackled by statistics blocker;
2, in blocker, record start time t1, the class name of current action, method name, and these information are kept in an object profileBeanTop, be kept in the stack that thread variable holds, the element now in storehouse is illustrated in figure 2:
profileBeanAction。
3, be finished successively other blockers logic after enter in concrete action program
4, Service Component the UserService.createUser () method of business logic processing can be called in CreateUserAction class, because have the aop of spring to tackle to the code of operation layer, when therefore performing, enter the interception statistical treatment of operation layer.
A: record enters the time t2 of business logic processing, the class UserService of the method createUser that business logic processing will perform and operation layer, and become an object profileBeanBiz to be pressed in stack these Information Organizations, the element now in stack is as being illustrated in figure 3:
profileBeanBiz,profileBeanAction。
B: calling data layer assembly in business logic processing, calling data layer can be tackled by the aop of spring again, therefore repeats as above step A, and by the information of data bank access method press-in stack, in stack, element is illustrated in figure 4:
profileBeanDAO,profileBeanBiz,profileBeanAction。
C: data bank access method is finished, the execution end time t22 ' of record data Layer method, the execution T.T. obtaining data bank access method is t3 '-t3, and statistical information object corresponding for data bank access method is ejected in stack, and the element at this moment in stack is illustrated in figure 5:
profileBeanBiz,profileBeanAction。
D: continue the remainder logic performing business logic processing method after database access is finished, if the logic performed still meets the statistics interception rule that spring aop configures, then repeat as above step and carry out stacked logic of popping, after business logic processing is finished, total execution time of record traffic logical process is t2 '-t2, then popped by stack top element, element is illustrated in figure 6: profileBeanAction.
E: business logic processing is finished, continues other logics performing action layer, meets aop interception rule as other operation layers of still needing in residue logic call, repeat as above logic, when action is finished, writing time t1 ', then the execution T.T. of action is t1 '-t1.
In the above-mentioned acquisition to system interface recalls information, steps A-E is the process that system interface calls, also the scene of certain data bank access method of recursive call in recursive call business logic processing method in an action or a business logic processing method may be there is, the total degree of the final it is of concern that circulation when statistics and circulating T.T. used, instead of each cyclical information repeated, therefore need to do these cyclical informations to merge, belonging to the sum of a method call in once calling and recording T.T., used herein is map object in java, before in each object press-in storehouse in as above step, capital using current class name+method name as key value, as UserService.createUser, the value that this key is corresponding is the number of times that this method performs, when aop interception enters statistic logic, corresponding number of times is found by this key in capital, circulation primary, corresponding number of times adds 1, execution time also does accumulation operations.
Embodiment two:
Be illustrated in figure 2 the optional function structure chart of generating apparatus that system interface in the embodiment of the present invention calls record, present invention also offers the generating apparatus that a kind of system interface calls record, comprising:
Recalls information memory module 21, for storing the recalls information to identical systems interface interchange;
Whether recalls information comparison module 22 is identical for comparing the recalls information stored;
Call record generation module 23, for when described recalls information comparison module feeds back identical signal, merge identical recalls information.
Before record is called in generation, first will compare the recalls information of identical systems interface, described recalls information memory module 21 is just used for storing corresponding recalls information, and the recalls information stored can compare in a subsequent step; So recalls information comparison module 22 is just for the more above-mentioned recalls information stored, described recalls information comprises call request, so recalls information comparison module 22 is also for more described call request.
Relatively, if draw the conclusion that recalls information is identical, then call record generation module 23 and merge identical recalls information, also need to add up the cumulative number based on the continuous calling system interface of identical recalls information.
The recalls information obtained compared, saved the space of internal memory by the recalls information comparing merging, the cumulative frequency of generation is user friendly to be checked and operates.
Also comprise recalls information acquisition module 24, described recalls information acquisition module is used for tackling respectively the call request of each layer system interface and generates interception object respectively; The sequencing called according to each layer by each interception object is stacked; By the order that last in, first out each interception object in storehouse carried out popping and process and add end time stamp corresponding to moment of popping; According to the recalls information of the corresponding each layer system interface of each interception object acquisition after popping.Further, optionally, each system interface is divided into according to the sequencing called: WEB layer, operation layer, data Layer.
The present embodiment adopts the blocker technology of struts2 to realize to the statistics of action, can configure in this blocker and whether enable this statistical function, by arranging a marker bit in this blocker, described marker bit acquiescence is enabled, also be provided with at this blocker the name single-unit needing the name single-unit of interception and do not need to tackle in addition: include and exclude name single-unit, namely operation system can select to tackle the business operation of specifying or according to actual needs not needing the address of interception to weed out.After the recalls information of identical systems interface gets, be stored in recalls information memory module 21, and then compared by recalls information comparison module 22, finally generate according to the result compared and call record, the sum of the recalls information called identical systems interface and T.T. are recorded.
State in each embodiment on the invention, the sequence number of embodiment and/or sequencing are only convenient to describe, and do not represent the quality of embodiment.The description of each embodiment is all emphasized particularly on different fields, certain embodiment
Although last it is noted that described the present invention and advantage thereof in detail above, be to be understood that and can carry out various change when not exceeding the spirit and scope of the present invention limited by appended claim, substituting and converting.And scope of the present invention is not limited only to the specific embodiment of process, equipment, means, method and step described by instructions.One of ordinary skilled in the art will readily appreciate that from disclosure of the present invention, can use perform the function substantially identical with corresponding embodiment described herein or obtain and its substantially identical result, existing and that will be developed in the future process, equipment, means, method or step according to the present invention.Therefore, appended claim is intended to comprise such process, equipment, means, method or step in their scope.

Claims (8)

1. system interface calls a generation method for record, it is characterized in that, comprising: whether the recalls information relatively time called the N continuous of identical systems interface identical, if identical, then calls record according to N recalls information merging generation, N be greater than 1 integer.
2. system interface according to claim 1 calls the generation method of record, it is characterized in that, what described merging generated calls the cumulative frequency recording and comprise based on the continuous calling system interface of identical recalls information.
3. system interface according to claim 1 calls the generation method of record, it is characterized in that, described recalls information acquisition methods comprises:
The call request of each layer system interface is tackled respectively and generates interception object respectively;
The sequencing called according to each layer by each interception object is stacked;
By the order that last in, first out each interception object in storehouse carried out popping and process and add end time stamp corresponding to moment of popping;
According to the recalls information of the corresponding each layer system interface of each interception object acquisition after popping.
4. system interface according to claim 3 calls the generation method of record, it is characterized in that, described system interface is divided into according to the sequencing called: WEB layer, operation layer, data Layer.
5. system interface calls a generating apparatus for record, it is characterized in that, comprising:
Recalls information memory module, for storing the recalls information to identical systems interface interchange;
Whether recalls information comparison module is identical for comparing the recalls information stored;
Call record generation module, for when described recalls information comparison module feeds back identical signal, merge identical recalls information.
6. system interface according to claim 4 calls the generating apparatus of record, it is characterized in that: described in call record generation module also for: add up the cumulative number based on the continuous calling system interface of identical recalls information.
7. system interface according to claim 4 calls the generating apparatus of record, it is characterized in that, also comprises:
Recalls information acquisition module, for tackling respectively the call request of each layer system interface and generating interception object respectively; The sequencing called according to each layer by each interception object is stacked; By the order that last in, first out each interception object in storehouse carried out popping and process and add end time stamp corresponding to moment of popping; According to the recalls information of the corresponding each layer system interface of each interception object acquisition after popping.
8. system interface according to claim 7 calls the generating apparatus of record, it is characterized in that: described system interface is divided into according to the sequencing called: WEB layer, operation layer, data Layer.
CN201310699613.4A 2013-12-18 2013-12-18 Generation method and device for system interface call records Pending CN104731564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310699613.4A CN104731564A (en) 2013-12-18 2013-12-18 Generation method and device for system interface call records

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310699613.4A CN104731564A (en) 2013-12-18 2013-12-18 Generation method and device for system interface call records

Publications (1)

Publication Number Publication Date
CN104731564A true CN104731564A (en) 2015-06-24

Family

ID=53455490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310699613.4A Pending CN104731564A (en) 2013-12-18 2013-12-18 Generation method and device for system interface call records

Country Status (1)

Country Link
CN (1) CN104731564A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229619A (en) * 2016-03-23 2017-10-03 阿里巴巴集团控股有限公司 Internet service link calls statistics, methods of exhibiting and the device of situation
CN108076483A (en) * 2018-01-30 2018-05-25 努比亚技术有限公司 Merge communication means, mobile terminal, server and computer readable storage medium
CN109286191A (en) * 2018-11-22 2019-01-29 国网江苏省电力有限公司 The cruising inspection system and method for J2EE power business application system based on ASM
CN109992329A (en) * 2019-03-27 2019-07-09 南京联创北斗技术应用研究院有限公司 A kind of method grade method for analyzing performance based on rear end grain technology
CN111782182A (en) * 2020-06-29 2020-10-16 联通(浙江)产业互联网有限公司 Java Web interface request statistical method, computer equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344865A (en) * 2008-08-15 2009-01-14 中兴通讯股份有限公司 CPU occupancy rate measuring method and apparatus
CN102681886A (en) * 2011-04-14 2012-09-19 天脉聚源(北京)传媒科技有限公司 Method and system for tracking user behaviors on mobile equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344865A (en) * 2008-08-15 2009-01-14 中兴通讯股份有限公司 CPU occupancy rate measuring method and apparatus
CN102681886A (en) * 2011-04-14 2012-09-19 天脉聚源(北京)传媒科技有限公司 Method and system for tracking user behaviors on mobile equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229619A (en) * 2016-03-23 2017-10-03 阿里巴巴集团控股有限公司 Internet service link calls statistics, methods of exhibiting and the device of situation
CN107229619B (en) * 2016-03-23 2020-07-28 阿里巴巴集团控股有限公司 Method and device for counting and displaying calling condition of internet service link
CN108076483A (en) * 2018-01-30 2018-05-25 努比亚技术有限公司 Merge communication means, mobile terminal, server and computer readable storage medium
CN109286191A (en) * 2018-11-22 2019-01-29 国网江苏省电力有限公司 The cruising inspection system and method for J2EE power business application system based on ASM
CN109992329A (en) * 2019-03-27 2019-07-09 南京联创北斗技术应用研究院有限公司 A kind of method grade method for analyzing performance based on rear end grain technology
CN109992329B (en) * 2019-03-27 2020-05-01 南京联创北斗技术应用研究院有限公司 Method-level performance analysis method based on back-end tangent plane technology
CN111782182A (en) * 2020-06-29 2020-10-16 联通(浙江)产业互联网有限公司 Java Web interface request statistical method, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN111625452B (en) Flow playback method and system
CN111767143B (en) Transaction data processing method, device, equipment and system
CN103559118B (en) A kind of method for auditing safely based on AOP and annotating information system
CN104731564A (en) Generation method and device for system interface call records
US10983815B1 (en) System and method for implementing a generic parser module
CN104731650A (en) Acquisition method and device for system interface call information
CN104104717A (en) Inputting channel data statistical method and device
CN107908680A (en) Management method, electronic device and the computer-readable recording medium of wechat public platform
CN109493043A (en) The blocking method, apparatus of transaction record, electronic equipment and storage medium
CN109656778A (en) Data capture method, device, computer equipment and storage medium
CN110297616B (en) Method, device, equipment and storage medium for generating speech technology
CN106648666A (en) User interface generating method and user interface generating system
CN109522139A (en) A kind of tables of data service creation call method, device, equipment and storage medium
CN106649164A (en) Hardware interface management method
CN104852939A (en) Capability interface deploying method and system
CN105491078A (en) Data processing method and device in SOA system, and SOA system
CN103324713A (en) Data processing method and device in multistage server and data processing system
CN110069533B (en) Event subscription method and device based on blockchain
CN114510262A (en) Interface request parameter verification method and device
CN106888264A (en) A kind of method for interchanging data and device
CN110442601A (en) A kind of method and apparatus that Openstack mirror image data accelerates parallel
CN106990974A (en) A kind of APP applications update method, device and electronic equipment
CN107769934A (en) Rate processing method and processing device
CN107479870A (en) A kind of third party's class libraries call method, device, mobile terminal and storage medium
CN103561113A (en) Web Service interface generating method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150624

RJ01 Rejection of invention patent application after publication