CN113608955A - Log recording method, device, equipment and storage medium - Google Patents

Log recording method, device, equipment and storage medium Download PDF

Info

Publication number
CN113608955A
CN113608955A CN202110742084.6A CN202110742084A CN113608955A CN 113608955 A CN113608955 A CN 113608955A CN 202110742084 A CN202110742084 A CN 202110742084A CN 113608955 A CN113608955 A CN 113608955A
Authority
CN
China
Prior art keywords
data
operation function
function
log
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110742084.6A
Other languages
Chinese (zh)
Other versions
CN113608955B (en
Inventor
卢旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing New Oxygen World Wide Technology Consulting Co ltd
Original Assignee
Soyoung Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Soyoung Technology Beijing Co Ltd filed Critical Soyoung Technology Beijing Co Ltd
Priority to CN202110742084.6A priority Critical patent/CN113608955B/en
Publication of CN113608955A publication Critical patent/CN113608955A/en
Application granted granted Critical
Publication of CN113608955B publication Critical patent/CN113608955B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a log recording method, a device, equipment and a storage medium, wherein the method comprises the following steps: configuring a target operation function to be monitored in a filter and configuring a target field in an interpreter; acquiring pre-processing data and post-processing data corresponding to the target operation function through a filter; and recording the log data corresponding to the target operation function according to the pre-processing data, the post-processing data and the target field configured in the interpreter. In the application, developers do not need to know the specific details of log records, maintain log related interfaces and complete configuration only through the unified configuration interface, so that the learning cost is low, the development efficiency is high and the error rate is low. And the log and the service are decoupled and do not influence each other, so that the maintainability of the program is improved. And the queried log data are visually displayed according to a time axis, and the displayed log data are text data which are explained by the interpreter, so that the readability is high. And modified data can be highlighted, so that the log query efficiency is improved.

Description

Log recording method, device, equipment and storage medium
Technical Field
The present application belongs to the technical field of data processing, and in particular, to a log recording method, apparatus, device, and storage medium.
Background
The function of the operation log is to record all operations of the operator in the application. The operation log is used for recording the time, content and the like of each operation of the operator. Recording the operation log is very important for problem backtracking, behavior tracing, positioning error, data statistics and the like.
Currently, some log recording methods are provided in the related art, and one method is to record user-defined information by using a log framework and store the recorded information in a file, a database or a cloud. However, the method mainly aims at the problem troubleshooting and tracking of developers, business personnel generally cannot check the logs through a panel, and the data format of the displayed logs is not intuitive. Another method is to embed the log record behavior in the service code of each layer, so as to realize the customized scene required by the service. However, log records are closely coupled with services, developers need to develop a set of logs while developing the services, the work is repeated and tedious, errors are prone to occurring, once the main body structure of the logs is changed, all program codes need to be modified, and the logs are not easy to maintain.
Disclosure of Invention
The application provides a log recording method, a device, equipment and a storage medium, developers do not need to know the specific details of log recording, do not need to maintain log related interfaces, and only need to complete related configuration, so that the learning cost is low, the development efficiency is high, and the error rate is low. And the log and the service are decoupled and do not influence each other, so that the maintainability of the program is improved.
An embodiment of a first aspect of the present application provides a log recording method, including:
configuring a target operation function to be monitored in a filter and configuring a target field in an interpreter;
acquiring pre-processing data and post-processing data corresponding to the target operation function through the filter;
and recording log data corresponding to the target operation function according to the pre-processing data, the post-processing data and a target field configured in the interpreter.
In some embodiments of the present application, the configuring, in the filter, an objective operation function to be monitored includes:
configuring a function name of a target operation function to be monitored in a filtering parameter of a behavior function included in a filter;
generating a monitoring detail array corresponding to the target operation function according to the function name, the logic type, the service main key, the additional information, the class name of the callback function and the callback function name of the target operation function;
and configuring the monitoring detail array in the monitoring object parameters of the behavior function.
In some embodiments of the present application, said configuring the target field in the interpreter includes:
configuring one or more target fields in a defined field function included in the interpreter;
and configuring corresponding translation texts for each target field.
In some embodiments of the present application, the obtaining, by the filter, pre-processing data and post-processing data before and after processing of the target operation function includes:
receiving a data modification request, and determining a first operation function required to be executed in response to the data modification request;
determining whether the first operation function is configured in the filter;
if yes, acquiring a monitoring detail array of the first operation function from the monitoring object parameters of the behavior function in the filter;
and acquiring the data before processing and the data after processing before executing the first operation function according to the acquired monitoring detail array.
In some embodiments of the present application, the determining whether the first operation function is configured in the filter comprises:
acquiring a function name of the first operation function;
acquiring function names of all target operation functions included in the filtering parameters of the behavior function in the filter;
and if the function name included in the filtering parameter includes the function name of the first operation function, determining that the first operation function is configured in the filtering.
In some embodiments of the present application, the acquiring, according to the acquired array of monitoring details, pre-processing data before executing the first operation function and post-processing data after executing the first operation function includes:
acquiring the class name and the callback function name of the callback function corresponding to the first operation function from the monitoring detail array;
calling a callback function corresponding to the first operation function according to the acquired class name and the callback function name;
acquiring pre-processing data for the data modification request before the first operation function is executed through a callback function corresponding to the first operation function;
and after the first operation function is executed, acquiring the processed data corresponding to the data modification request through a callback function corresponding to the first operation function.
In some embodiments of the present application, the recording log data corresponding to the target operation function according to the pre-processing data, the post-processing data, and a target field configured in the interpreter includes:
if the pre-processing data is different from the post-processing data, judging whether a target field configured in the interpreter contains a modified field corresponding to the pre-processing data and the post-processing data;
if so, generating log data corresponding to the execution of the target operation function at this time, and storing the log data into a database, wherein the log data comprises a logic type corresponding to the target operation function, a service main key, the data before processing, the data after processing and corresponding modification time;
and if the modified field is not configured in the interpreter or the data before processing is the same as the data after processing, not recording the log data corresponding to the execution of the target operation function at this time.
In some embodiments of the present application, the method further comprises:
receiving a log query request, wherein the log query request comprises a logic type and a service main key corresponding to a target operation function to be queried;
acquiring all log data corresponding to a target operation function to be inquired from the database according to the logic type and the service main key;
respectively translating the target field included in each acquired log data through the mapping relation between the target field configured in the interpreter and the translation text;
and displaying all the translated log data.
In some embodiments of the present application, the displaying all the acquired log data includes:
according to the modification time included in each acquired log data, a time axis corresponding to the target operation function to be inquired is established;
mapping and arranging each log data and the modification time corresponding to the log data on the time axis respectively;
and displaying the time shaft and each arranged log data.
In some embodiments of the present application, the method further comprises:
determining modified data corresponding to the pre-processing data and the post-processing data included in the log data;
marking the modified data in the data before processing and the data after processing according to a preset marking mode;
and displaying the marked data before processing and the marked data after processing.
An embodiment of a second aspect of the present application provides a logging apparatus, including:
the configuration module is used for configuring a target operation function to be monitored in the filter and configuring a target field in the interpreter;
the acquisition module is used for acquiring the pre-processing data and the post-processing data corresponding to the target operation function through the filter;
and the log recording module is used for recording the log data corresponding to the target operation function according to the pre-processing data, the post-processing data and the target field configured in the interpreter.
Embodiments of the third aspect of the present application provide an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method of the first aspect.
An embodiment of a fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, the program being executable by a processor to implement the method of the first aspect.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
in the embodiment of the application, the log data of the target operation function can be recorded by configuring the target operation function to be monitored in the filter and configuring the target field to be concerned in the interpreter, developers do not need to know the specific details of the log recording process, do not need to maintain the query interface of the log, and only need to complete the configuration operation through a uniform configuration interface, so that the learning cost is low, the development efficiency is high, and the error rate is reduced. And log records are decoupled from specific services, and the log and the specific services are not mutually influenced, so that the maintainability of service programs is improved. And all log data inquired are visually displayed according to a time axis when the log is inquired, and the displayed log data are text data subjected to text interpretation by an interpreter, so that the readability is high. And the modification data can be marked and highlighted during display, so that a user can directly look up the modification data, and the efficiency of inquirers is greatly improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings.
In the drawings:
FIG. 1 is a flow chart illustrating a method of logging provided by an embodiment of the present application;
FIG. 2 illustrates another flow chart of a method of logging provided by an embodiment of the present application;
FIG. 3 is a diagram illustrating a display log query result provided by an embodiment of the present application;
FIG. 4 is a schematic flow chart illustrating logging and querying provided by an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a structure of a logging apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic diagram of a storage medium according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which this application belongs.
A method, an apparatus, a device and a storage medium for logging according to embodiments of the present application are described below with reference to the accompanying drawings.
Currently, some methods for logging exist in the related art, such as using a log framework to record user-defined information, and storing the recorded information in a file, a database, or a cloud. However, the method mainly aims at the problem troubleshooting and tracking of developers, business personnel generally cannot check the logs through a panel, and the data format of the displayed logs is not intuitive. In another way, the logging behavior is nested in the service code of each layer, so that the customized scene required by the service can be realized. However, log records are closely coupled with services, developers need to develop a set of logs while developing the services, the work is repeated and tedious, errors are prone to occurring, once the main body structure of the logs is changed, all program codes need to be modified, and the logs are not easy to maintain. The other mode is that all requests are recorded through a project system interceptor, similar to an nginx access log, unified entry can be performed for service decoupling, but only request data is recorded, the request data cannot be bound with a service main key, data mixing cannot be performed for service customization, and the method is also not intuitive.
Based on the problems in the related art, the embodiment of the application provides a log recording method, the method can record the log data of the target operation function by configuring the target operation function to be monitored in the filter and configuring the target field to be concerned in the interpreter, developers do not need to know the specific details of the log recording process and maintain the query interface of the log, and the development efficiency is greatly improved. And log records are decoupled from specific services, and the log and the specific services are not mutually influenced, so that the maintainability of service programs is improved. And all log data inquired are visually displayed according to a time axis when the logs are inquired, and the displayed log data are text data after text interpretation by the interpreter, so that the readability is high, the display interface is simpler, and the efficiency of inquirers is greatly improved.
Referring to fig. 1, the method specifically includes the following steps:
step 101: configuring the target operation function to be monitored in the filter and configuring the target field in the interpreter.
The embodiment of the application is realized by adopting a preset development frame and a preset database, the preset development frame can be a YII frame or a YII2.0 frame and the like, the YII frame or the YII2.0 frame is a high-performance web application development frame of PHP5 (hypertext preprocessor), and a developer can add business logic on the basis of a generated code frame to quickly complete the development of the application. The preset database may be a mysql database or an sql server database, etc. According to the method and the device, the collection of log data is completed by utilizing new characteristic components, behaviors, components, events and the like in a preset development framework. Storing the collected log data into a preset database, and providing log query service based on the data stored in the database.
The preset components of the development framework comprise a filter and an interpreter, a uniform data operation interface is provided for a developer based on the development framework, the developer can configure the filter and the interpreter through the data operation interface, and the configured filter and the interpreter are used for monitoring a target operation function in a specific service program so as to record corresponding log data when data modification operation corresponding to the target operation function is monitored.
Specifically, the function name of the target operation function to be monitored is configured in the filtering parameters of the behavior function included in the filter. And determining the logic type to which the target operation function belongs, wherein the logic type is divided in a factory mode during the development of the business program, and the logic type comprises a plurality of types such as clients, users, orders and the like. And determining a service main key corresponding to the target operation function, wherein the service main key can be a unique identifier of the target operation function, and the unique identifier can be a character string which is set during development and is used for uniquely identifying the target operation function. And determining additional information required for monitoring the target operation function, wherein the additional information can be operator identification and the like. And determining the class name and the callback function name of the callback function corresponding to the target operation function. And then generating a monitoring detail array corresponding to the target operation function according to the function name of the target operation function, the logic type, the service main key, the additional information, the class name of the callback function and the callback function name, wherein the monitoring detail array comprises the function name of the target operation function, the logic type, the service main key, the additional information, the class name of the callback function and the callback function name. The array of listening details is then configured in the listening object parameters of the behavior function.
Since most services are not in a single-table structure but are associated with one-to-many or many-to-many data, a complete view needs to be implemented in the monitoring details, and table-linked query of all data needs to be implemented in the callback function and associated translation is performed. For example, if a common city of a client is queried, assuming that there are three table structures, namely, a main table customer table, a customer _ relationship _ city association table, and a city table, and the association query is performed with the name of the city table as a result, a target client is first found from the customer table, and a city identifier managed by the target client is found from the customer _ relationship _ city association table according to the target client, as 123. Then, according to the searched city identifier (such as 123), a target city corresponding to the city identifier, such as Beijing city, is searched from the city table.
To facilitate understanding of the above process of configuring a filter, the following description is given in conjunction with configuration code of the filter.
Figure BDA0003141711560000071
Figure BDA0003141711560000081
In the above configuration code, behavors () is a behavior function in the filter, only is a filter parameter, and a function name of a target operation function that needs to be monitored is configured in the filter parameter only. snapshot _ watchers is a parameter of a monitored object, and monitoring details of a target operation function to be monitored are configured in the parameter snapshot _ watchers of the monitored object, specifically configured in an array form, wherein one array corresponds to one target operation function. The code example configures the interception detail arrays corresponding to the objective operation functions save-user and change-status in the interception object parameter snapshot _ routers respectively. The number of parameters included in each listening detail array and the meaning of each parameter are the same. Taking the monitoring detail array corresponding to the target operation function save-USER as an example for explanation, the first parameter 'save-USER' in the monitoring detail array is the function name of the target operation function save-USER, the second parameter logsfonstants:: LOG _ USER is the belonged logic type, and here, the logic type is the USER type. The third parameter 'id' is the service primary key. The fourth parameter 'created _ by' is additional information, where the additional information is operator information. The fifth parameter 'app \ modules \ user \ business \ UserBusiness' is the class name of the callback function, and the sixth parameter 'getUserInfoById' is the callback function name.
The filtering parameters may be configured with function names of one or more target operation functions, and accordingly the monitoring object parameters may be configured with monitoring detail arrays corresponding to the one or more target operation functions. By adding the filter in the behavior to monitor the target operation function, the service code and the operation log system are stripped, and the decoupling effect is achieved. And the callback function is customized to realize bottom layer processing, so that the log recording becomes more flexible.
The embodiment of the application provides configurable field display through the interpreter, when the field of business data is in a very large number of situations, business personnel may only care about some important fields, the fields such as age, gender and the like are not concerned, but too many fields fill the view and the view is disturbed, so that only the fields needed by us are configured, and the data can be simpler and tidier.
For the configuration of the interpreter, one or more target fields are configured in a defined field function included in the interpreter, and corresponding translation texts are configured for each target field. After the target field is subjected to data modification processing by the target operation function, if the content of the target field changes, the content of the target field before and after being modified needs to be stored as log data corresponding to the target operation function.
To facilitate understanding of the configuration process of the interpreter, the following description is made in conjunction with code.
Figure BDA0003141711560000091
In the configuration code of the interpreter, the defindedWords () is a defined field function, each target field in the defined field function is configured in an array form of key ═ value, the key is an original target field of the target field, and the value is a translation text corresponding to the target field. The translated text corresponding to the target field username in the code is 'name'.
After the filter and the interpreter are configured in the above manner, the configured target operation function can be monitored in real time, and corresponding log data can be recorded through the following operations of steps 102 and 103.
Step 102: and acquiring pre-processing data and post-processing data corresponding to the target operation function through the filter.
The embodiment of the application provides a uniform data modification interface for a user, determines a first operation function required to be executed in response to a data modification request when the data modification request submitted by the user is received through the data modification interface, and determines whether a filter is configured with the first operation function, namely whether the first operation function is configured as a target operation function required to be monitored. Specifically, the function name of the first operation function is acquired, and the function names of all target operation functions included in the filter parameters of the behavior function in the filter are acquired, that is, all function names configured in the filter parameter only included in the behavior function behaviors () in the code example in step 101 are acquired. And judging whether all function names configured in the filtering parameters contain the function name of the first operation function required to be executed in response to the current data modification request. If yes, determining that a first operation function is configured in the filtering, namely the first operation function is a target operation function needing to be monitored. If not, determining that the first operation function is not the target operation function needing to be monitored.
If it is determined that the first operation function is the target operation function that needs to be monitored in the above manner, according to the function name of the first operation function, the monitoring detail array of the first operation function is obtained from the monitored object parameters of the behavior function in the filter, that is, the monitoring detail array corresponding to the first operation function is obtained from the monitored object parameter snapshot _ watchers in the code example of step 101. And acquiring pre-processing data before executing the first operation function and post-processing data after executing the first operation function according to the acquired monitoring detail array.
According to the embodiment of the application, before-modification collection operation before-modification and after-modification collection operation after-modification are set, and both the before-modification collection operation before-modification and after-modification collection operation after-modification automatically call callback functions corresponding to the target operation functions so as to automatically collect data before and after the data modification of the target operation functions. Specifically, when it is determined that a first operation function corresponding to a current data modification request needs to be monitored, before-modification collection operation before modification is triggered, after a monitoring detail array corresponding to the first operation function is obtained, a class name and a callback function name of a callback function corresponding to the first operation function are obtained from the monitoring detail array, and the callback function corresponding to the first operation function is called according to the obtained class name and the callback function name. And acquiring the pre-processing data aiming at the data modification request before the first operation function is executed through the callback function corresponding to the first operation function, and storing the pre-processing data in the old variable container. And then, in response to the current data modification request, executing the first operation function to modify the data. And after the data is modified, judging whether the data is modified successfully, if not, prompting the user of the reason of the modification failure, and finishing the operation. And if the modification is successful, triggering the operation after action after the modification, and automatically calling the callback function of the first operation function to acquire the processed data corresponding to the data modification request according to the class name and the callback function name of the callback function of the first operation function. And stores the processed data in the new variable container.
Step 103: and recording the log data corresponding to the target operation function according to the pre-processing data, the post-processing data and the target field configured in the interpreter.
The pre-processing data before the target processing function is executed and the post-processing data after the target processing function is executed are collected through step 102, and then it is determined whether the pre-processing data stored in the old variable container and the post-processing data stored in the new variable container are the same. If the data is the same as the data, the data is not changed before and after the target operation function is executed, and therefore logging is not needed. And if the data are changed before and after the target operation function is executed, further judging whether the target field configured in the interpreter contains a modified field corresponding to the data before processing and the data after processing. Determining whether the field modified by the target operation function is a preset field needing attention, if so, generating log data corresponding to the current execution of the target operation function according to the logic type of the target operation function, the service main key, the collected data before and after processing and the recorded modification time, and storing the log data into a database. The log data comprises a logic type, a service main key, pre-processing data, post-processing data and corresponding modification time corresponding to the target operation function.
The table structure of the database is simple, and a single table can be completed. The logic type and the service primary key are required to be uniquely identified, the pre-processing data stored in the original old variable container is serialized on the old _ data field, and the post-processing data stored in the new variable container is serialized and stored on the new _ data field. Some other fields such as creator, creation time, etc. may be appended.
If the modified fields corresponding to the pre-processing data and the post-processing data are not configured in the interpreter, the modified fields of the current execution target operation function are not the fields concerned by the user, and therefore log data corresponding to the current execution target operation function are not recorded.
In order to facilitate understanding of the above logging process, the following description is made in detail with reference to the accompanying drawings. As shown in fig. 2, S1: configuring the target operation function to be monitored in the filter and configuring the target field in the interpreter. S2: the method comprises the steps of receiving a data modification request submitted by a user through a unified data modification interface, and determining a first operation function required to be executed in response to the data modification request. S3: and judging whether the first operation function is configured as a target operation function needing monitoring in the filter, if not, executing the step S4, and if so, executing the step S5. S4: and not monitoring the first operation function, executing the first operation function and ending the operation. S5: and triggering before-modification collection operation before-modification, calling a callback function corresponding to the first operation function to acquire data before-modification processing according to the class name and the callback function name of the callback function corresponding to the first operation function configured by the filter, and storing the data before-modification processing in an old variable container. S6: a first operation function is performed. S7: and triggering the modified collection operation after the action, and automatically calling a callback function of the first operation function to acquire the processed data corresponding to the data modification request. And stores the processed data in the new variable container. S8: and judging whether the data before processing stored in the old variable container is the same as the data after processing stored in the new variable container, if so, executing the step S9, and if not, executing the step S10. S9: and (4) finishing the operation without logging. S10: and judging whether the target field configured in the interpreter contains a modified field corresponding to the data before processing and the data after processing, if so, executing the step S11, and if not, executing the step S12. S11: and generating log data corresponding to the execution of the target operation function at this time, and storing the log data into a database. S12: and not recording the log data corresponding to the current execution target operation function, and ending the operation.
And monitoring each target operation function to be monitored in real time in the above mode, and storing the log data corresponding to the target operation function into the database. Based on the database, a uniform log query interface is provided for a user, the user can submit a log query request through the log query interface, and the log query request carries a logic type and a service main key corresponding to a target operation function to be queried, so that all log data corresponding to the target operation function can be queried. Or the log query request can include a time period to be queried, so that all log data of the target operation function in the time period to be queried can be queried according to the modification time of the modification data.
After receiving a log query request submitted by a user through a log query interface, acquiring all log data corresponding to a target operation function to be queried from a database according to a logic type and a service main key included in the log query request, and respectively translating a target field included in each acquired log data through a mapping relation between the target field configured in an interpreter and a translation text, namely replacing the target field included in each log data acquired from the database with the translation text corresponding to the target field configured in the interpreter. And displaying all the translated log data. The target field is translated through the interpreter and then displayed, and therefore readability of log data is improved.
In order to display log data more intuitively, in the embodiment of the present application, before all the acquired log data are displayed, a time axis corresponding to a target operation function to be queried is created according to modification time included in each acquired log data, where the time axis includes an axis and the modification time of each log data marked on the axis according to a preset time sequence, and the preset time sequence may be arranged in a time sequence from front to back or in a time sequence from back to front. And mapping and arranging the modification time corresponding to each log data and the log data on the time axis respectively. And finally, displaying the time axis and each arranged log data. The log data are displayed in a time axis mode, so that a user can visually see the historical track of data modification, and the user can conveniently and quickly check the log data.
The log data can also be formatted and displayed, that is, the data such as the pre-processing data and the post-processing data included in the log data are displayed according to a preset layout, for example, the first row displays the user identifier, and the second row sequentially displays the pre-processing data and the post-processing data, and so on.
In other embodiments of the present application, modifying data corresponding to pre-processing data and post-processing data included in the log data is further determined; and marking the modified data in the data before processing and the data after processing according to a preset marking mode, wherein the preset marking mode can be that the modified data is thickened, underlined and the like, or the modified data is highlighted by adopting a preset color and the like. And displaying the marked data before processing and the marked data after processing.
The modified data are marked and displayed in a preset marking mode, so that a user can quickly check the modified data, the time for the user to look up log data is saved, and the looking-up efficiency is improved.
Fig. 3 is a schematic diagram of a log query result, where the left side is a time axis, the right side is log data arranged corresponding to modification time marked on the time axis, a first line in the log data displays a modifier identifier, a second line sequentially displays modified fields, the content of the field before modification and the content of the field after modification, and a gray portion is modified data, and the modified data displayed in the gray portion in practical application can be highlighted in colors of yellow, red, and the like.
For further understanding of the above-mentioned log recording and log query processes, reference is made to the following description in conjunction with the accompanying drawings. As shown in fig. 4, a user submits a request when needing to modify data, an operation function that the request needs to be executed is filtered through a filter, if the operation function that needs to be executed is configured as a target operation function that needs to be monitored in the filter, a before action is triggered, a callback function is automatically called to perform multi-table association translation, and details data before modification is queried and put into an old container. And then executing the operation function required to be executed by the request for processing, judging whether the data modification is successful, if the data modification is failed, prompting a failure reason, and terminating the operation. If the answer is successful, the after action is triggered, the callback function is automatically called to carry out multi-table association translation, and the modified detail data is inquired and put into a new container. And judging whether the data in the new container is changed compared with the data in the old container, if not, skipping and not recording. If the change occurs, judging whether the fields corresponding to the details data before modification and the details data after modification are configured in the interpreter through the interpreter, and if not, skipping and not recording. If so, the collected data is stored in a database. If the user inquires the log through the unified query interface, the log data are acquired from the database through the interpreter, the fields in the acquired log array are translated into translation texts with strong readability through the interpreter, and then the log data are displayed to the user.
The log interface types are unified in the embodiments of the present application, for example, a unified configuration interface, a unified data modification interface, a unified log query interface, and the like are provided. The log operation interface is provided, so that the log format becomes standardized, the maintenance and the inheritance are convenient, and the development amount is reduced. And the modified content is highlighted by adopting a time axis mode, so that the data can be clear at a glance. And the display of the log data is more humanized and visualized. The original data is changed into a habitual readable language through an interpretation and formatting mode, and the efficiency of quickly extracting the data is improved.
In the embodiment of the application, the log data of the target operation function can be recorded by configuring the target operation function to be monitored in the filter and configuring the target field to be concerned in the interpreter, developers do not need to know the specific details of the log recording process, do not need to maintain the query interface of the log, and only need to complete the configuration operation through a uniform configuration interface, so that the learning cost is low, the development efficiency is high, and the error rate is reduced. And log records are decoupled from specific services, and the log and the specific services are not mutually influenced, so that the maintainability of service programs is improved. And all log data inquired are visually displayed according to a time axis when the log is inquired, and the displayed log data are text data subjected to text interpretation by an interpreter, so that the readability is high. And the modification data can be marked and highlighted during display, so that a user can directly look up the modification data, and the efficiency of inquirers is greatly improved.
The embodiment of the application also provides a log recording device, and the device is used for executing the log recording method provided by any one of the embodiments. Referring to fig. 5, the apparatus includes:
a configuration module 201, configured to configure a target operation function to be monitored in the filter and configure a target field in the interpreter;
an obtaining module 202, configured to obtain pre-processing data and post-processing data corresponding to a target operation function through a filter;
and the log recording module 203 is used for recording the log data corresponding to the target operation function according to the pre-processing data, the post-processing data and the target field configured in the interpreter.
A configuration module 201, configured to configure a function name of a target operation function to be monitored in a filtering parameter of a behavior function included in a filter; generating a monitoring detail array corresponding to the target operation function according to the function name, the logic type, the service main key, the additional information, the class name of the callback function and the callback function name of the target operation function; and configuring a monitoring detail array in the parameters of the monitoring object of the behavior function.
A configuration module 201 for configuring one or more target fields in a defined field function comprised by the interpreter; and configuring corresponding translation texts for each target field.
An obtaining module 202, configured to receive a data modification request, and determine a first operation function that needs to be executed in response to the data modification request; determining whether a first operation function is configured in the filter; if yes, acquiring a monitoring detail array of the first operation function from the monitoring object parameters of the behavior function in the filter; and acquiring pre-processing data before executing the first operation function and post-processing data after executing the first operation function according to the acquired monitoring detail array.
An obtaining module 202, configured to obtain a function name of the first operation function; acquiring function names of all target operation functions included in filtering parameters of a behavioral function in a filter; and if the function name included in the filtering parameter contains the function name of the first operation function, determining that the first operation function is configured in the filtering.
An obtaining module 202, configured to obtain, from the monitoring detail array, a class name and a callback function name of a callback function corresponding to the first operation function; calling a callback function corresponding to the first operation function according to the acquired class name and the name of the callback function; acquiring pre-processing data aiming at a data modification request before the first operation function is executed through a callback function corresponding to the first operation function; and after the first operation function is executed, acquiring the processed data corresponding to the data modification request through the callback function corresponding to the first operation function.
The log recording module 203 is configured to determine whether a target field configured in the interpreter includes a modified field corresponding to the pre-processing data and the post-processing data if the pre-processing data is different from the post-processing data; if so, generating log data corresponding to the current execution of the target operation function, and storing the log data into a database, wherein the log data comprises a logic type, a service main key, pre-processing data, post-processing data and corresponding modification time corresponding to the target operation function; if the modified field is not configured in the interpreter or the data before processing is the same as the data after processing, the log data corresponding to the executed target operation function at the time is not recorded.
The device also includes: the log query module is used for receiving a log query request, wherein the log query request comprises a logic type and a service main key corresponding to a target operation function to be queried; acquiring all log data corresponding to a target operation function to be inquired from a database according to the logic type and the service main key; respectively translating the target field included in each acquired log data through the mapping relation between the target field configured in the interpreter and the translation text; and displaying all the translated log data.
The log query module is used for creating a time axis corresponding to the target operation function to be queried according to the modification time included in each acquired log data; mapping and arranging each log data and the modification time corresponding to the log data on the time axis respectively; and displaying the time axis and each arranged log data.
The log query module is used for determining the modified data corresponding to the data before processing and the data after processing which are included in the log data; marking modified data in the data before and after processing according to a preset marking mode; and displaying the marked data before processing and the marked data after processing.
The log recording device provided by the above embodiment of the present application and the log recording method provided by the embodiment of the present application have the same beneficial effects as the method adopted, operated or implemented by the application program stored in the log recording device.
The embodiment of the application also provides an electronic device to execute the log recording method. Please refer to fig. 6, which illustrates a schematic diagram of an electronic device according to some embodiments of the present application. As shown in fig. 6, the electronic apparatus 6 includes: a processor 800, a memory 801, a bus 802 and a communication interface 803, the processor 800, the communication interface 803 and the memory 801 being connected by the bus 802; the memory 801 stores a computer program that can be executed on the processor 800, and the processor 800 executes a logging method provided by any one of the foregoing embodiments when executing the computer program.
The Memory 801 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the apparatus and at least one other network element is realized through at least one communication interface 803 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
Bus 802 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 801 is used for storing a program, and the processor 800 executes the program after receiving an execution instruction, and the logging method disclosed in any of the foregoing embodiments of the present application may be applied to the processor 800, or implemented by the processor 800.
The processor 800 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 800. The Processor 800 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801 and completes the steps of the method in combination with the hardware thereof.
The electronic device provided by the embodiment of the application and the log recording method provided by the embodiment of the application have the same inventive concept and have the same beneficial effects as the method adopted, operated or realized by the electronic device.
Referring to fig. 7, the computer-readable storage medium is an optical disc 30, and a computer program (i.e., a program product) is stored thereon, and when being executed by a processor, the computer program executes a logging method provided in any of the foregoing embodiments.
It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, or other optical and magnetic storage media, which are not described in detail herein.
The computer-readable storage medium provided by the above-mentioned embodiment of the present application and the logging method provided by the embodiment of the present application have the same beneficial effects as the method adopted, run or implemented by the application program stored in the computer-readable storage medium.
It should be noted that:
in the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the application, various features of the application are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the application and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted to reflect the following schematic: this application is intended to cover such departures from the present disclosure as come within known or customary practice in the art to which this invention pertains. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this application.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the application and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The above description is only for the preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A method of logging, comprising:
configuring a target operation function to be monitored in a filter and configuring a target field in an interpreter;
acquiring pre-processing data and post-processing data corresponding to the target operation function through the filter;
and recording log data corresponding to the target operation function according to the pre-processing data, the post-processing data and a target field configured in the interpreter.
2. The method of claim 1, wherein configuring the target operation function to be monitored in the filter comprises:
configuring a function name of a target operation function to be monitored in a filtering parameter of a behavior function included in a filter;
generating a monitoring detail array corresponding to the target operation function according to the function name, the logic type, the service main key, the additional information, the class name of the callback function and the callback function name of the target operation function;
and configuring the monitoring detail array in the monitoring object parameters of the behavior function.
3. The method of claim 1, wherein configuring the target field in the interpreter comprises:
configuring one or more target fields in a defined field function included in the interpreter;
and configuring corresponding translation texts for each target field.
4. The method of claim 2, wherein the obtaining pre-processed data and post-processed data before processing and after processing of the target operation function by the filter comprises:
receiving a data modification request, and determining a first operation function required to be executed in response to the data modification request;
determining whether the first operation function is configured in the filter;
if yes, acquiring a monitoring detail array of the first operation function from the monitoring object parameters of the behavior function in the filter;
and acquiring the data before processing and the data after processing before executing the first operation function according to the acquired monitoring detail array.
5. The method of claim 4, wherein the determining whether the first operation function is configured in the filter comprises:
acquiring a function name of the first operation function;
acquiring function names of all target operation functions included in the filtering parameters of the behavior function in the filter;
and if the function name included in the filtering parameter includes the function name of the first operation function, determining that the first operation function is configured in the filtering.
6. The method according to claim 4, wherein the obtaining pre-processing data before executing the first operation function and post-processing data after executing the first operation function according to the obtained listening detail array comprises:
acquiring the class name and the callback function name of the callback function corresponding to the first operation function from the monitoring detail array;
calling a callback function corresponding to the first operation function according to the acquired class name and the callback function name;
acquiring pre-processing data for the data modification request before the first operation function is executed through a callback function corresponding to the first operation function;
and after the first operation function is executed, acquiring the processed data corresponding to the data modification request through a callback function corresponding to the first operation function.
7. The method according to any one of claims 1 to 6, wherein the recording log data corresponding to the target operation function according to the pre-processing data, the post-processing data and a target field configured in the interpreter includes:
if the pre-processing data is different from the post-processing data, judging whether a target field configured in the interpreter contains a modified field corresponding to the pre-processing data and the post-processing data;
if so, generating log data corresponding to the execution of the target operation function at this time, and storing the log data into a database, wherein the log data comprises a logic type corresponding to the target operation function, a service main key, the data before processing, the data after processing and corresponding modification time;
and if the modified field is not configured in the interpreter or the data before processing is the same as the data after processing, not recording the log data corresponding to the execution of the target operation function at this time.
8. The method of claim 7, further comprising:
receiving a log query request, wherein the log query request comprises a logic type and a service main key corresponding to a target operation function to be queried;
acquiring all log data corresponding to a target operation function to be inquired from the database according to the logic type and the service main key;
respectively translating the target field included in each acquired log data through the mapping relation between the target field configured in the interpreter and the translation text;
and displaying all the translated log data.
9. The method of claim 8, wherein displaying all log data obtained comprises:
according to the modification time included in each acquired log data, a time axis corresponding to the target operation function to be inquired is established;
mapping and arranging each log data and the modification time corresponding to the log data on the time axis respectively;
and displaying the time shaft and each arranged log data.
10. The method according to claim 8 or 9, characterized in that the method further comprises:
determining modified data corresponding to the pre-processing data and the post-processing data included in the log data;
marking the modified data in the data before processing and the data after processing according to a preset marking mode;
and displaying the marked data before processing and the marked data after processing.
11. A logging apparatus, comprising:
the configuration module is used for configuring a target operation function to be monitored in the filter and configuring a target field in the interpreter;
the acquisition module is used for acquiring the pre-processing data and the post-processing data corresponding to the target operation function through the filter;
and the log recording module is used for recording the log data corresponding to the target operation function according to the pre-processing data, the post-processing data and the target field configured in the interpreter.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method of any one of claims 1-10.
13. A computer-readable storage medium, on which a computer program is stored, characterized in that the program is executed by a processor to implement the method according to any of claims 1-10.
CN202110742084.6A 2021-06-30 2021-06-30 Log recording method, device, equipment and storage medium Active CN113608955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110742084.6A CN113608955B (en) 2021-06-30 2021-06-30 Log recording method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110742084.6A CN113608955B (en) 2021-06-30 2021-06-30 Log recording method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113608955A true CN113608955A (en) 2021-11-05
CN113608955B CN113608955B (en) 2024-01-26

Family

ID=78337101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110742084.6A Active CN113608955B (en) 2021-06-30 2021-06-30 Log recording method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113608955B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544050A (en) * 2022-11-29 2022-12-30 明度智云(浙江)科技有限公司 Operation log recording method, device, equipment and storage medium
CN117407369A (en) * 2023-12-14 2024-01-16 宁德时代新能源科技股份有限公司 Operation log recording method and device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090132607A1 (en) * 2007-11-16 2009-05-21 Lorenzo Danesi Techniques for log file processing
US20110238495A1 (en) * 2008-03-24 2011-09-29 Min Soo Kang Keyword-advertisement method using meta-information related to digital contents and system thereof
CN102929920A (en) * 2012-09-19 2013-02-13 北京奇虎科技有限公司 Web-information-extraction-based monitoring method and device for software updating information
CN104182435A (en) * 2013-05-24 2014-12-03 三星Sds株式会社 System and method for searching information based on data missing mark
CN105426292A (en) * 2015-10-29 2016-03-23 网易(杭州)网络有限公司 Game log real-time processing system and method
WO2021012489A1 (en) * 2019-07-22 2021-01-28 平安科技(深圳)有限公司 Telephone platform log query method, terminal device, storage medium and apparatus
CN112395157A (en) * 2020-11-13 2021-02-23 广州至真信息科技有限公司 Audit log obtaining method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090132607A1 (en) * 2007-11-16 2009-05-21 Lorenzo Danesi Techniques for log file processing
US20110238495A1 (en) * 2008-03-24 2011-09-29 Min Soo Kang Keyword-advertisement method using meta-information related to digital contents and system thereof
CN102929920A (en) * 2012-09-19 2013-02-13 北京奇虎科技有限公司 Web-information-extraction-based monitoring method and device for software updating information
CN104182435A (en) * 2013-05-24 2014-12-03 三星Sds株式会社 System and method for searching information based on data missing mark
CN105426292A (en) * 2015-10-29 2016-03-23 网易(杭州)网络有限公司 Game log real-time processing system and method
WO2021012489A1 (en) * 2019-07-22 2021-01-28 平安科技(深圳)有限公司 Telephone platform log query method, terminal device, storage medium and apparatus
CN112395157A (en) * 2020-11-13 2021-02-23 广州至真信息科技有限公司 Audit log obtaining method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨杰: "如何构建简易、高效、实用的网络运行监控系统", 网络安全技术与应用, no. 10, pages 47 - 49 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544050A (en) * 2022-11-29 2022-12-30 明度智云(浙江)科技有限公司 Operation log recording method, device, equipment and storage medium
CN117407369A (en) * 2023-12-14 2024-01-16 宁德时代新能源科技股份有限公司 Operation log recording method and device and electronic equipment
CN117407369B (en) * 2023-12-14 2024-05-28 宁德时代新能源科技股份有限公司 Operation log recording method and device and electronic equipment

Also Published As

Publication number Publication date
CN113608955B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
EP2909750B1 (en) Specifying and applying rules to data
US9123024B2 (en) System for analyzing security compliance requirements
CN111061733B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN108268525A (en) A kind of report implementation method and device based on Excel template
US9940182B1 (en) Business rule engine validation systems and related methods
CN113608955A (en) Log recording method, device, equipment and storage medium
US20230289331A1 (en) Model generation service for data retrieval
CN109636303B (en) Storage method and system for semi-automatically extracting and structuring document information
CN114116745A (en) Interface change identification and display method, device, equipment and medium
CN113885860A (en) Method and equipment for automatically configuring management page to generate interface service
US11176022B2 (en) Health diagnostics and analytics for object repositories
US20230004477A1 (en) Providing a pseudo language for manipulating complex variables of an orchestration flow
JP2019537171A (en) System and method for efficiently delivering warning messages
CN111933228B (en) Method and device for realizing project distribution and management system in clinical research
US20220244975A1 (en) Method and system for generating natural language content from recordings of actions performed to execute workflows in an application
CN112905558A (en) Report system implementation method and system based on database configuration
CN113128805A (en) Method and device for treating streaming data, electronic equipment and storage medium
AU2014280991B2 (en) System for analyzing security compliance requirements
US20180189499A1 (en) Dynamic security report generator
CN116594917B (en) UI testing method and device, electronic equipment and machine-readable storage medium
US10825107B2 (en) Materiality determination and indication system
US11340918B2 (en) Knowledge engine auto-generation of guided flow experience
CN117632740A (en) Buried point detection method, buried point management device, computer equipment and medium
CN115373963A (en) Log statistical method and device and server
US9836337B1 (en) Enterprise service bus business activity monitoring system and related methods

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240510

Address after: 100102 room 1201, 12 / F, building 8, yard 34, Chuangyuan Road, Chaoyang District, Beijing

Patentee after: Beijing new oxygen world wide Technology Consulting Co.,Ltd.

Country or region after: China

Address before: 100102 room 901, 9 / F, room 1001, 10 / F, building 8, yard 34, Chuangyuan Road, Chaoyang District, Beijing

Patentee before: Beijing New Oxygen Technology Co.,Ltd.

Country or region before: China