Access behavior log collection method, device, computer equipment and storage medium

By obtaining API interface data assembled access links and extracting database audit information, and combining with the tags of user access behavior events, the problem of high cost of user access behavior log collection in the prior art is solved, and the application interface for user access data is realized and effective sorting of paths and database-level correlation.

CN113360799BActive Publication Date: 2024-11-05SHENZHEN HONGTU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110629070.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-03
Publication Date
2024-11-05
Estimated Expiration
2041-06-03

AI Technical Summary

Technical Problem

The existing technology requires the application to be transformed when collecting user access behavior logs, resulting in high development costs and high maintenance costs. It is impossible to associate the user access data behavior at the database level, and the application interface and application interface paths for users to access data. Carry out the work.

Method used

By obtaining the data transmitted on the API interface, assembling the access link, extracting database audit information, and associating the user access behavior log based on the tags of user access behavior events, and collecting user access behavior logs in combination with the collection configuration information, realizing log collection without the need to transform the application. Reduce maintenance costs and associate users' behavior of accessing data to the database level.

Benefits of technology

It realizes the collection of user access behavior logs without the need to transform the application, reduces development and maintenance costs, and can sort out the application interface and application interface paths of users' access data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113360799B_ABST
    Figure CN113360799B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses an access behavior log collection method, device, computer equipment and storage medium. The method includes: obtaining data to be processed; assembling access links for data related to database access in the data to be processed to obtain an access link information graph based on an application interface; extracting database audit information and associating the database audit information to obtain three-layer associated audit information; obtaining the label of the user access behavior event defined by the terminal to obtain a data label; obtaining the URL accessed by the user to obtain the URL to be associated; associating the URL to be associated with the API interface to obtain an associated result; setting collection configuration information; collecting user access behavior logs. By implementing the method of the embodiment of the present invention, it is possible to achieve that there is no need to modify the application, no secondary development is required at the code level, there is no invasiveness to the original business, the maintenance cost is low, and the user's access data behavior is associated to the database level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a log collection method, and more specifically to an access behavior log collection method, device, computer equipment and storage medium. Background Art

[0002] User access behavior refers to the behavior of users visiting websites or APPs and other platforms. User access behavior logs are logs used to record user access behavior. User access behavior logs are widely used because of their value in auditing, behavior analysis, user profiling, and business recommendations. Currently, the collection content of user access behavior logs mainly includes users, access time, access objects, access data, and access results. At present, the most commonly used method of collecting user access behavior logs includes code embedding such as js / sdk to collect user access behavior logs, but this method requires the application to be modified and secondary development at the code level, which has high development costs; each time the log is collected, secondary development is required, the code needs to be modified and run, which is invasive to the original business; collecting or not collecting or adding / reducing user behavior logs, etc., all require maintenance at the code level, which has high maintenance costs; the collection cycle is long; it is impossible to associate the user's access data behavior with the database level; it is impossible to sort out the application interface and application interface path of the user's access data.

[0003] Therefore, it is necessary to design a new method to collect user access behavior logs without the need to modify the application or perform secondary development at the code level. It is non-invasive to the original business and has low maintenance costs. The user's data access behavior is associated with the database level; the application interface and application interface path of the user's access data are sorted out. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer equipment and storage medium for collecting access behavior logs.

[0005] To achieve the above object, the present invention adopts the following technical solution: a method for collecting access behavior logs, comprising:

[0006] Acquire data transmitted on the API interface to obtain data to be processed; assemble access links for data related to database access in the data to be processed to obtain an access link information graph based on the application interface; extract database audit information according to the access link information graph, and associate the database audit information to obtain three-layer associated audit information; obtain the label of the user access behavior event defined by the terminal to obtain the data label; obtain the URL accessed by the user to obtain the URL to be associated; associate the URL to be associated with the API interface according to the data label to obtain the association result; set the collection configuration information of the user access behavior log; collect the user access behavior log according to the association result, the collection configuration information, the access link information graph and the three-layer associated audit information.

[0007] A further technical solution is: the step of obtaining the label of the user access behavior event defined by the terminal to obtain the data label includes:

[0008] The terminal starts a browser plug-in and uses the browser plug-in to intercept request information or response information of user interaction actions; the terminal locates the URL and field corresponding to the user's access to the specified page data based on the intercepted information; the terminal defines the user access behavior event for the URL and field corresponding to the user's access to the specified page data to obtain a label for the user access behavior event; and the label of the user access behavior event is obtained to obtain a data label.

[0009] A further technical solution is: the terminal defines a user access behavior event for the URL and field corresponding to the page data designated by the user to obtain a label of the user access behavior event, including:

[0010] The terminal defines the URL and field of the access event name and remark information corresponding to the page data designated by the user to obtain the label of the user access behavior event.

[0011] A further technical solution is: associating the URL to be associated with the API interface according to the data tag to obtain an association result, including:

[0012] Match the corresponding API interface of the URL to be associated to obtain the target API interface; associate the field corresponding to the URL to be associated with the field corresponding to the target API interface; associate the access event name and remark information corresponding to the field corresponding to the URL to be associated in the data tag with the field corresponding to the target API interface to obtain the association result.

[0013] A further technical solution is: matching the corresponding API interface to the URL to be associated to obtain the target API interface includes:

[0014] Perform information segmentation on the URL to be associated to obtain an access URL path; perform segmentation on the access URL path to obtain a first ordered array; perform information segmentation and path segmentation on the API interface to obtain a second ordered array; traverse the first ordered array, and compare the values ​​at the same position of the first ordered array with the second ordered array to determine the API interface that is successfully matched by the URL to be associated; mark the API interface that is successfully matched by the URL to be associated to obtain a target API interface.

[0015] Its further technical solution is: the collection configuration information includes the user access behavior name, the collection switch, the API interface for collecting the user access behavior log, and the fields in the API interface for collecting the user access behavior log.

[0016] Its further technical solution is: collecting user access behavior logs according to the association results, collection configuration information, access link information graph and three-layer association audit information includes:

[0017] Filter out links related to the API interface for collecting user access behavior logs from the access link information graph to obtain the link to be determined; determine whether there is a database access interface node in the link to be determined; if there is a database access interface node in the link to be determined, obtain the three-layer associated audit information related to the database access interface node, and extract information related to the user access behavior from the obtained three-layer associated audit information, and count the number of accessed data and the amount of accessed data to obtain target information; store the target information in the log cache area; if there is no database access interface node in the link to be determined, extract information related to the user access behavior through the link to be determined, and count the number of accessed data and the amount of accessed data to obtain the target information, and execute the storage of the target information in the log cache area.

[0018] The present invention also provides an access behavior log collection device, comprising:

[0019] A data acquisition unit for acquiring data transmitted on an API interface to obtain data to be processed; a link assembly unit for assembling access links for data related to database access in the data to be processed to obtain an access link information graph based on an application interface; an audit processing unit for extracting database audit information based on the access link information graph and associating the database audit information to obtain three-layer associated audit information; a label acquisition unit for acquiring labels of user access behavior events defined by a terminal to obtain data labels; a URL acquisition unit for acquiring URLs accessed by users to obtain URLs to be associated; an association unit for associating the URLs to be associated with the API interface based on the data labels to obtain association results; a configuration setting unit for setting collection configuration information for user access behavior logs; a collection unit for collecting user access behavior logs based on the association results, collection configuration information, access link information graphs, and three-layer associated audit information.

[0020] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.

[0021] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0022] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention obtains user access behavior data and application interface transmission data collected based on bytecode enhancement technology, assembles user access links based on the data, and performs three-layer association between users, applications and databases. In combination with a browser plug-in, the terminal defines user access behavior events that need to be collected for accessing pages, and associates the three-layer associated audit information with the API interface line according to the defined tags, and combines the set collection configuration information to collect user access behavior logs. When collecting user access behavior logs, there is no need to modify the application, no need to perform secondary development at the code level, no invasiveness to the original business, low maintenance cost, and the behavior of user access data is associated with the database level; the application interface and application interface path of the user access data are sorted out.

[0023] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 A schematic diagram of an application scenario of the access behavior log collection method provided by an embodiment of the present invention;

[0026] Figure 2 A flowchart of a method for collecting access behavior logs provided by an embodiment of the present invention;

[0027] Figure 3 A schematic diagram of a sub-process of the access behavior log collection method provided by an embodiment of the present invention;

[0028] Figure 4 A schematic diagram of a sub-process of the access behavior log collection method provided by an embodiment of the present invention;

[0029] Figure 5 A schematic diagram of a sub-process of the access behavior log collection method provided by an embodiment of the present invention;

[0030] Figure 6 A schematic diagram of a sub-process of the access behavior log collection method provided by an embodiment of the present invention;

[0031] Figure 7 A schematic block diagram of an access behavior log collection device provided by an embodiment of the present invention;

[0032] Figure 8 A schematic block diagram of an association unit of an access behavior log collection device provided in an embodiment of the present invention;

[0033] Fig. 9 A schematic block diagram of a matching subunit of an access behavior log collection device provided by an embodiment of the present invention;

[0034] Fig.10 A schematic block diagram of a collection unit of an access behavior log collection device provided in an embodiment of the present invention;

[0035] Fig.11 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0037] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0038] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0039] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0040] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of the access behavior log collection method provided in an embodiment of the present invention. Figure 2A schematic flow chart of the access behavior log collection method provided by an embodiment of the present invention. The access behavior log collection method is applied to a management server. The management server interacts with the terminal and the application server for data, wherein the application server collects the data transmitted on the API interface and transmits it to the management server, the management server performs link assembly and three-layer audit information processing on the data, the terminal is used to define the user access behavior event, the management server associates the data transmitted on the API interface with the user access behavior event defined by the terminal, and collects the user access behavior log through the collection configuration information set by the management server. In addition, an agent, i.e., an application client, is installed on the application server, the application client communicates with the management end, the management end is generally a separate server, and the collection strategy set in the management end is pushed to the application client in real time, and the actual collection strategy is set in combination with the collection switch built into the application client. When the data initiated by the user through the user terminal passes through the specified interface of the application client, the application client intercepts the data using byte enhancement technology, and collects the intercepted data using the actual collection strategy, and caches the collected data.

[0041] Figure 2 FIG. 1 is a flow chart of the access behavior log collection method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S180.

[0042] S110: Acquire data transmitted on the API interface to obtain data to be processed.

[0043] In this embodiment, the data to be processed refers to data transmitted on the API interface, such as user identification, protocol, request and response data, and data formed after the link ID and access context information are written on the data.

[0044] Specifically, the application client on the application server obtains the collection strategy from the management end; according to the collection strategy, the switch mode is used to set the actual collection strategy; the byte enhancement technology is used to intercept the access data; according to the actual collection strategy, the user behavior data and application transmission data, such as user identification, protocol, request and response data, are collected from the intercepted data in combination with the linkage mechanism to obtain the data to be processed. The collection strategy includes at least one of data collection methods: data collection based on user identification configuration, data collection based on application service configuration, data collection based on application interface, data collection based on fields of application interface, data collection based on configured frequency, and data collection based on configured single data collection amount.

[0045] Compared with network traffic collection and application gateway deployment collection, which are limited to specific network areas and deployment locations, and the collection scope is limited, this embodiment is deployed on the application service host in the form of a client, that is, an application client. The deployment is simple, the collection scope is not limited, and there is a unified management end to uniformly configure and manage the application client; on the management end, a single or combined data collection strategy can be configured based on application services, user identifiers, application interfaces, application interface fields, collection frequency, and data collection volume to collect user behavior data, application transmission data, and application asset data, so as to achieve controllability of data collection. By changing the collection strategy on the management end, the application client's data collection strategy can be changed to achieve controllability of data collection. The data collection strategy can be quickly configured without the need for fixed-point data collection development, which saves manpower, greatly shortens the development cycle, and improves work and project efficiency; there is no need to collect user behavior data, application transmission data, and application asset data at buried points and two openings, which reduces the operation and maintenance of the application and the impact on the application system, thereby more guaranteeing the normal operation of the application. During deployment, it is deployed on the application service host in client mode, and a unified management terminal performs unified configuration management on the application client; it has no impact on the application system architecture and has no impact on the existing network architecture.

[0046] Specifically, the above-mentioned data collection method based on user identification configuration for data collection refers to whether to collect application transmission data based on user identification configuration, specifying that a single, multiple or all users can or cannot collect user behavior data, application transmission data and application asset data, wherein the user identification includes the user account accessed, the access IP, the access mac, the access browser, etc. The data collection method based on application service configuration for data collection refers to whether to collect application transmission data and application asset data based on application service configuration, specifying that a single, multiple or all application services can or cannot collect application transmission data. The data collection method based on application interface for data collection refers to whether to collect application transmission data and application asset data based on application interface, specifying that a single, multiple or all application interfaces can or cannot collect application transmission data. The data collection method based on the field of application interface for data collection refers to whether the field configuration of application interface collects application transmission data, which is mainly controlled by the interface field on the interface name, and specifies that a single, multiple or all application interface fields can or cannot collect application transmission data. The data collection method based on the configured frequency for data collection is controlled by the time period of data collection. The data collection method based on the configured single data collection amount for data collection is mainly controlled by the number of data items to be collected. Any combination of the above data collection methods configures whether to collect application transmission data, such as allowing the collection of behavior data of a certain user accessing a certain interface or not allowing the collection of behavior data of a specified or all users accessing a specified application service; thereby forming a collection strategy.

[0047] In this embodiment, the actual collection strategy refers to the strategy actually used to collect data, which is a combination of the collection strategy transmitted by the client and the set switch mode to form a variety of data collection strategies, and these data collection strategies are executed in sequence according to the set priority.

[0048] In this embodiment, the switch mode includes at least one of a switch for setting data collection based on application services, a switch for setting data collection based on user identification, a switch for setting data collection based on application interfaces, and a switch for setting data collection based on fields of application interfaces; the switch mode also includes a periodic threshold for data collection and filtering rules based on the amount of data collected for a single time.

[0049] Specifically, the mode of setting the switch for data collection based on the application service means that when the status is enabled, the application client will turn on the data collection function of the application service, which is a prerequisite for the collection function to work normally; when the status is closed, the application client will turn off the collection function of the application service, and all collection functions under this application service will be turned off.

[0050] The mode of setting the switch of data collection based on user identification means that when the status is enabled, the application client turns on the data collection function based on user identification; when the status is disabled, the application client turns off the data collection function based on user identification, but other collection switches and data collection are not affected, and data is no longer collected based on user identification. The mode of setting the switch of data collection based on application interface means that when the status is enabled, data collection is performed on all application interfaces by default, and data collection or non-collection can also be defined for the specified interface, where the specified interface can be a single, multiple, or all interface names combined with a label for collection or non-collection; when the status is disabled, the data collection function based on the application interface under this application service will be disabled by default, but data can be collected for the specified interface, such as a single, multiple, or all interface names combined with a label for collection, and other collection switches and data collection are not affected. The mode of setting the switch of data collection based on the field of the application interface means that when the state is enabled, data collection is performed on all interfaces and all fields by default, and the data of the specified interface and specified field, such as a single, multiple or all interface names plus the field name of the corresponding interface and the data not to be collected, will not be collected; when the state is closed, the data collection function based on the application interface field will be closed, but other collection switches and data collection will not be affected, but the application transmission data will no longer be collected based on the application interface field, but the data of the specified interface and specified field, such as a single, multiple or all interface names plus the field name of the corresponding interface and the data to be collected will be collected, and other collection switches and data collection will not be affected. The cycle threshold of data collection is to control the data to be collected by counting the time cycle of the collected data, and the data subject to be collected is a single application service, the application interface in the service and the interface field; the filtering rule based on the collection amount of a single data is to extract and filter the number of data items for a single application service, the application interface in the service and the interface field, and the filtering will be carried out by pre-data extraction, post-data extraction, random extraction, data extraction from a specific data point and other methods.

[0051] The management end establishes a two-way communication channel with the application client, and can send instructions to the application client at any time. The application client can also execute according to the instructions and return the execution results. The application client can also actively send information such as the status of the application client to the management end through this two-way communication channel. During the initial installation, after the application client and the management end establish communication, the management end can push the collection strategy according to the application client group or according to a single application client. When the data collection strategy is updated, the strategy will also be pushed in real time. The application client executes different data collection logic according to the different collection instructions in the collection strategy based on the received data strategy, thereby achieving the function of manageable and controllable data collection.

[0052] In this embodiment, the access data refers to data initiated by the user terminal; the intercepted data refers to data passing through a designated interface of the application client.

[0053] Specifically, after the Java bytecode is generated, according to the rules defined in the Java bytecode, the generated Java bytecode is dynamically modified when it is loaded by the JVM, and the content of the enhanced function is added, so as to intercept the access data according to the content of the enhanced function to obtain the intercepted data. Using the bytecode enhancement technology, after the Java bytecode is generated, according to the rules defined in the Java bytecode, the generated Java bytecode is dynamically modified when it is loaded by the JVM (Java Virtual Machine, JavaVirtual Machine), adding the required fields or method functions, or inheriting and implementing new classes and interfaces, etc. These dynamically added fields, or method functions, or inheriting and implementing new classes and interfaces are all enhanced functions, and the enhanced functions mainly refer to the functions of automatically extracting the request parameters and return results of the method functions.

[0054] Before extracting relevant data, first determine the method functions of the class that the data of interest must pass through during a user's access. After determining these method functions, the logic of collecting data before and after calling these method functions is enhanced by bytecode technology. At this time, the application system that needs to be collected can be collected according to actual needs. The above method functions include Object first = methodd (String paramer) and / or Object second = first.methond (String paramer); first, the main content of the methodd (String paramer) method is extracted into a function with a method name of a random string, such as sdfsdfsd (paramer); then the methodd (String paramer) method is modified to:

[0055] Finally, the data collected in before() and after() will be stored in a variable in the first object, which is enhanced. In this way, the value in this variable can be passed to the before and after methods in first.methond(Stringparamer), so that the user's data can be linked together throughout the life cycle of a visit.

[0056] The extracted data includes different types of data, user identification information such as user account, IP, mac, browser, etc., user access time, access results, access interface, access data and access times, etc. However, these data are scattered in different places during the user access process. Through the above method functions, these data can be gathered together and aggregated to any data access party, that is, bytecode enhancement technology is used to intercept and aggregate all data.

[0057] When the access data flow and interface call of user access and task scheduling pass through the Agent of the application client, the application client will use bytecode enhancement technology to intercept the data passing through. The data obtained based on the bytecode enhancement technology is also the transmission data after the application layer protocol is parsed, so there is no need to parse the protocol and restore the content, so it is not affected by encryption protocols and private protocols when collecting data. There is no need to collect user behavior data, application transmission data and application asset data at the same time, which reduces the operation and maintenance of the application and the impact on the application system, so as to better ensure the normal operation of the application; it has no impact on the application system architecture and the existing network architecture. Because the application client is deployed on the application server, the application components, application host IP, and application instances can be directly collected on the application system. Combined with the above two data collection methods, the application asset data collected can be application name, application service name, application interface, application component, application host IP, application instance, database name, database IP, database port, database category, etc.

[0058] Specifically, the intercepted data stream is parsed according to the actual collection strategy to collect the required user behavior data, application transmission data and application asset data.

[0059] In this embodiment, the intercepted data is collected for user behavior data, application transmission data and application asset data according to different data collection logics in the actual collection strategy; wherein different data collection logics perform data collection according to set priorities.

[0060] In addition, the user behavior data mentioned above includes user identification, collection time, user access behavior, access interface, number of access data and access data volume. The user identification includes user account, access IP, access mac and access browser; the application transmission data includes user identification, data transmission time, all fields in the protocol, the content corresponding to all fields in the protocol, all request data transmitted and all response data transmitted; the application transmission data includes user identification, data transmission time, protocol fields such as all fields of http and RPC (Remote Procedure Call) and other protocols, protocol content such as all contents of http and RPC (Remote Procedure Call) and other protocol fields, all request data transmitted and all response data transmitted. The application asset data mentioned above includes user identification, application name, application service name, application interface, application component, application host IP, application instance, data transmission time, database name, database IP, database port, database category, etc.

[0061] In this embodiment, the above priorities are:

[0062] When multiple policies are executed, they are processed from high to low priority, and are processed from high to low according to the data collection method based on the application service configuration, the data collection method based on the configured frequency, the data collection method based on the configured single data collection amount, the data collection method based on the application interface, the data collection method based on the field of the application interface, and the data collection method based on the user identification configuration. When multiple policies conflict, they are processed according to the high priority, and are processed from high to low according to the data collection method based on the application service configuration, the data collection method based on the configured frequency, the data collection method based on the configured single data collection amount, the data collection method based on the application interface, the data collection method based on the field of the application interface, and the data collection method based on the user identification configuration. When there is a problem with the executed data collection policy logic, the application client will not execute the data collection instruction and return a failure result to the management end.

[0063] Compared with preset embedding points and fixed-point dual-opening, the data that can be collected by this embodiment is more comprehensive, and only simple configuration is required during collection, thus making the collection of user behavior data, application transmission data, and application asset data simpler and more flexible.

[0064] When collecting data, the collected data will be written with link ID and context information to form data to be processed, so as to display the user's access link and sort out the transmission path between the application interface, database, application service and application for a single user access and interface call. Use nodes to indicate access link information, where nodes include link ID, parent node number and current node number; each time a user accesses a user terminal, a globally unique identifier will be generated, which is the link ID. This link ID is used to identify a user's visit. A user's visit may involve multiple methods and interface functions in multiple services, that is, multiple processes. The data transmitted between multiple services is generally divided into a header and a body, just like http has a header and a body, RocketMQ also has MessageHeader and Message Body. The body generally contains business data. RocketMQ is a message middleware of a queue model. When a user accesses the next service, the globally unique link ID and the context information of the current node will be placed in the header of the communication data and passed to the next service. After processing a service, all interface function information under this service will be uploaded to the data receiving place to summarize the data. The contextual relationship information is identified by the parent node number and the current node number, that is, the contextual relationship information includes the number information of the parent node and the current node; the parent node number and the current node number have a strict order relationship and are identified by natural numbers. The parent node number generally comes from the current node number of the previous node. The parent node number of the first node is set to 0, and the current node is 1. When the second node receives the data of the first node, it will obtain the current node number of the first node from the context relationship and use it as the parent node number of the second node, and then use the parent node number + 1 as the current node number, and so on. Push until the node ends. The following is a schematic diagram of link access information writing: node (link ID (2fa91f5cf3941171), parent node number (0), current node number (1)), node (link ID (2fa91f5cf3941171), parent node number (1), current node number (2)), node (link ID (2fa91f5cf3941171), parent node number (2), current node number (3)), node (link ID (2fa91f5cf3941171), parent node number (3), current node number (4))...

[0065] The above link identification method is relatively convenient and clear.

[0066] S120: Assembling access links for the data related to database access in the data to be processed to obtain an access link information graph based on an application interface.

[0067] In this embodiment, the access link information graph refers to the path graph that the request and response application data passes through during the transmission process when a user accesses the application system, and also includes the transmission path of single data between application interfaces, databases, application services, and applications during a single user access and interface call.

[0068] In this embodiment, in the process of extracting data related to the database, data collection can be performed by setting an application interface for accessing the database when setting the collection strategy, thereby ensuring that the collected data to be processed are all data related to database access. Alternatively, the collection strategy may not be set and the collected data to be processed may be filtered again.

[0069] In one embodiment, the above-mentioned step S120 may include steps S121 - S122 .

[0070] S121. Filter the data to be processed to obtain data related to database access.

[0071] In this embodiment, the data related to database access refers to the data collected based on the application interface of database access.

[0072] In one embodiment, the above-mentioned step S121 may include steps S1211 - S1213 .

[0073] S1211. Extract information of application interfaces accessing all databases in the data to be processed.

[0074] In this embodiment, the information of the application interface accessed by the database refers to the user behavior data and application transmission data collected based on the application interface accessed by the database.

[0075] S1212, querying the associated data access link information based on the database access application interface;

[0076] S1213. Extract user behavior data and application transmission data of data access link information associated with all databases to obtain data related to database access.

[0077] After the collected data to be processed are aggregated, the original collected data will be filtered and the required collected data will be extracted.

[0078] S122. Assemble access links according to data related to database access to obtain an access link information graph.

[0079] In one embodiment, the above-mentioned step S122 may include steps S1221 - S1224 .

[0080] S1221. Extract nodes with the same link ID from data related to database access to obtain a target node.

[0081] In this embodiment, the target node refers to a node with the same link ID.

[0082] Nodes with the same link ID are classified for the data to be processed, so as to facilitate fault analysis and data flow analysis in subsequent application operation and maintenance management.

[0083] S1222: Extract contextual relationship information of the target node.

[0084] In this embodiment, each target node carries a link ID, a parent node number, and a current node number. Therefore, after the target node is determined, the access path direction is determined based on the contextual relationship information.

[0085] S1223. Sort the node access order according to the context relationship information to obtain a sorting result.

[0086] In this embodiment, the sorting result refers to the order in which the nodes are accessed, and is sorted in chronological order.

[0087] S1224. Extract the request and response application interface information of each node according to the sorting result to obtain an access link information graph based on the application interface.

[0088] In this embodiment, the access link information graph based on the application interface refers to an information graph composed of the access paths of the application interface of the request and response of each node.

[0089] The data access link can sort out the data paths and interface calls accessed by users, which is convenient for fault analysis and data flow analysis of application operation and maintenance management. The data access link will sort out the access sequence path and accessed data based on user or interface calls, which is convenient for security analysis and traceability analysis in security incidents.

[0090] S130. Extract database audit information according to the access link information graph, and associate the database audit information to obtain three-layer associated audit information.

[0091] In this embodiment, the three-layer associated audit information includes user access information, relevant information fields of application access objects, database objects, database IP, database account field information, database access interface field information, operation results, number of operation data rows, field information of operation data sets, access link information using application interfaces, original SQL statement information, and database operation behavior field information. Specifically, the access user, user IP, access time, access result, database access interface, database name, database IP, database connection account, operation object, operation behavior and other information are extracted to obtain the database three-layer associated audit information.

[0092] In one embodiment, the above-mentioned step S130 may include steps S131 - S139 .

[0093] S131. Based on a single data access link in the access link information graph, obtain user behavior data of accessing a database from user behavior data in data related to database access.

[0094] In this embodiment, the behavior data of a user accessing a database refers to the behavior data corresponding to when a user terminal initiates access to a web application and the web application then accesses the database.

[0095] S132: Extract user access information and related information fields of application access objects from the acquired behavior data.

[0096] In this embodiment, the user access information includes the application layer user, user IP, access time, and access result field information, and the relevant information field of the application access object includes the application end IP field information of the application access object. Based on a single data access link, the user access database system behavior data is obtained from the user behavior data, and the application layer user, user IP, access time, and access result field information is extracted from it. Based on a single data access link, the user access database system behavior data is obtained from the user behavior data, and the application end IP field information of the application access object is extracted from the user access database system behavior data.

[0097] S133, based on a single data access link in the access link information graph, extracting field information of a database object, a database IP address, and a database account number from application transmission data in data related to database access;

[0098] S134, extracting database access interface field information based on a single data access link in the access link information graph;

[0099] S135, extracting operation results, operation data row numbers, and field information of the operation data set from application transmission data in the data related to database access based on a single data access link in the access link information graph;

[0100] S136, extracting access link information using an application interface based on a single data access link in the access link information graph;

[0101] S137, extracting original SQL statement information from application transmission data in data related to database access based on a single data access link in the access link information graph;

[0102] S138, performing lexical and grammatical analysis on the original SQL statement information to obtain database operation behavior field information;

[0103] S139, store user access information, related information fields of application access objects, database objects, database IP, field information of database accounts, field information of database access interface, operation results, number of operation data rows, field information of operation data sets, access link information using application interfaces, original SQL statement information, and field information of database operation behaviors to obtain three-layer associated audit information.

[0104] Every time a user accesses a database, the user ID, database interface, and the behavior of operating the database form an access link. The accuracy of the three-layer correlation audit of the database is as high as 100%.

[0105] The method of this embodiment can associate the access of the application access user to the web server and the access of the web server to the database.

[0106] The three-layer associated audit information of the database is displayed through the following display methods and display fields.

[0107] Display in list format, set filtering conditions, filter fields are application layer users, user IP, application IP, database IP, database instance, operation type, and list display of three-layer audit information is performed.

[0108] The fields displayed in the list include: Application layer user - displays the name of the user accessing the application; User IP - displays the IP address of the user end accessing the application system; Access time - displays the time of the user access, and the display format is date + hours, minutes and seconds; Access result - displays the result of the user access, success or failure; Application IP - displays the IP address of the application end that calls the database system; Database access interface - displays the name of the database access interface; Database connection account - displays the account name of the application end connecting to the database; Database IP - displays the data IP address; Database instance - displays the database instance name or database name; Database table name - displays the database table name; Database field name - displays the database field name; Operation type - displays the operation type such as query, add, modify or delete; Operation SQL statement - displays the original SQL statement for operating the database; Operation result - displays the operation result, success or failure; Operation data row number - displays the number of rows affected by the operation data; Operation data set - click to view the sample data accessed by the user, such as query return data and user updated data; Access link - is link information, click to view the data access link information based on the application interface accessed by the user.

[0109] S140: Acquire a label of a user access behavior event defined by a terminal to obtain a data label.

[0110] In this embodiment, the data tag refers to a tag formed by annotating the name and remark information of the user access behavior event, specifically including the user access URL, the access event name for the user access URL, URL field and other remark information.

[0111] In one embodiment, see Figure 3 , the above-mentioned step S140 may include steps S141 to S144.

[0112] S141. The terminal starts a browser plug-in, and uses the browser plug-in to intercept request information or response information of a user interaction action.

[0113] In this embodiment, a browser plug-in is installed and started on the terminal, specifically, the browser plug-in is installed and started on the browser of the user accessing the application; when the user accesses the application system and performs interactive actions, the browser plug-in can be used to intercept the request information or response information of the user's interactive action. The core functions of the browser plug-in are as follows: authentication management through the management server; intercepting the request and response data when the user accesses the application by rewriting the request and receiving methods of the browser's underlying API, such as XML Http Request, and locating and analyzing the data, currently supporting ajax, fetch request and response types; performing data tag operations on the browser plug-in and synchronizing the tag data to the management platform; supported browser types: Google, Firefox, 360, QQ, Sogou. Install the plug-in through the extension program on the browser of the terminal; start the browser plug-in; based on the pop-up interactive interface on the browser, authentication and login operations are required before operation: the browser plug-in needs to be logged in and authenticated, and the login authentication comes from the user management and role management of the management server. Only users who are authorized to use the browser plug-in can log in and use it.

[0114] The user logs in to the application system on the browser and performs interactive actions of request and response based on the access page. The following examples illustrate the use of request and response: Request information refers to registering an account and entering personal information, such as name, mobile phone number, address, and email address, and performing a submission action; Response information refers to querying the user's mobile phone number and obtaining list information, such as name and mobile phone number.

[0115] In addition, when intercepting request information, the specific operations are as follows: take the example of registering an account and entering personal information, such as user account, name, mobile phone number, age, and submitting it. At this time, the plug-in will intercept the URL (Uniform Resource Locator) accessed by the user. The URL format is 'protocol type: / / server address[:port number] / path / file name[parameter=value]', and obtain the data in the request information, such as name, mobile phone number, address, email, and the fields corresponding to the data.

[0116] When intercepting response information, the specific operations are as follows: take the user account query and obtain the user list information, such as user account, name, mobile phone number, and age, as an example. At this time, the plug-in will intercept the URL accessed by the user. The URL format is 'protocol type: / / server address[:port number] / path / file name[parameter=value]', and obtain the data in the response information, such as name, mobile phone number, and the fields corresponding to the data.

[0117] S142: The terminal locates the URL and field corresponding to the page data designated by the user according to the intercepted information.

[0118] In this embodiment, the terminal copies the specified data from the page accessed by the user, and performs a two-way fuzzy match with the intercepted information by using keywords or regular expressions. When the data is matched, the fields and URLs corresponding to the matched data are obtained. If the data corresponding to different fields on the page data are different, re-positioning is performed; if the data corresponding to different fields on the page data have the same value, the page interaction and positioning action is performed again from the previous matching result to obtain the URL and field corresponding to the page data specified by the user.

[0119] Specifically, for the matching of request information and the positioning of access fields and URLs, the specified submission data such as text box / drop-down box / radio box / check box and other input data is copied from the user access page. The 'name' submission data when registering an account is used as an example. The 'name' information data entered by the user and the request data intercepted by the plug-in are fuzzily matched in both directions by using keywords or regular expressions, that is, the name will be fuzzily matched with the intercepted data, and the intercepted data will be fuzzily matched with the name. If the data is matched, the fields and URLs corresponding to the matched request data are obtained. If the data corresponding to different fields on the page are not the same, they can generally be positioned at one time. Most of the time, a URL and a field will be positioned. If there are data corresponding to different fields on the page with the same value, the user can perform page interaction and positioning actions again in the last matching result. The number of fields to be positioned should not be the same as the number of other fields as much as possible until the field and URL positioning are completed.

[0120] When matching response data and locating access fields and URLs, copy the response return data such as list fields, summary statistics, graphic statistics and other corresponding data from the user access page. Take the employee ID as an example to query and obtain the employee's personal data information. Use the 'mobile number' data returned by the query and the response data intercepted by the plug-in to perform two-way fuzzy matching by using keywords or regular expressions, that is, the mobile number will be fuzzy matched with the intercepted data, and the intercepted data will be fuzzy matched with the mobile phone. If the data is matched, the fields and URLs corresponding to the matched request data are obtained. If the data corresponding to different fields on the page are not the same, they can generally be located at one time. Most of the time, a URL and a field will be located. If there are data corresponding to different fields on the page with the same value, the user can perform page interaction and positioning actions again in the last matching result. The number of fields to be located should not be the same as the number of other fields as much as possible until the field and URL positioning are completed.

[0121] S143: The terminal defines a user access behavior event for the URL and field corresponding to the page data designated by the user, so as to obtain a label of the user access behavior event.

[0122] Specifically, the terminal defines the URL and field access event name and remark information corresponding to the page data designated by the user to obtain the label of the user access behavior event.

[0123] When the specified data on the application system page is located, the user access behavior event operation can be performed on the URL field located. The user access behavior operation mainly defines an access event for the following user access URL and makes a note on the URL field:

[0124] When users access the notes of URL events, they can customize the URL interface event name, such as URL event name "Query employee information"; when annotating the URL field, they can write the note "Mobile number" for the mobile phone number field.

[0125] S144. Obtain a label of the user access behavior event to obtain a data label.

[0126] The management server obtains the user access URL, the access event name for the user access URL, the URL field and other remark information from the terminal.

[0127] S150: Acquire the URL visited by the user to obtain the URL to be associated.

[0128] In this embodiment, the URL to be associated refers to the URL accessed by the user.

[0129] The management server obtains the URL accessed by the user from the browser plug-in, and matches the corresponding API interface according to the URL accessed by the user based on the API interface data stored on the management server.

[0130] S160: Associating the URL to be associated with the API interface according to the data tag to obtain an association result.

[0131] In this embodiment, the association result refers to the result obtained by associating the URL to be associated with the API interface.

[0132] In one embodiment, see Figure 4 , the above-mentioned step S160 may include steps S161 to S163.

[0133] S161. Match the corresponding API interface to the URL to be associated to obtain a target API interface.

[0134] In this embodiment, the target API interface refers to an array generated based on the URL to be associated and an array generated based on the API interface in which the number and value of strings are equal; the number of strings in the two arrays is a variable, and the corresponding position in the array generated based on the API interface is a variable, which is an API interface that meets these two conditions.

[0135] In one embodiment, see Figure 5 , the above-mentioned step S161 may include steps S1611 to S1615.

[0136] S1611. Segment the information of the URL to be associated to obtain an access URL path.

[0137] In this embodiment, the access URL path refers to information of a designated location in the access URL information.

[0138] Separate the protocol information from the access URL according to " / / ". Take the access URL 'https: / / host:port / app / main / user / query' as an example. In this example, it is https. Then, according to " / ", the URL is split to get 'host, port and / app / main / user / query', where ' / app / main / user / query' is the path.

[0139] S1612: Segment the access URL path to obtain a first ordered array.

[0140] In this embodiment, the first ordered array refers to an array obtained by dividing the access URL path into a single field. The path / app / main / user / query is further divided into / app, / main, / user, / query according to " / " level by level to obtain an ordered array A, thereby obtaining the first ordered array.

[0141] S1613. Perform information segmentation and path segmentation on the API interface to obtain a second ordered array.

[0142] The API interface can also be segmented according to the above steps S1411 to S1412 to obtain an ordered array B, ie, a second ordered array; details will not be repeated here.

[0143] S1614. Traverse the first ordered array, and compare the values ​​at the same position of the first ordered array and the second ordered array to determine the API interface that is successfully matched by the URL to be associated.

[0144] Traverse ordered array A and compare them one by one with the values ​​at the same position in ordered array B. In the following two cases, it is considered that the user's access URL matches the API interface successfully: one is that the number and value of strings in ordered array A and ordered array B are the same; the other is that the number of strings in ordered array A and ordered array B is a variable, and the corresponding position in ordered array B is a variable.

[0145] S1615: Mark the API interface successfully matched by the URL to be associated to obtain the target API interface.

[0146] The API interface that the user access URL successfully matches is marked with a corresponding label, indicating that the user access URL is equivalent to the successfully matched API interface.

[0147] S162: Associate the field corresponding to the URL to be associated with the field corresponding to the target API interface.

[0148] In this embodiment, when the user access URL is associated with the target API interface, the field names are compared, and the field names under the user access URL are associated with the field names under the target API interface. If the values ​​are the same, they are associated, indicating that the fields under the user access URL are equivalent to the fields under the target API interface.

[0149] S163: Associate the access event name and remark information corresponding to the field corresponding to the to-be-associated URL in the data tag with the field corresponding to the target API interface to obtain an association result.

[0150] In this embodiment, according to the access event name defined in the data tag for the URL to be associated and the remark information defined in the field under the URL, the association is passed to the associated target API interface and the same field. For example: the user accesses the URL https: / / 10.10.20.33:8443 / app / main / user / query, and the associated API interface is / app / main / user / query; the customized URL event and field remark information are as follows: URL event: Query employee information; URL field 'phone' field remark: mobile phone number; the associated application interface event is: Query employee information; the associated application interface field 'phone' remark is: mobile phone number, and the application interface here refers to the target API interface.

[0151] S170: Set collection configuration information for user access behavior logs.

[0152] In this embodiment, the collection configuration information includes the user access behavior name, the collection switch, the API interface for collecting the user access behavior log, and the fields in the API interface for collecting the user access behavior log.

[0153] Through customized management, the collection of user behavior logs can be achieved as soon as they are configured, that is, the logs can be collected immediately after configuration, with a short collection cycle and quick results.

[0154] For the target API interface associated with the user's access URL, the access event name on the target API interface, and the application interface field notes, the management server will not collect the user's access behavior log at this time. The collection configuration and management need to be performed on the management server as follows:

[0155] User access behavior name definition: Users can redefine an access behavior name, or use the access event name previously defined by the user on the browser, such as 'Query employee information'.

[0156] Collection switch: Select 'On' to collect user access behavior logs, and select 'Off' to turn off the collection of user access behavior logs.

[0157] Selection of collected application interfaces: Because the operations of user access behaviors have been located to the user access URL and ultimately to the system application interface, it is necessary to select the application interface corresponding to the user access behaviors.

[0158] Selection of collected application interface fields: After selecting the target API interface, you can select the fields under the target API interface. The fields selected here will be recorded in the log, and the specific data accessed by the user can be recorded as needed, or the sample data accessed by the user can be recorded for the selected fields.

[0159] S180. Collect user access behavior logs according to the association results, collection configuration information, access link information graph, and three-layer association audit information.

[0160] After completing the collection configuration of user access behavior logs on the management server, the management server will collect user access behavior logs based on the log collection configuration and in combination with the original collection data uploaded by the application client, three-layer correlation audit information, access link information graph, etc.

[0161] In one embodiment, see Figure 6 , the above-mentioned step S180 may include steps S181 to S185.

[0162] S181. Filter out links related to the API interface for collecting user access behavior logs from the access link information graph to obtain links to be determined.

[0163] In this embodiment, the link to be determined refers to a link in the access link information graph that is related to an API interface for collecting user access behavior logs.

[0164] Specifically, the API interface and selected fields for collecting user access behavior logs in the collection configuration information are obtained; and each user access link corresponding to the API interface is searched according to the API interface.

[0165] S182: Determine whether there is a database access interface node in the link to be determined.

[0166] Specifically, it is searched whether there is a database access interface node in the entire link corresponding to the link to be determined according to the link accessed by the user.

[0167] S183. If there is a database access interface node in the link to be determined, obtain the three-layer associated audit information related to the database access interface node, extract the information related to the user access behavior from the obtained three-layer associated audit information, and count the number of accessed data and the amount of accessed data to obtain the target information.

[0168] In this embodiment, the target information refers to the number of pieces of information related to user access behavior and the amount of access data in the three-layer associated audit information related to the database access interface node.

[0169] Specifically, the three-layer associated audit information related to the database access interface node is obtained, and the following information is extracted therefrom: application layer user, user IP, access time, accessed application, access behavior, i.e., the user access behavior name defined in the collection configuration information, application interface, accessed field, i.e., the field selected in the collection configuration information, access result, application IP, database IP, database account, SQL statement, operation behavior, operation data, operation result, user access link, requested or responded data, etc., and on this basis, the number of accessed data items and the amount of accessed data are counted.

[0170] S184: Store the target information in a log buffer area.

[0171] In this embodiment, the extracted target information is sent to a log cache area such as Kafka; all applications or systems that require user access behavior logs can obtain user access behavior logs from the log cache area after authorization.

[0172] S185. If there is no database access interface node in the link to be determined, extract information related to the user access behavior through the link to be determined, count the number of accessed data and the amount of accessed data, and execute step S184.

[0173] The following information is directly extracted through the link to be determined: application layer user, user IP, access time, access behavior, i.e. the user access behavior name defined in the collection configuration information, accessed field, i.e. the field selected in the collection configuration information, access result, application IP, user access link, requested or responded data, etc., and on this basis, the number of accessed data and the amount of accessed data are counted; and so on, until each user access link associated with this application interface and its three-layer associated information are extracted and stored.

[0174] This embodiment does not require modification of the application, does not require secondary development at the code level, and does not require the intervention of developers; because the collection of user access behavior logs does not require secondary development at the code level, there is no intrusion into the original business; the addition, editing, and deletion of log collection do not require secondary development or code modification, and customized log collection configuration information and management can be quickly performed on the management server; the user access behavior log can map the user's access data behavior to the database level; the user access behavior log can sort out the application interface and application interface path of the user's access data.

[0175] The above-mentioned access behavior log collection method obtains the user access behavior data and application interface transmission data collected based on bytecode enhancement technology, assembles the user access link based on this data, and performs three-layer association between the user, application and database. In the terminal, the browser plug-in is combined to define the user access behavior events that need to be collected for accessing the page, and the three-layer association audit information is associated with the API interface line according to the defined label, and the collection configuration information is combined to collect the user access behavior log. When collecting the user access behavior log, there is no need to modify the application, no secondary development is required at the code level, there is no invasiveness to the original business, the maintenance cost is low, and the user access data behavior is associated with the database level; the application interface and application interface path of the user access data are sorted out.

[0176] Figure 7 is a schematic block diagram of an access behavior log collection device 300 provided in an embodiment of the present invention. Figure 7 As shown, corresponding to the above access behavior log collection method, the present invention also provides an access behavior log collection device 300. The access behavior log collection device 300 includes a unit for executing the above access behavior log collection method, and the device can be configured in a server. Figure 7 The access behavior log collection device 300 includes a data acquisition unit 301, a link assembly unit 302, an audit processing unit 303, a label acquisition unit 304, a URL acquisition unit 305, an association unit 306, a configuration setting unit 307 and a collection unit 308.

[0177] The data acquisition unit 301 is used to acquire data transmitted on the API interface to obtain data to be processed; the link assembly unit 302 is used to assemble access links for data related to database access in the data to be processed to obtain an access link information graph based on the application interface; the audit processing unit 303 is used to extract database audit information according to the access link information graph, and associate the database audit information to obtain three-layer associated audit information; the label acquisition unit 304 is used to acquire the label of the user access behavior event defined by the terminal to obtain the data label; the URL acquisition unit 305 is used to acquire the URL accessed by the user to obtain the URL to be associated; the association unit 306 is used to associate the URL to be associated with the API interface according to the data label to obtain the association result; the configuration setting unit 307 is used to set the collection configuration information of the user access behavior log; the collection unit 308 is used to collect the user access behavior log according to the association result, the collection configuration information, the access link information graph and the three-layer associated audit information.

[0178] In one embodiment, the tag acquisition unit 304 is used to start a browser plug-in by the terminal, and use the browser plug-in to intercept the request information or response information of the user interaction action; the terminal locates the URL and field corresponding to the user's access to the specified page data according to the intercepted information; the terminal defines the user access behavior event for the URL and field corresponding to the user's access to the specified page data to obtain the tag of the user access behavior event; and obtains the tag of the user access behavior event to obtain a data tag.

[0179] Specifically, the tag acquisition unit 304 is used to obtain the tag of the user access behavior event by defining the URL and field access event name and remark information corresponding to the page data designated by the user through the terminal.

[0180] In one embodiment, if Figure 8 As shown, the association unit 306 includes a matching subunit 3061 , a field association subunit 3062 , and a tag association subunit 3063 .

[0181] The matching subunit 3061 is used to match the API interface corresponding to the URL to be associated to obtain the target API interface; the field association subunit 3062 is used to associate the field corresponding to the URL to be associated with the field corresponding to the target API interface; the tag association subunit 3063 is used to associate the access event name and remark information corresponding to the field corresponding to the URL to be associated in the data tag to the field corresponding to the target API interface to obtain the association result.

[0182] In one embodiment, if Fig. 9As shown, the matching subunit 3061 includes an information segmentation module 30611, a path segmentation module 30612, an array acquisition module 30613, a traversal module 30614 and a marking module 30615.

[0183] The information segmentation module 30611 is used to perform information segmentation on the URL to be associated to obtain the access URL path; the path segmentation module 30612 is used to segment the access URL path to obtain a first ordered array; the array acquisition module 30613 is used to perform information segmentation and path segmentation on the API interface to obtain a second ordered array; the traversal module 30614 is used to traverse the first ordered array and compare the values ​​at the same position of the first ordered array with the second ordered array to determine the API interface that is successfully matched by the URL to be associated; the marking module 30615 is used to mark the API interface that is successfully matched by the URL to be associated to obtain the target API interface.

[0184] In one embodiment, if Fig.10 As shown, the collection unit 308 includes a link screening subunit 3081 , a judgment subunit 3082 , a first information extraction subunit 3083 , a storage subunit 3084 and a second information extraction subunit 3085 .

[0185] The link screening subunit 3081 is used to screen out the links related to the API interface for collecting user access behavior logs from the access link information graph to obtain the link to be determined; the judgment subunit 3082 is used to determine whether there is a database access interface node in the link to be determined; the first information extraction subunit 3083 is used to obtain the three-layer associated audit information related to the database access interface node if there is a database access interface node in the link to be determined, and extract the information related to the user access behavior from the obtained three-layer associated audit information, and count the number of accessed data and the amount of accessed data to obtain the target information; the storage subunit 3084 is used to store the target information in the log cache area; the second information extraction subunit 3085 is used to extract the information related to the user access behavior through the link to be determined if there is no database access interface node in the link to be determined, and count the number of accessed data and the amount of accessed data to obtain the target information, and execute the storage of the target information in the log cache area.

[0186] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned access behavior log collection device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.

[0187] The access behavior log collection device 300 can be implemented in the form of a computer program. Fig.11 Runs on the computer device shown.

[0188] See also Fig.11 , Fig.11 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.

[0189] See also Fig.11 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0190] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute an access behavior log collection method.

[0191] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0192] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute an access behavior log collection method.

[0193] The network interface 505 is used to communicate with other devices over the network. Fig.11 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0194] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0195] Acquire data transmitted on the API interface to obtain data to be processed; assemble access links for data related to database access in the data to be processed to obtain an access link information graph based on the application interface; extract database audit information according to the access link information graph, and associate the database audit information to obtain three-layer associated audit information; obtain the label of the user access behavior event defined by the terminal to obtain the data label; obtain the URL accessed by the user to obtain the URL to be associated; associate the URL to be associated with the API interface according to the data label to obtain the association result; set the collection configuration information of the user access behavior log; collect the user access behavior log according to the association result, the collection configuration information, the access link information graph and the three-layer associated audit information.

[0196] The collection configuration information includes the user access behavior name, the collection switch, the API interface for collecting the user access behavior log, and the fields in the API interface for collecting the user access behavior log.

[0197] In one embodiment, when the processor 502 implements the step of acquiring the tag of the user access behavior event defined by the terminal to obtain the data tag, the processor 502 specifically implements the following steps:

[0198] The terminal starts a browser plug-in and uses the browser plug-in to intercept request information or response information of user interaction actions; the terminal locates the URL and field corresponding to the user's access to the specified page data based on the intercepted information; the terminal defines the user access behavior event for the URL and field corresponding to the user's access to the specified page data to obtain a label for the user access behavior event; and the label of the user access behavior event is obtained to obtain a data label.

[0199] In one embodiment, when the processor 502 implements the step of defining the user access behavior event by the terminal for the URL and field corresponding to the page data designated by the user to obtain the label of the user access behavior event, the processor 502 specifically implements the following steps:

[0200] The terminal defines the URL and field of the access event name and remark information corresponding to the page data designated by the user to obtain the label of the user access behavior event.

[0201] In one embodiment, when the processor 502 implements the step of associating the URL to be associated with the API interface according to the data tag to obtain an association result, the processor 502 specifically implements the following steps:

[0202] Match the corresponding API interface of the URL to be associated to obtain the target API interface; associate the field corresponding to the URL to be associated with the field corresponding to the target API interface; associate the access event name and remark information corresponding to the field corresponding to the URL to be associated in the data tag with the field corresponding to the target API interface to obtain the association result.

[0203] In one embodiment, when the processor 502 implements the step of matching the corresponding API interface to the URL to be associated to obtain the target API interface, the processor 502 specifically implements the following steps:

[0204] Perform information segmentation on the URL to be associated to obtain an access URL path; perform segmentation on the access URL path to obtain a first ordered array; perform information segmentation and path segmentation on the API interface to obtain a second ordered array; traverse the first ordered array, and compare the values ​​at the same position of the first ordered array with the second ordered array to determine the API interface that is successfully matched by the URL to be associated; mark the API interface that is successfully matched by the URL to be associated to obtain a target API interface.

[0205] In one embodiment, when the processor 502 implements the step of collecting the user access behavior log according to the association result, the collection configuration information, the access link information graph, and the three-layer association audit information, it specifically implements the following steps:

[0206] Filter out links related to the API interface for collecting user access behavior logs from the access link information graph to obtain the link to be determined; determine whether there is a database access interface node in the link to be determined; if there is a database access interface node in the link to be determined, obtain the three-layer associated audit information related to the database access interface node, and extract information related to the user access behavior from the obtained three-layer associated audit information, and count the number of accessed data and the amount of accessed data to obtain target information; store the target information in the log cache area; if there is no database access interface node in the link to be determined, extract information related to the user access behavior through the link to be determined, and count the number of accessed data and the amount of accessed data to obtain the target information, and execute the storage of the target information in the log cache area.

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

[0208] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0209] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:

[0210] Acquire data transmitted on the API interface to obtain data to be processed; assemble access links for data related to database access in the data to be processed to obtain an access link information graph based on the application interface; extract database audit information according to the access link information graph, and associate the database audit information to obtain three-layer associated audit information; obtain the label of the user access behavior event defined by the terminal to obtain the data label; obtain the URL accessed by the user to obtain the URL to be associated; associate the URL to be associated with the API interface according to the data label to obtain the association result; set the collection configuration information of the user access behavior log; collect the user access behavior log according to the association result, the collection configuration information, the access link information graph and the three-layer associated audit information.

[0211] The collection configuration information includes the user access behavior name, the collection switch, the API interface for collecting the user access behavior log, and the fields in the API interface for collecting the user access behavior log.

[0212] In one embodiment, when the processor executes the computer program to implement the step of acquiring the label of the user access behavior event defined by the terminal to obtain the data label, the processor specifically implements the following steps:

[0213] The terminal starts a browser plug-in and uses the browser plug-in to intercept request information or response information of user interaction actions; the terminal locates the URL and field corresponding to the user's access to the specified page data based on the intercepted information; the terminal defines the user access behavior event for the URL and field corresponding to the user's access to the specified page data to obtain a label for the user access behavior event; and the label of the user access behavior event is obtained to obtain a data label.

[0214] In one embodiment, when the processor executes the computer program to implement the step of defining the user access behavior event by the terminal for the URL and field corresponding to the page data designated by the user to obtain the label of the user access behavior event, the processor specifically implements the following steps:

[0215] The terminal defines the URL and field of the access event name and remark information corresponding to the page data designated by the user to obtain the label of the user access behavior event.

[0216] In one embodiment, when the processor executes the computer program to implement the step of associating the URL to be associated with the API interface according to the data tag to obtain an association result, the processor specifically implements the following steps:

[0217] Match the corresponding API interface of the URL to be associated to obtain the target API interface; associate the field corresponding to the URL to be associated with the field corresponding to the target API interface; associate the access event name and remark information corresponding to the field corresponding to the URL to be associated in the data tag with the field corresponding to the target API interface to obtain the association result.

[0218] In one embodiment, when the processor executes the computer program to implement the step of matching the URL to be associated with the corresponding API interface to obtain the target API interface, the processor specifically implements the following steps:

[0219] Perform information segmentation on the URL to be associated to obtain an access URL path; perform segmentation on the access URL path to obtain a first ordered array; perform information segmentation and path segmentation on the API interface to obtain a second ordered array; traverse the first ordered array, and compare the values ​​at the same position of the first ordered array with the second ordered array to determine the API interface that is successfully matched by the URL to be associated; mark the API interface that is successfully matched by the URL to be associated to obtain a target API interface.

[0220] In one embodiment, when the processor executes the computer program to implement the step of collecting the user access behavior log according to the association result, the collection configuration information, the access link information graph, and the three-layer association audit information, the processor specifically implements the following steps:

[0221] Filter out links related to the API interface for collecting user access behavior logs from the access link information graph to obtain the link to be determined; determine whether there is a database access interface node in the link to be determined; if there is a database access interface node in the link to be determined, obtain the three-layer associated audit information related to the database access interface node, and extract information related to the user access behavior from the obtained three-layer associated audit information, and count the number of accessed data and the amount of accessed data to obtain target information; store the target information in the log cache area; if there is no database access interface node in the link to be determined, extract information related to the user access behavior through the link to be determined, and count the number of accessed data and the amount of accessed data to obtain the target information, and execute the storage of the target information in the log cache area.

[0222] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0223] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0224] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0225] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0226] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0227] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. The access behavior log collection method is characterized by: include: Get the data transmitted on the API interface to obtain the data to be processed; Assembling access links for data related to database access in the data to be processed to obtain an access link information graph based on an application interface; Extracting database audit information according to the access link information graph, and correlating the database audit information to obtain three-layer correlation audit information; Obtain the label of the user access behavior event defined by the terminal to obtain the data label; Get the URL visited by the user to get the URL to be associated; Associating the URL to be associated with the API interface according to the data tag to obtain an association result; Set the collection configuration information of user access behavior logs; The user access behavior log is collected according to the association result, the collection configuration information, the access link information map and the three-layer association audit information.

2. The access behavior log collection method according to claim 1, characterized in that: The step of obtaining the label of the user access behavior event defined by the terminal to obtain the data label includes: The terminal starts a browser plug-in, and uses the browser plug-in to intercept request information or response information of user interaction actions; The terminal locates the URL and field corresponding to the user's access to the specified page data based on the intercepted information; The terminal defines the user access behavior event for the URL and field corresponding to the page data designated by the user, so as to obtain the label of the user access behavior event; Get the label of the user access behavior event to get the data label.

3. The access behavior log collection method according to claim 2, characterized in that: The terminal defines the user access behavior event for the URL and field corresponding to the page data designated by the user to obtain the label of the user access behavior event, including: The terminal defines the URL and field of the access event name and remark information corresponding to the page data designated by the user to obtain the label of the user access behavior event.

4. The access behavior log collection method according to claim 1, characterized in that: The associating the URL to be associated with the API interface according to the data tag to obtain an association result includes: Match the corresponding API interface to the URL to be associated to obtain the target API interface; Associating the field corresponding to the URL to be associated with the field corresponding to the target API interface; The access event name and remark information corresponding to the field corresponding to the to-be-associated URL in the data tag are associated with the field corresponding to the target API interface to obtain an association result.

5. The access behavior log collection method according to claim 4, characterized in that: The step of matching the corresponding API interface to the URL to be associated to obtain the target API interface includes: Segmenting the information of the URL to be associated to obtain an access URL path; Segmenting the access URL path to obtain a first ordered array; Performing information segmentation and path segmentation on the API interface to obtain a second ordered array; Traversing the first ordered array, and comparing the values ​​at the same position of the first ordered array with the values ​​at the second ordered array, to determine the API interface successfully matched by the URL to be associated; The API interface successfully matched by the URL to be associated is marked to obtain the target API interface.

6. The access behavior log collection method according to claim 1, characterized in that: The collection configuration information includes the user access behavior name, the collection switch, the API interface for collecting the user access behavior log, and the fields in the API interface for collecting the user access behavior log.

7. The access behavior log collection method according to claim 6, characterized in that: The collecting of user access behavior logs according to the association result, the collection configuration information, the access link information graph and the three-layer association audit information includes: Filter out links related to the API interface for collecting user access behavior logs from the access link information graph to obtain links to be determined; Determining whether there is a database access interface node in the link to be determined; If there is a database access interface node in the link to be determined, then obtain the three-layer correlation audit information related to the database access interface node, extract the information related to the user access behavior from the obtained three-layer correlation audit information, and count the number of accessed data and the amount of accessed data to obtain the target information; Storing the target information in a log buffer area; If there is no database access interface node in the link to be determined, the information related to the user access behavior is extracted through the link to be determined, and the number of accessed data and the amount of accessed data are counted to obtain target information, and the target information is stored in the log cache area.

8. The access behavior log collection device is characterized by: include: A data acquisition unit is used to acquire data transmitted on the API interface to obtain data to be processed; A link assembly unit, used for assembling access links for data related to database access in the data to be processed, so as to obtain an access link information graph based on an application interface; An audit processing unit, configured to extract database audit information according to the access link information graph, and associate the database audit information to obtain three-layer associated audit information; A label acquisition unit, used to acquire a label of a user access behavior event defined by a terminal to obtain a data label; A URL acquisition unit is used to acquire the URL accessed by the user to obtain the URL to be associated; An associating unit, used to associate the URL to be associated with the API interface according to the data tag to obtain an association result; A configuration setting unit, used to set the collection configuration information of the user access behavior log; The collection unit is used to collect user access behavior logs according to the association results, collection configuration information, access link information graph and three-layer association audit information.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 can be implemented.