CN112199335A - Generation method and generation system of operation log - Google Patents
Generation method and generation system of operation log Download PDFInfo
- Publication number
- CN112199335A CN112199335A CN202011028318.2A CN202011028318A CN112199335A CN 112199335 A CN112199335 A CN 112199335A CN 202011028318 A CN202011028318 A CN 202011028318A CN 112199335 A CN112199335 A CN 112199335A
- Authority
- CN
- China
- Prior art keywords
- operation log
- language
- generating
- fields
- language type
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000006243 chemical reaction Methods 0.000 claims abstract description 11
- 238000004458 analytical method Methods 0.000 claims description 12
- 238000012544 monitoring process Methods 0.000 claims description 4
- 238000004891 communication Methods 0.000 abstract description 2
- 238000005516 engineering process Methods 0.000 abstract description 2
- 230000006399 behavior Effects 0.000 description 9
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
- G06F40/157—Transformation using dictionaries or tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/42—Data-driven translation
- G06F40/47—Machine-assisted translation, e.g. using translation memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Library & Information Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to a communication technology, and provides a method for generating an operation log, which comprises the following steps: step 1: obtaining operation log annotation information which comprises fields necessary for generating an operation log; step 2: acquiring a language type used by a user for operation at the front end; and step 3: converting the fields in the step 1 according to the language type in the step 2; and 4, step 4: generating an operation log with the same language type as the language type in the step 2 according to the display value of the field subjected to the language conversion in the step 3 and the operation log generating logic; the fields are configured according to different languages in advance to obtain display values aiming at the different languages; the method can be used for associating the language used by the operation of the user and the operation behavior to generate the operation log of the corresponding language, and is simple and convenient. Meanwhile, a multi-language generation system of the operation log is also provided.
Description
Technical Field
The present application relates to communications technologies, and in particular, to a method and a system for generating an operation log.
Background
The generation method of the operation log may refer to CN201911425752.1, which discloses a generation method of a log code, comprising: obtaining a description file, wherein the description file at least describes a plurality of fields and field attributes related to log logic; analyzing the description file to obtain a basic data structure of the log; determining a target code template from a plurality of pre-constructed code templates, wherein the code templates are pre-generated code templates in different languages; and traversing the attributes in the basic data structure, and generating a log code of a language corresponding to the target code template by combining the target code template.
It can be seen that the generation method of the operation log is that after the description file is analyzed, a corresponding template is obtained by traversing data according to a pre-configured multi-language code template, and the log code is obtained by filling the analyzed basic data structure into the template.
Because the templates are configured correspondingly for different operations, a large number of self-defined templates are needed in the early stage, and the operation is complex and tedious.
The technical problem solved by the scheme is as follows: how to realize the generation of the multi-language operation log in a simple way.
Disclosure of Invention
In view of this, the present application aims to: the method can be used for generating the operation log of the corresponding language by associating the language used by the operation of the user and the operation behavior, and is simple and convenient.
In addition, the invention also provides a system for realizing the method.
Specifically, the method comprises the following steps:
an operation log generation method comprises the following steps:
step 1: obtaining operation log annotation information which comprises fields necessary for generating an operation log;
step 2: acquiring a language type used by a user for operation at the front end;
and step 3: converting the fields in the step 1 according to the language type in the step 2;
and 4, step 4: generating an operation log with the same language type as the language type in the step 2 according to the display value of the field subjected to the language conversion in the step 3 and the operation log generating logic;
and configuring the fields according to different languages in advance to obtain display values aiming at different languages.
In the above method for generating an operation log, the specific method for configuring the fields according to different languages in advance includes:
configuring dictionary codes of the fields;
configuring display values of different languages corresponding to each dictionary code;
and when the language type is converted, inquiring the display value of the corresponding language according to the dictionary code of the field.
In the above method for generating an operation log, the method further includes step 5: and sending a message for writing the operation log to a queue, and storing the operation log generated in the step 4.
In addition, the invention also discloses a multi-language generation system of the operation log, which comprises the following modules:
a database; the display value is used for storing the data dictionary codes of all the fields and storing the display values of the data dictionary codes corresponding to different languages;
a monitoring module: the system comprises a database, a user interface and a database, wherein the database is used for storing operation log annotation information and a language type used by user operation;
an analysis module: the system is used for analyzing the annotation information of the operation log and performing language conversion on fields in the annotation information of the operation log by inquiring the database;
an operation log generation module: and generating an operation log according to the generation logic of the operation log according to the analysis result of the analysis module.
In the above multi-language generation system for oplogs, the system further includes a write oplog module: and the message used for generating the write operation log is sent to the queue, and the operation log generated by the operation log generation module is stored.
The invention has the beneficial effects that:
the method can be used for associating the language used by the operation of the user and the operation behavior to generate the operation log of the corresponding language, is simple and convenient, and simultaneously supports the query and retrieval of the operation log content, the personalized operation log definition and the like.
The prior art does not support query and retrieval of the content of the operation log (because the operation log can be completely and readable by firstly dynamically assembling the operation log and then query and retrieval are carried out on the operation log, and the first assembly of all the logs is unrealistic, large in quantity and more in calculation). For example, the content of the operation log like '% of a certain contract number' does not need to prepare a large number of operation log templates in advance, and the convenience is high.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method provided according to an embodiment of the present application;
fig. 2 is a block diagram of a system provided according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below through embodiments with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1-2, the present embodiment discloses a method for generating an operation log, including the following steps:
step 1: obtaining operation log annotation information which comprises fields necessary for generating an operation log;
the following note code marked at the beginning of @ OperationLog is used as a back-end note code marked on a back-end business method to indicate how the back-end should parse and generate corresponding operation log information when the front-end requests the back-end business method.
Oplog annotation information as referred to herein includes, but is not limited to: operation behavior, operation objects, values of the operation objects, and custom fields in the operation log.
The following code is specifically explained:
the operation behaviors are as follows: ADD; which generally corresponds to the names of the operating buttons of the front end
The operation objects are: a contact; which generally corresponds to the menu name of the front end
The values of the operands are: a contictname; which generally corresponds to the name or number of the particular data record of the operation of the front end, e.g., a particular contract number, order number, work order number, etc.
And custom fields.
ADD, contact above is a data dictionary code that corresponds to a particular display value in the data dictionary. The object value contctname and the value of the custom content are displayed by directly acquiring the specific data content of the corresponding field.
An operation action (e.g., ADD), an operation object (e.g., contact) needs to perform data dictionary parsing of the display value of the corresponding language.
The value of the self-defined content (for example, "contract No, segment"), the corresponding field name shows that the data dictionary analysis is needed, for example, the contract No corresponds to the simplified Chinese field name as contract number, segment is settlement mode, and the English environment is the contract No, segment. An object value (e.g., contctname), which displays the data of the corresponding field.
For example, if the current login is simplified Chinese, then "contract No, segment" is translated into contract No and settlement mode according to the dictionary multi-language configuration, if the current login is English, then "contract No, segment" is translated according to the dictionary multi-language configuration.
It should be noted that some custom contents need to be parsed through dictionary translation, some custom contents do not need to be parsed, and whether parsing is needed is determined according to a log rule set in advance by a human.
The operation behavior requires a dictionary conversion, (typically a header above a button), e.g., where ADD must be dictionary converted to "New" or "ADD"
The operation object needs dictionary conversion, (generally, the menu of the operation), for example, here, the extract must be dictionary converted into the name of the menu: contract management or contract management "
The custom field requires a name of a field-to-field title because the operation details include a title that needs to display the field, such as a contract number, and a settlement mode, which is a title of the field, needs to be displayed.
the targetField (object value: contract name) does not involve conversion of field titles because titles do not need to be listed in operation details, and the content corresponding to the field is directly displayed without dictionary configuration.
An operation action (e.g., ADD), an operation object (e.g., contact) needs to perform data dictionary parsing of the display value of the corresponding language.
What fields need to be converted from dictionary to which fields need not be converted from dictionary is actually a preset rule, and needs to be confirmed according to the operation detail template content given by the product.
Taking the content at the beginning of the @ OperationLog as an example, the following rules are followed: :
add, # action (new addition): must dictionary rotate
logBizType ═ logbiztype.contact # operation object (contract management): must dictionary rotate
Output # (source of custom content): without using dictionaries
The custom field ═ conjugate no, segment "# (value of custom content): the field title name appears in the operation details, so the title name must be converted in a dictionary.
Output (object: obtained from output): without using dictionaries
targetField is "contract name" (object value: contract name): the operation details do not require the title name of the object value to be listed, so that the title is directly displayed without converting the title from a dictionary.
In different languages, the displayed values of the same data dictionary code are different, for example, in chinese, the displayed value of the data dictionary code is the contract Name, and in an english environment, the displayed value of the data dictionary code is the contract Name.
Step 2: acquiring a language type used by a user for operation at the front end;
when the operation is performed at the front end, the language display type of the operation interface has a corresponding code, the back end can know what language the user uses only by acquiring the code, for example, the Chinese code is CN, and the back end can know that the user uses Chinese.
And step 3: converting the fields in the step 1 according to the language type in the step 2;
in this step, there is a database used for storing the data dictionary code of every field, store the display value of the data dictionary code corresponding to different languages;
during the conversion operation, the data dictionary codes are found in the database according to the fields, and then the data dictionary codes are converted into display values required by the user according to the corresponding language.
And 4, step 4: generating an operation log with the same language type as the language type in the step 2 according to the display value of the field subjected to the language conversion in the step 3 and the operation log generating logic;
the generation logic of the operation log is generated according to an operation log template defined by a product in advance, the log template defined by the product is usually an excel file, and each operation log comprises: behavior + object type + object + custom content (not necessarily generated content), the programmer implements as required.
The operation log generation logic in this step is as follows:
as can be seen from the above table, the generation contents of the operation logs of different operation behaviors are different, for example, the generation contents of the viewed operation logs are: behavior + object type + object; the generation content of the newly-built operation log is as follows: behavior + object type + object: and (4) self-defining the content. I.e., the custom content portion is not necessarily the generated content.
And 5: and sending a message for writing the operation log to a queue, and storing the operation log generated in the step 4.
The scheme adopts a message middleware form to execute the instruction of writing the operation log, and the asynchronous message mode supports writing of a large number of operation logs.
And configuring the fields according to different languages in advance to obtain display values aiming at different languages.
The specific method for configuring the field according to different languages in advance comprises the following steps:
configuring dictionary codes of the fields;
configuring display values of different languages corresponding to each dictionary code;
and when the language type is converted, inquiring the display value of the corresponding language according to the dictionary code of the field.
In other words, when the system is configured, the user is required to define the data dictionary, for example, the data dictionary code of my order is order, and the user can define: my order.
When setting the display value, the default display value exists for different languages, and the user can also define the display value by self.
Therefore, as long as the data dictionary codes are known, the fields can be flexibly converted, and the user can use default display values and can also customize the display values.
Example 2
A multilingual oplogging system comprising the following modules:
a database 1; the display value is used for storing the data dictionary codes of all the fields and storing the display values of the data dictionary codes corresponding to different languages;
and the monitoring module 2: the system comprises a database, a user interface and a database, wherein the database is used for storing operation log annotation information and a language type used by user operation;
an analysis module 3: the system is used for analyzing the annotation information of the operation log and performing language conversion on fields in the annotation information of the operation log by inquiring the database;
the operation log generation module 4: and generating an operation log according to the generation logic of the operation log according to the analysis result of the analysis module.
The write operation log module 5: and the message used for generating the write operation log is sent to the queue, and the operation log generated by the operation log generation module is stored.
The working principle is as follows: the monitoring module intercepts the annotation information of the operation log and the codes of the language type used by the user operation, the analysis module analyzes the annotation information, the analysis result is the data dictionary codes of all relevant fields of the user to the log operation and the language type used by the user, and the data dictionary codes are converted according to the language type to obtain a display value; the operation log generating module generates an operation log according to a preset logic, the operation log writing module sends a message written in the operation log to the middleware in an asynchronous message queue mode, and the operation log is stored by processing the message.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in greater detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims (5)
1. A method for generating an operation log is characterized by comprising the following steps:
step 1: obtaining operation log annotation information which comprises fields necessary for generating an operation log;
step 2: acquiring a language type used by a user for operation at the front end;
and step 3: converting the fields in the step 1 according to the language type in the step 2;
and 4, step 4: generating an operation log with the same language type as the language type in the step 2 according to the display value of the field subjected to the language conversion in the step 3 and the operation log generating logic;
and configuring the fields according to different languages in advance to obtain display values aiming at different languages.
2. The method for generating an operation log according to claim 1, wherein the specific method for configuring the fields for different languages in advance is as follows:
configuring dictionary codes of the fields;
configuring display values of different languages corresponding to each dictionary code;
and when the language type is converted, inquiring the display value of the corresponding language according to the dictionary code of the field.
3. The generation method of the operation log according to claim 1, further comprising the step 5 of: and sending a message for writing the operation log to a queue, and storing the operation log generated in the step 4.
4. A multilingual oplogging system comprising:
a database: the display value is used for storing the data dictionary codes of all the fields and storing the display values of the data dictionary codes corresponding to different languages;
a monitoring module: the system comprises a database, a user interface and a database, wherein the database is used for storing operation log annotation information and a language type used by user operation;
an analysis module: the system is used for analyzing the annotation information of the operation log and performing language conversion on fields in the annotation information of the operation log by inquiring the database;
an operation log generation module: and generating an operation log according to the generation logic of the operation log according to the analysis result of the analysis module.
5. The system of claim 4, further comprising a write oplog module to: and the message used for generating the write operation log is sent to the queue, and the operation log generated by the operation log generation module is stored.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011028318.2A CN112199335A (en) | 2020-09-26 | 2020-09-26 | Generation method and generation system of operation log |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011028318.2A CN112199335A (en) | 2020-09-26 | 2020-09-26 | Generation method and generation system of operation log |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112199335A true CN112199335A (en) | 2021-01-08 |
Family
ID=74006969
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011028318.2A Pending CN112199335A (en) | 2020-09-26 | 2020-09-26 | Generation method and generation system of operation log |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112199335A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327716A (en) * | 2021-12-27 | 2022-04-12 | 凌云光技术股份有限公司 | Method and system for generating local language operation log based on XML language |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103645931A (en) * | 2013-12-25 | 2014-03-19 | 盛杰 | Method and device for code conversion |
CN104679642A (en) * | 2013-11-26 | 2015-06-03 | 国际商业机器公司 | Language independent processing of logs in a log analytics system |
CN110109808A (en) * | 2018-02-01 | 2019-08-09 | 北京视联动力国际信息技术有限公司 | A kind of method and apparatus of log processing |
CN110321273A (en) * | 2019-07-09 | 2019-10-11 | 政采云有限公司 | A kind of business statistical method and device |
CN111177089A (en) * | 2019-12-31 | 2020-05-19 | 奇安信科技集团股份有限公司 | Method and device for generating log processing code, computer system and storage medium |
CN111221521A (en) * | 2019-12-31 | 2020-06-02 | 奇安信科技集团股份有限公司 | Method and device for generating log code, computer system and readable storage medium |
-
2020
- 2020-09-26 CN CN202011028318.2A patent/CN112199335A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679642A (en) * | 2013-11-26 | 2015-06-03 | 国际商业机器公司 | Language independent processing of logs in a log analytics system |
CN103645931A (en) * | 2013-12-25 | 2014-03-19 | 盛杰 | Method and device for code conversion |
CN110109808A (en) * | 2018-02-01 | 2019-08-09 | 北京视联动力国际信息技术有限公司 | A kind of method and apparatus of log processing |
CN110321273A (en) * | 2019-07-09 | 2019-10-11 | 政采云有限公司 | A kind of business statistical method and device |
CN111177089A (en) * | 2019-12-31 | 2020-05-19 | 奇安信科技集团股份有限公司 | Method and device for generating log processing code, computer system and storage medium |
CN111221521A (en) * | 2019-12-31 | 2020-06-02 | 奇安信科技集团股份有限公司 | Method and device for generating log code, computer system and readable storage medium |
Non-Patent Citations (1)
Title |
---|
MOB604756FE00BF: "Oplog4j - 基于Spring的通用操作日志生成工具", pages 1 - 12, Retrieved from the Internet <URL:https://blog.51cto.com/u_15127644/2880397> * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327716A (en) * | 2021-12-27 | 2022-04-12 | 凌云光技术股份有限公司 | Method and system for generating local language operation log based on XML language |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107402746B (en) | Method and device for automatically generating code file | |
CN109766529B (en) | Report generation method and equipment | |
JPH10326255A (en) | Method for handling message independent of language | |
CN111831384B (en) | Language switching method, device, equipment and storage medium | |
CN109766085B (en) | Method and device for processing enumeration type codes | |
CN111881650B (en) | PDF document generation method and device and electronic equipment | |
CN109710250B (en) | Visualization engine system and method for constructing user interface | |
CN111736813B (en) | JPA code generation method and device, terminal equipment and storage medium | |
CN112231407B (en) | DDL synchronization method, device, equipment and medium of PostgreSQL database | |
CN113076167A (en) | Code processing method and related equipment | |
CN108170409B (en) | Development method and system of WEB front-end control | |
CN113010471A (en) | File conversion method, file conversion device, storage medium and electronic equipment | |
CN108153522B (en) | Method for generating Spark and Hadoop program codes by midcore based on model conversion | |
CN110308907B (en) | Data conversion method and device, storage medium and electronic equipment | |
CN113127776A (en) | Breadcrumb path generation method and device and terminal equipment | |
CN111651696A (en) | Product label customizing method and device, computer storage medium and electronic equipment | |
CN112199335A (en) | Generation method and generation system of operation log | |
CN111178025A (en) | Editing method and device of nuclear power plant operation guide rules, computer equipment and storage medium | |
CN111443979B (en) | Document processing method, device, computer equipment and storage medium | |
CN113641433A (en) | Multi-language page conversion method and unit of front-end internationalized multi-language file based on i18n technology | |
CN113485702A (en) | Method, device and equipment for configurationally generating front-end page and storage medium | |
CN113822033A (en) | Report generation method, device, equipment and storage medium | |
CN109739504B (en) | Method for automatically generating H5 service handling page according to background configuration | |
CN109828775B (en) | WEB management system and method for multilingual translation text content | |
CN117971875A (en) | Data query method, device, medium and electronic equipment |
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 | ||
CB02 | Change of applicant information |
Address after: 511356 Room 501, building 2, No. 63, Yong'an Avenue, Huangpu District, Guangzhou, Guangdong Applicant after: Guangzhou lubangtong Internet of things Technology Co.,Ltd. Address before: 510653 room F315, 95 daguanzhong Road, Tianhe District, Guangzhou City, Guangdong Province Applicant before: GUANGZHOU ROBUSTEL TECHNOLOGIES Co.,Ltd. |
|
CB02 | Change of applicant information |