CN112905405B - Label data processing method and device and storage medium - Google Patents

Label data processing method and device and storage medium Download PDF

Info

Publication number
CN112905405B
CN112905405B CN201911223223.3A CN201911223223A CN112905405B CN 112905405 B CN112905405 B CN 112905405B CN 201911223223 A CN201911223223 A CN 201911223223A CN 112905405 B CN112905405 B CN 112905405B
Authority
CN
China
Prior art keywords
tag
stored
information
entity object
tag data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911223223.3A
Other languages
Chinese (zh)
Other versions
CN112905405A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201911223223.3A priority Critical patent/CN112905405B/en
Publication of CN112905405A publication Critical patent/CN112905405A/en
Application granted granted Critical
Publication of CN112905405B publication Critical patent/CN112905405B/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/3086Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves the use of self describing data formats, i.e. metadata, markup languages, human readable formats

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a label data processing method, a device and a storage medium, wherein the method comprises the following steps: acquiring a label data storage request triggered by a user, wherein the label data storage request comprises label data to be stored corresponding to the log; instantiating the first entity class based on the tag data to be stored, and creating a first entity object so that the first entity object stores the tag data to be stored; and calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table. By the technical scheme of the embodiment of the invention, the processing efficiency of the label data can be improved, and the maintenance and management are convenient.

Description

Label data processing method and device and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a method and an apparatus for processing tag data, and a storage medium.
Background
The program code may output a log file desired by the user at a specific location during execution. The user can set a Tag for marking in advance for each log in the log file based on own preference, so that each output log comprises a Tag, and log content can be known based on the Tag in the following.
In the prior art, users often record tag data by means of manual annotations at tag locations. However, as the number of tags increases, such a manual annotation method is time-consuming and labor-consuming, reduces processing efficiency, and may result in a situation where it is difficult to maintain and manage tags if some tags are annotated at their positions and some tags are not annotated at their positions.
Disclosure of Invention
The embodiment of the invention provides a tag data processing method, a tag data processing device and a storage medium, which are used for improving the processing efficiency of tag data and facilitating maintenance and management.
In a first aspect, an embodiment of the present invention provides a tag data processing method, including:
acquiring a label data storage request triggered by a user, wherein the label data storage request comprises label data to be stored corresponding to a log;
instantiating a first entity class based on the tag data to be stored, and creating a first entity object so that the first entity object stores the tag data to be stored;
and calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table.
In a second aspect, an embodiment of the present invention further provides a tag data processing apparatus, including:
the system comprises a tag data storage request acquisition module, a log storage module and a tag data storage request processing module, wherein the tag data storage request acquisition module is used for acquiring a tag data storage request triggered by a user, and the tag data storage request comprises tag data to be stored corresponding to the log;
the first entity object creating module is used for instantiating a first entity class based on the tag data to be stored and creating a first entity object so that the tag data to be stored is stored in the first entity object;
and the tag data storage module is used for calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table.
In a third aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the tag data processing method provided in any embodiment of the present invention.
According to the embodiment of the invention, when a user needs to record the tag data, the tag data storage request can be triggered, when the tag data storage request is acquired, the first entity class is instantiated based on the tag data to be stored corresponding to the log in the tag data storage request, the first entity object is created, the tag data to be stored can be stored by the first entity object, the first entity object and the session object used for acquiring the user information are used as input parameters, the preset storage function is called, so that the tag data to be stored and the user information can be automatically stored in the tag management table, manual annotation by the user is not needed, the processing efficiency of the tag data is improved, and by utilizing the tag management table, the tag data corresponding to the log can be maintained and managed more conveniently, and the maintenance and management efficiency of the tag is improved.
Drawings
Fig. 1 is a flowchart of a tag data processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a tag data processing method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a tag data processing apparatus according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and that no limitation of the invention is intended. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a Tag data processing method according to an embodiment of the present invention, which is applicable to a case where Tag data corresponding to a log is stored. The method can be executed by a tag data processing device, which can be implemented by software and/or hardware, and is integrated in a device with log management function, such as a server. The method specifically comprises the following steps:
s110, a label data storage request triggered by a user is obtained, wherein the label data storage request comprises label data to be stored corresponding to the log.
The tag data storage request may be a request triggered by a user and used for storing tag data corresponding to a tag in a log. The label data to be stored corresponding to the log can be information for representing the meaning of the label, so that the user can better understand the content of the log. Exemplary tag data to be stored may include, but is not limited to: a log type name typeName, a log type identification tagType, a tag identification tag, tag status information tagStatus, an operating system identification platform, an adaptation minimum version minVersion, and configuration detail information detailsConfig. The log type may include, but is not limited to, a basic log and a service log, and the corresponding log type identifier tagType may be characterized by "0" and "1", respectively. The tag identification tag corresponding to each tag is unique so as to distinguish different tags. Tag status information tagStatus may include an available status and an unavailable status, which may be characterized by "1" and "2", respectively. The operating system may refer to a log-executable operating system, which may include an Android system and an IOS system, wherein the Android system identification may be characterized by "1"; the IOS system is characterized by "2"; and characterizing the Android system and the IOS system identification by using '3'. The configuration detail information detailsConfig may be used to describe the configuration information of the log data in detail.
Specifically, a user can manually input tag data to be stored corresponding to a log on a webpage end aiming at tags in the log based on the storage format requirement of each tag data to be stored, and after the tag data to be stored is input, the webpage end can obtain the tag data to be stored input by the user through a click triggering mode. The webpage end can also automatically acquire the label data to be stored corresponding to the log aiming at the labels in the log. When all the tag data to be stored is obtained, the webpage side can generate a tag data storage request based on the tag data to be stored, and can send the tag data storage request to the server side.
S120, instantiating the first entity class based on the tag data to be stored, and creating a first entity object so that the first entity object stores the tag data to be stored.
The first entity class is predefined and used for packaging the entity class of the tag data to be stored. The first entity object is an object obtained after instantiation of the first entity class. The first entity object may be used to store tag data to be stored corresponding to the log.
Illustratively, the first entity class may be defined as follows:
Figure BDA0002301430570000041
Figure BDA0002301430570000051
the name of the first entity class is LogTagReq, and the first entity class may include a field object corresponding to each tag data to be stored, so as to store or read the corresponding tag data by using the field object. By adding an @ Data tag in front of the first entity class, a storage set function and a reading get function corresponding to each field object can be automatically generated during compiling, and therefore development efficiency is improved.
Specifically, the server may obtain the tag data to be stored corresponding to the log by analyzing the tag data storage request, and instantiate the first entity class based on the obtained tag data to be stored. For example, whether each item of tag data to be stored is empty data can be detected in real time during the instantiation process, so that the integrity of tag data storage is ensured. When detecting that a certain item of tag data is null data, a prompt message indicating that the tag data cannot be null may be displayed on a display interface of the web page end to prompt the user to input the corresponding tag data, for example, when the log type name typeName is null data, a prompt message indicating that "typeName cannot be null" may be displayed on the display interface. When detecting that some item of tag data is non-null data, the item of tag data to be stored can be stored into a corresponding field object in the first entity class, so that the first entity object storing each item of tag data to be stored corresponding to the log can be created.
S130, calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table.
The session object may be an object created by the user during interaction on the web page, and used for storing user information. The preset storing function may be a function defined in advance for storing the tag data to be stored and the user information as one piece of information into the tag management table. Illustratively, the preset memory function may be defined as follows:
ResultVo insertLogTag(@Validated@RequestBody LogTagReq logTagReq,HttpSession session)
wherein the name of the preset storage function is insert LogTag. ResultVo is a return result class used to characterize whether data storage succeeded or failed. The @ valid tag is used for verifying the stored data, and if the data is abnormal, the abnormal prompt information is uniformly thrown out so as to perform uniform processing. The @ RequestBody tag is for converting data in JSON (JavaScript Object Notification) format into java objects. logTagReq is a first entity parameter of a logTagReq parameter type of a first entity class; session is a session parameter of the http session interface type. By taking the session parameters as input parameters, specific user information can be obtained through the session object in the preset storage function, so that the user information corresponding to the log is also stored in the tag management table.
The tag management table may be a table in a relational database, and is used to store tag data of each log tag for efficient management. Illustratively, the field information in the tag management table may include, but is not limited to: a primary key id, a log type name type _ name, a log type identification tag _ type, a tag identification tag, tag state information tag _ status, an operating system identification platform, an adaptation minimum version min _ version, configuration detail information detail _ config, creator information create _ user, updater information update _ user, creation time create _ time, and update time update _ time. Illustratively, the tag management table may be defined as follows:
Figure BDA0002301430570000071
Figure BDA0002301430570000081
the data type and corresponding storage requirement of each field information are defined in the tag management table so as to perform unified management. It should be noted that, the tag management table includes two pieces of field information, i.e., the creator _ user and the updater _ user, so that it is convenient to quickly obtain the maintenance history of the tag data based on the two pieces of field information in the following. The data type of the configuration detail information details _ config in the tag management table is set to be a long text type, so that a large amount of character string information can be stored, and the configuration detail information details _ config is stored in a JSON data format, so that the configuration dynamics and diversity can be ensured, and the description function of different data can be realized.
Specifically, the first entity object and the session object are used as input parameters, the preset storage function is called, the tag data to be stored and the acquired user information can be automatically stored in the tag management table, manual annotation by a user is not needed, and therefore the processing efficiency of the tag data is improved. And the label management table is used for storing the label data of each log label, so that a large number of log labels can be managed more conveniently and rapidly in a unified manner, and the maintenance management efficiency of the labels is improved.
According to the technical scheme, when a user needs to record tag data, a tag data storage request can be triggered, when the tag data storage request is obtained, a first entity class is instantiated based on the tag data to be stored corresponding to a log in the tag data storage request, a first entity object is created, the first entity object can store the tag data to be stored, the first entity object and a session object used for obtaining user information are used as input parameters, a preset storage function is called, the tag data to be stored and user information can be automatically stored in a tag management table, manual annotation by the user is not needed, the processing efficiency of the tag data is improved, the tag data corresponding to the log can be maintained and managed more conveniently by using the tag management table, and the maintenance and management efficiency of the tag is improved.
On the basis of the above technical solution, the preset storage function may realize the function of storing the tag data to be stored into the tag management table through the following steps S31 to S40:
and S31, acquiring the user information by calling a user information acquisition function in the session object.
The user information obtaining function may be a predefined function for obtaining specific user information. For example, the user information acquisition function may be session.
Specifically, the user information obtaining function user = session.getattrib (oaconstant.admin _ LOGIN _ INFO) in the session object may be called with the constant key information oaconstant.admin _ LOGIN _ INFO as an input parameter, so as to obtain the user information user stored in the value information corresponding to the constant key information in the web page in advance.
And S32, instantiating the management entity class corresponding to the label management table and creating a management entity object.
The management entity class is predefined and is used for acquiring the tag data to be stored in the first entity object and storing the acquired tag data to the entity class in the corresponding tag management table. And each label management table corresponds to one management entity class for unified management. When defining the management entity class, a mapping relation between the management entity class and the management entity class needs to be created. Illustratively, the management entity class may be defined as follows:
Figure BDA0002301430570000091
Figure BDA0002301430570000101
wherein, the name of the management entity class is LogTagConfig. The field information in the management entity class is identical to the field information in the tag management table. The @ Table (name = "log _ tag _ config") indicates name information of the tag management Table to which the management entity class is mapped. The @ Column annotation may be mapped to a field of information in the tag management table, so that a one-to-one mapping relationship between the management entity class and the tag management table may be created through the two annotations.
Specifically, the management entity class corresponding to the tag management table may be instantiated through a new function, so as to obtain a corresponding management entity object. For example, by calling LogTagConfig = new LogTagConfig (), a management entity object LogTagConfig of the type LogTagConfig management entity class is created.
And S33, acquiring each tag data to be stored by calling each tag data acquisition function in the first entity object one by one, and storing each tag data into the management entity object by calling the corresponding tag data storage function in the management entity object one by one.
The tag data obtaining function may refer to a read get function corresponding to each field object in the first entity object. The tag data storage function may refer to a storage set function corresponding to each field object in the management entity object.
Specifically, the log type name may be obtained by calling a log type name obtaining function logtagreq.gettypename () in the first entity object, and calling a log type name storing function logtagconfig.settypename () in the management entity object, and storing the obtained log type name into the management entity object. And calling a log type identifier acquiring function logtagreq.gettagtype () in the first entity object to acquire a log type identifier, calling a log type identifier storing function logtagconfig.settagtype () in the management entity object, and storing the acquired log type identifier into the management entity object. And calling a log type identifier storage function logtag config.settag type () in the management entity object to store the obtained log type identifier into the management entity object. And calling a tag identification obtaining function logtagreq.gettag () in the first entity object to obtain a tag identification, calling a tag identification storage function logtag config.settag () in the management entity object, and storing the obtained tag identification into the management entity object. The tag state information is obtained by calling a tag state information obtaining function logtagreq.gettagstatus () in the first entity object, and a tag state information storing function logtagconfig.settagstatus () in the management entity object is called, and the obtained tag state information is stored in the management entity object. The operating system identifier is obtained by calling an operating system identifier obtaining function logtagreq.gettemplate () in the first entity object, and an operating system identifier storage function logtagconfig.settemplate () in the management entity object is called, and the obtained operating system identifier is stored in the management entity object. And calling an adaptation minimum version acquisition function logtagreq.getminversion () in the first entity object to obtain an adaptation minimum version, calling an adaptation minimum version storage function logtagconfig.setminversion () in the management entity object, and storing the obtained adaptation minimum version into the management entity object. The configuration detail information is obtained by calling a configuration detail information obtaining function logtagreq.getdetailconfig () in the first entity object, and a configuration detail information storing function logtagconfig.setdetailconfig () in the management entity object is called to store the obtained configuration detail information into the management entity object, so that all the tag data to be stored are stored into the management entity object.
S34, detecting whether a label corresponding to the label data to be stored is stored for the first time, and if so, entering a step S35; if not, the process proceeds to step S38.
Specifically, the present embodiment may detect, based on a tag identifier in the tag data to be stored, whether a tag corresponding to the tag data to be stored is stored for the first time in the current tag management table. For example, whether a tag identifier in the tag data to be stored exists in the current tag management table is detected, and if the tag identifier does not exist, it indicates that the tag corresponding to the tag data to be stored is stored for the first time, and the tag data to be stored needs to be stored into the tag management table as a new tag, and at this time, the operation of S35 may be performed. If the tag data exists, it indicates that the tag corresponding to the tag data to be stored is already stored, and the tag data stored in the tag needs to be updated, at this time, the operation of S38 may be performed.
And S35, respectively calling a creator information storage function and an updater information storage function in the management entity object, and storing the user information into the management entity object as creator information and updater information.
Specifically, when the tag corresponding to the tag data to be stored is stored for the first time, both the creator and the updater of the tag are the user, and at this time, the user information may be stored as both creator information and updater information. For example, the user name in the user information may be obtained by calling user.getusername (), and the creator information storage function logtag config.setcreateuser () and the updater information storage function logtag config.setupdateuser () in the management entity object may be called respectively, and the user name in the user information may be stored as the creator name in the creator information and the updater name in the updater information in the management entity object.
Illustratively, the embodiment may also store the user information as creator information and updater information in the management entity object by using a ternary operator manner, so as to improve development efficiency. The specific implementation can be as follows:
logTagConfig.setCreateUser(user==null?"UNKNOWN_USER":user.getUsername())
logtagconfig.setupdateuser (USER = = null; wherein, "? "denotes an optional operator.
And S36, acquiring the current time of the system, and respectively calling a creation time storage function and an update time storage function in the management entity object to store the current time serving as the creation time and the update time into the management entity object.
Specifically, when the tag corresponding to the tag data to be stored is stored for the first time, both the creation time and the update time of the tag may be the current time of the system, and at this time, both the current time of the system may be stored as the creation time and the update time. For example, the current time may be acquired by calling the current time acquisition function system, currenttimemillis () in the system, and stored as the creation time and the update time in the management entity object by calling the creation time storage function logtagconfig, setcreatetime (time) and the update time storage function logtagconfig, setupdatetime (time), respectively.
And S37, calling a storage function in a preset service interface object by taking the management entity object as an input parameter, and storing the label data to be stored and the user information into a label management table.
The preset service interface is an interface which is predefined and used for storing the label data to be stored and the user information in the management entity class into the label management table. The preset service interface object may be an object that inherits the preset service interface in advance, that is, the preset service interface object is an object of a preset service interface type. Illustratively, based on the management entity class LogTagConfig, the preset service interface may be defined as:
Figure BDA0002301430570000141
the logtagconfigthroughput may refer to an interface name of a preset service interface. The service interface can inherit the pagingandsortresultivation < LogTagConfig, integer > paging search interface provided by the system, so that the function of paging search can be realized.
Specifically, the tag data to be stored and the user information may be stored in the tag management table by calling a storage function logtagconfigthroughput in a preset service interface object logtagconfigthroughput.
S38, storing the user information serving as updater information into the management entity object by calling an updater information storage function in the management entity object;
specifically, when the tag corresponding to the tag data to be stored is not stored for the first time, the user information may be stored only as updater information, so as to record the history maintenance information. For example, the user name in the user information may be obtained by calling user, getusername (), and the updater information storage function logtagconfig, setupdateuser in the management entity object is called, and the user name in the user information is stored in the management entity object as the updater name in the updater information.
And S39, acquiring the current time of the system, and storing the current time serving as the update time into the management entity object by calling an update time storage function in the management entity object.
Specifically, when the tag corresponding to the tag data to be stored is not stored for the first time, the current time of the system may be stored only as the update time, so as to record the historical maintenance information. For example, the current time may be acquired by calling a current time acquisition function system in the system, currenttimemillis (), and an update time storage function logtagconfig, setupdatetime (time) in the management entity object is called, and the current time is stored as the update time in the management entity object.
And S40, calling an updating function in the preset service interface object by taking the management entity object as an input parameter, and updating corresponding label data in the label management table.
Specifically, the update function logtagconfigidentifier-update (logtagconfigidentifier) in the preset service interface object logtagconfigidentifier may be called to update the corresponding tag data in the tag management table, and store the latest tag data and the latest user information.
According to the embodiment, the label data of the log labels which are not stored can be stored in the label management table in real time in a mode of calling the preset storage function, and the label data of the log labels which are stored in the label management table can be updated in real time, so that unified management of the labels can be more conveniently carried out by using the label management table, and the maintenance management efficiency of the labels is improved.
Example two
Fig. 2 is a flowchart of a tag data processing method according to a second embodiment of the present invention, where this embodiment describes in detail a query operation of tag data after storing the tag data in a tag management table based on the above embodiment. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted.
Referring to fig. 2, the tag data processing method provided in this embodiment specifically includes the following steps:
s210, a label data storage request triggered by a user is obtained, wherein the label data storage request comprises label data to be stored corresponding to the log.
S220, instantiating the first entity class based on the tag data to be stored, and creating a first entity object so that the first entity object stores the tag data to be stored.
And S230, calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table.
S240, a label query request triggered by a user is obtained, wherein the label query request comprises query condition information.
The tag query request may refer to a request triggered by a user and used for querying the required tag data. The query condition information may be used to characterize condition information that is satisfied by the tag data required by the user. Illustratively, the query condition information may include a query page number pageNum, a tag query number pageCount, and a tag query condition; the tag query conditions may include, but are not limited to: at least one of a log type name typeName, a log type identification tagType, a tag identification tag, tag status information tagStatus, an operating system identification platform, an adaptation minimum version minVersion, configuration detail information detailsConfig, a creation start time createstatttime, a creation end time createindtime, a creator information createUser, and an updateUser for a query. Wherein, the query page number pageNum can be used to represent the page number in the query tag management table. The tag query number pageCount may be used to characterize the number of tags contained in the query page number.
Specifically, the user can input the query condition information on the web page end based on the own requirement, and after the query condition information is input, the web page end can obtain the query condition information input by the user by clicking the trigger mode. When the query condition information is obtained, the webpage side can generate a tag query request based on the query condition information, and can send the tag query request to the server side.
And S250, instantiating the second entity class based on the query condition information, and creating a second entity object so that the second entity object stores the query condition information.
The second entity class is predefined and used for packaging the entity class of the query condition information. The second entity object is an object obtained after the instantiation of the second entity class. The second entity object may be used to store query condition information used by the user for the tag query.
Illustratively, the second entity class may be defined as follows:
Figure BDA0002301430570000171
Figure BDA0002301430570000181
the name of the second entity class is LogTagConditionReq, and the second entity class may include a field object corresponding to each query condition information, so as to store or read corresponding query condition information by using the field object. By adding the @ Data tag in front of the second entity class, a storage set function and a reading get function corresponding to each field object can be automatically generated during compiling, so that the development efficiency is improved.
Specifically, the server may obtain the query condition information by parsing the tag query request, and instantiate the second entity class based on the obtained query condition information to obtain the second entity object. It should be noted that the query page number and the number of tag queries in this embodiment are two parameters that must be input to accurately determine the tag lookup range, so that it is also possible to detect whether the query page number is empty data and whether the number of tag queries is empty data in real time during the instantiation process. When the query page number is detected to be null data or the query number of the tags is detected to be null data, prompt information that the query data cannot be null can be displayed on a display interface of the webpage end so as to prompt a user to input corresponding query data. For example, when the pageNum is empty data, a prompt message "pageNum cannot be empty" may be displayed on the display interface.
And S260, calling a preset query function by taking the second entity object as an input parameter, and querying target label data matched with the query condition information from the label management table.
The target tag data may refer to a query result matched with the query condition information. The preset query function may be a predefined function for querying the tag data in the tag management table, which meets the query condition. Illustratively, the preset query function may be defined as follows:
ResultVo selectLogTagByCondition(@RequestBody LogTagConditionReq logTagConditionReq)
wherein the name of the preset query function is selectologtagbycondition. ResultVo is a return result class for returning the queried target tag data. The @ RequestBody tag is used to convert data in JSON (JavaScript Object Notification) format into java objects. logTagConditionReq is a second entity parameter of the second entity class logTagConditionReq parameter type.
Specifically, the second entity object is used as an input parameter, a preset query function is called, whether target tag data matched with query condition information exists in the tag management table or not can be automatically queried, if yes, the queried target tag data are returned, and the target tag data can be displayed on a display interface of a webpage end for a user to check, so that the tag automatic query function can be achieved through the tag management table, manual query is not needed, query efficiency is improved, and meanwhile maintenance management efficiency of tags is further improved.
Illustratively, the preset query function may realize a function of querying the target tag data matching the query condition information from the tag management table through the following steps S61 to S64:
s61, constructing a sequencing rule object according to the preset sequencing field.
The preset sorting field may be a field according to which the searched target tag data is sorted. For example, the preset ordering field may be an update time updateTime field, such that the query results may be sorted in descending order by update time. The sort rule object may be an object of a sort rule used to characterize the target tag data.
Specifically, the sort rule object sort may be constructed in a new manner. For example, when the preset Sort field is the updateTime field, a Sort rule object Sort may be constructed by calling a function of Sort start = new start (Sort direction desc, "updateTime"), and the Sort rules of the objects are arranged in descending order of the updateTime field.
S62, obtaining the query page number and the label query number in the second entity object, and constructing a paging query object according to the query page number, the label query number and the sequencing rule object.
The paging query object may refer to an object Pageable of a Pageable type for querying a specific page.
Specifically, the query page number may be obtained by calling a query page number obtaining function logtagconditionreq.getpagenum () in the second entity object, and the tag query number may be obtained by calling a tag query number obtaining function logTagCondition req.getpagecount () in the second entity object. And calling a paging query function by taking the query page number, the label query number and the sequencing rule object as input parameters to construct a paging query object. For example, a paged query object Pageable with a query type Pageable is constructed by calling Pageable = new PageRequest (PageNum, pageCount, sort).
And S63, packaging the label query conditions in the effective state in the second entity object, and determining a query condition object.
The valid state may refer to a state in which non-null data is located. The query condition object may be used to store non-empty tag query conditions.
Specifically, since the tag query condition input by the user may be at least one of a log type name, a log type identifier, a tag identifier, tag state information, an operating system identifier, an adaptation minimum version, configuration detail information, a creation start time, a creation end time, creator information, and updater information, it is necessary to obtain a valid tag query condition by detecting whether each tag query condition is non-null data, and encapsulate it as a query condition object. For example, by calling Specification < LogTagConfig > spec = (root, query, builder), the non-empty tag query condition in the second entity object is encapsulated, and a query condition object spec is constructed, so as to obtain the service implementation body. Wherein root is a root object provided by the system, query is a query object provided by the system, and builder is a query condition assembly object provided by the system.
Illustratively, the query condition object spec can be determined by using a lambda expression mode, so that the coding logic is greatly simplified, and the development efficiency is improved. Specifically, in the service implementation body, the log type name obtaining function logtagconditionreq.gettypename () in the second entity object may be called to obtain the log type name typeName, and whether the typeName parameter is not null is judged, if yes, the fuzzy search function may be implemented through the fuzzy function like in the builder object, and the constructed object is stored in the predictive object predicate. For example, a non-empty journal type name typeName may be encapsulated into a prefix object by the following code:
Figure BDA0002301430570000211
next, a tag state information obtaining function logtagconditionreq. Gettagstatus () in the second entity object may be called to obtain tag state information tagStatus, and whether a parameter of tagStatus is not empty is determined, if yes, the non-empty tagStatus is continuously packaged into the predicate object. For example:
Figure BDA0002301430570000212
Figure BDA0002301430570000221
in the code, whether a tagStatus parameter is greater than 0 is judged, if yes, the tagStatus parameter is indicated to be valid data, at the moment, an equal comparison function in a builder object is called to generate a matching rule object tagStatus predicate, whether the predicate object is not empty is judged, if yes, the two query objects are assembled by calling the builder and the building, and an assembled result is assigned to the predicate object. If the result is null, the query object can be directly assigned in a predicate = tagstatusredict manner.
In the same way, the encapsulation of other label query conditions can be realized, and then all the label query conditions in the valid state are encapsulated as query condition objects.
For example, for the assembly of the log type identification tagType, the following code can be used to implement the following steps:
Figure BDA0002301430570000222
Figure BDA0002301430570000231
for example, for the assembly of the creation start time createstatttime and the creation end time createdendtime, the following code may be implemented:
Figure BDA0002301430570000232
for example, the assembly of creator information createUser may be implemented by the following code:
Figure BDA0002301430570000233
Figure BDA0002301430570000241
for example, the assembling of the updateUser information updateUser may be implemented by the following code:
Figure BDA0002301430570000242
for example, for the assembly of the operating system identification platform, this can be achieved by:
Figure BDA0002301430570000243
Figure BDA0002301430570000251
for example, for the assembly of tag identification tag, the following code can be used to implement:
Figure BDA0002301430570000252
and S64, calling a query interface provided by the system according to the paging query object and the query condition object, and querying target label data matched with the query condition information from the label management table.
The query interface may refer to an interface provided by the system for querying data. Specifically, in this embodiment, the paging query object and the query condition object that meet the standard are constructed according to the query standard of the query interface based on the system, so that the paging query object and the query condition object can be used as input parameters, and the query interface provided by the system is directly called, so that the system can automatically query the matched target tag data based on the paging query object and the query condition object, thereby improving the query efficiency.
According to the technical scheme, the target label data matched with the query condition information in the label management table can be queried by using the preset query function, so that the automatic label query function is realized, manual query is not needed, the query efficiency is improved, and meanwhile, the maintenance and management efficiency of the label is further improved.
The following is an embodiment of a tag data processing apparatus according to an embodiment of the present invention, which belongs to the same inventive concept as the tag data processing methods of the above embodiments, and reference may be made to the above embodiment of the tag data processing method for details that are not described in detail in the embodiment of the tag data processing apparatus.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a Tag data processing apparatus according to a third embodiment of the present invention, where the third embodiment is applicable to a case of storing Tag data corresponding to a log, and the apparatus specifically includes: a tag data storage request obtaining module 310, a first entity object creating module 320, and a tag data storage module 330.
The tag data storage request obtaining module 310 is configured to obtain a tag data storage request triggered by a user, where the tag data storage request includes tag data to be stored corresponding to a log; a first entity object creating module 320, configured to instantiate the first entity class based on the tag data to be stored, and create a first entity object, so that the first entity object stores the tag data to be stored; the tag data storage module 330 is configured to call a preset storage function by using the first entity object and the session object as input parameters, and store the tag data to be stored and the user information into the tag management table.
Optionally, the tag data to be stored includes: log type name, log type identifier, tag status information, operating system identifier, lowest version of adaptation, and configuration detail information.
Optionally, the field information in the tag management table includes: a primary key, a log type name, a log type identifier, a tag identifier, tag state information, an operating system identifier, an adaptation minimum version, configuration detail information, creator information, updater information, creation time, and update time.
Optionally, the preset storage function realizes a function of storing the tag data to be stored and the user information into the tag management table by the following steps:
acquiring user information by calling a user information acquisition function in a session object; instantiating a management entity class corresponding to the label management table, and creating a management entity object; acquiring each tag data to be stored by calling each tag data acquisition function in the first entity object one by one, and storing each tag data into the management entity object by calling the corresponding tag data storage function in the management entity object one by one; if the fact that the label corresponding to the label data to be stored is stored for the first time is detected, the creator information storage function and the updater information storage function in the management entity object are called respectively, and the user information is stored into the management entity object as creator information and updater information; acquiring the current time of the system, and respectively calling a creation time storage function and an update time storage function in the management entity object to store the current time serving as the creation time and the update time into the management entity object; and calling a storage function in a preset service interface object by taking the management entity object as an input parameter, and storing the label data to be stored and the user information into a label management table.
Optionally, the preset storage function further realizes a function of storing the tag data to be stored and the user information into the tag management table by the following steps:
if the fact that the label corresponding to the label data to be stored is not stored for the first time is detected, the user information serving as the updater information is stored into the management entity object by calling an updater information storage function in the management entity object; acquiring the current time of the system, and storing the current time serving as the update time into the management entity object by calling an update time storage function in the management entity object; and calling an updating function in a preset service interface object by taking the management entity object as an input parameter to update corresponding label data in the label management table.
Optionally, the apparatus further comprises:
the tag query request acquisition module is used for acquiring a tag query request triggered by a user after storing tag data to be stored into a tag management table, wherein the tag query request comprises query condition information;
the second entity object creating module is used for instantiating a second entity class based on the query condition information and creating a second entity object so that the second entity object stores the query condition information;
and the target label data query module is used for calling a preset query function by taking the second entity object as an input parameter, and querying target label data matched with the query condition information from the label management table.
Optionally, the query condition information includes a query page number, a tag query number, and a tag query condition; the tag query condition includes at least one of a log type name, a log type identifier, a tag identifier, tag state information, an operating system identifier, an adaptation minimum version, configuration detail information, a creation start time, a creation end time, creator information, and updater information for the query.
Optionally, the preset query function realizes a function of querying target tag data matched with the query condition information from the tag management table by the following steps:
constructing a sequencing rule object according to a preset sequencing field; acquiring query page numbers and label query quantity in the second entity object, and constructing a paging query object according to the query page numbers, the label query quantity and the sequencing rule object; packaging the label query conditions in the effective state in the second entity object, and determining query condition objects; and calling a query interface provided by the system according to the paging query object and the query condition object, and querying target label data matched with the query condition information from the label management table.
The tag data processing device provided by the embodiment of the invention can execute the tag data processing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the tag data processing method.
Example four
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which program, when executed by a processor, implements the steps of a tag data processing method as provided by any of the embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the tag data processing method according to the embodiments of the present invention.
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention 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 invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (8)

1. A tag data processing method, comprising:
acquiring a label data storage request triggered by a user, wherein the label data storage request comprises label data to be stored corresponding to a log;
instantiating a first entity class based on the tag data to be stored, and creating a first entity object so that the first entity object stores the tag data to be stored;
calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table;
the step of calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table includes:
acquiring user information by calling a user information acquisition function in the session object;
instantiating the management entity class corresponding to the label management table and creating a management entity object;
acquiring each tag data to be stored by calling each tag data acquisition function in the first entity object one by one, and storing each tag data into the management entity object by calling the corresponding tag data storage function in the management entity object one by one;
if the fact that the label corresponding to the label data to be stored is stored for the first time is detected, the user information is stored into the management entity object as creator information and updater information by respectively calling a creator information storage function and an updater information storage function in the management entity object;
acquiring the current time of a system, and respectively calling a creation time storage function and an update time storage function in the management entity object to store the current time serving as the creation time and the update time into the management entity object;
taking the management entity object as an input parameter, calling a storage function in a preset service interface object, and storing the tag data to be stored and the user information into the tag management table;
if the fact that the label corresponding to the label data to be stored is not stored for the first time is detected, storing the user information serving as updater information into the management entity object by calling an updater information storage function in the management entity object;
acquiring the current time of a system, and storing the current time serving as update time into the management entity object by calling an update time storage function in the management entity object;
and calling an updating function in a preset service interface object by taking the management entity object as an input parameter to update corresponding label data in the label management table.
2. The method of claim 1, wherein the tag data to be stored comprises: log type name, log type identifier, tag state information, operating system identifier, lowest version in adaptation, and configuration detail information.
3. The method of claim 1, wherein the field information in the tag management table comprises: a primary key, a log type name, a log type identifier, a tag identifier, tag state information, an operating system identifier, an adaptation minimum version, configuration detail information, creator information, updater information, creation time, and update time.
4. The method according to any one of claims 1 to 3, further comprising, after storing the tag data to be stored in the tag management table:
acquiring a tag query request triggered by a user, wherein the tag query request comprises query condition information;
instantiating a second entity class based on the query condition information, and creating a second entity object so that the second entity object stores the query condition information;
and calling a preset query function by taking the second entity object as an input parameter, and querying target tag data matched with the query condition information from the tag management table.
5. The method of claim 4, wherein the query condition information comprises a query page number, a tag query number, and a tag query condition; the tag query condition includes at least one of a log type name, a log type identifier, a tag identifier, tag state information, an operating system identifier, an adaptation minimum version, configuration detail information, a creation start time, a creation end time, creator information, and updater information for a query.
6. The method according to claim 5, wherein the preset query function performs the function of querying the tag management table for the target tag data matching the query condition information by:
constructing a sequencing rule object according to a preset sequencing field;
acquiring the query page number and the label query number in the second entity object, and constructing a paging query object according to the query page number, the label query number and the sequencing rule object;
packaging the label query conditions in the effective state in the second entity object, and determining query condition objects;
and calling a query interface provided by a system according to the paging query object and the query condition object, and querying target tag data matched with the query condition information from the tag management table.
7. A tag data processing apparatus, comprising:
the system comprises a tag data storage request acquisition module, a log storage module and a tag data storage request processing module, wherein the tag data storage request acquisition module is used for acquiring a tag data storage request triggered by a user, and the tag data storage request comprises tag data to be stored corresponding to the log;
the first entity object creating module is used for instantiating a first entity class based on the tag data to be stored and creating a first entity object so that the tag data to be stored is stored in the first entity object;
the tag data storage module is used for calling a preset storage function by taking the first entity object and the session object as input parameters, and storing the tag data to be stored and the user information into a tag management table;
the tag data storage module is further configured to:
acquiring user information by calling a user information acquisition function in the session object;
instantiating the management entity class corresponding to the label management table and creating a management entity object;
acquiring each tag data to be stored by calling each tag data acquisition function in the first entity object one by one, and storing each tag data into the management entity object by calling the corresponding tag data storage function in the management entity object one by one;
if the label corresponding to the label data to be stored is detected to be stored for the first time, respectively calling a creator information storage function and an updater information storage function in the management entity object, and storing the user information as creator information and updater information into the management entity object;
acquiring the current time of a system, and respectively calling a creation time storage function and an update time storage function in the management entity object to store the current time serving as the creation time and the update time into the management entity object;
taking the management entity object as an input parameter, calling a storage function in a preset service interface object, and storing the tag data to be stored and the user information into the tag management table;
if the fact that the label corresponding to the label data to be stored is not stored for the first time is detected, the user information serving as updater information is stored into the management entity object by calling an updater information storage function in the management entity object;
acquiring the current time of a system, and storing the current time serving as update time into the management entity object by calling an update time storage function in the management entity object;
and calling an updating function in a preset service interface object by taking the management entity object as an input parameter to update corresponding label data in the label management table.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the tag data processing method according to any one of claims 1 to 6.
CN201911223223.3A 2019-12-03 2019-12-03 Label data processing method and device and storage medium Active CN112905405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911223223.3A CN112905405B (en) 2019-12-03 2019-12-03 Label data processing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911223223.3A CN112905405B (en) 2019-12-03 2019-12-03 Label data processing method and device and storage medium

Publications (2)

Publication Number Publication Date
CN112905405A CN112905405A (en) 2021-06-04
CN112905405B true CN112905405B (en) 2022-12-23

Family

ID=76104349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911223223.3A Active CN112905405B (en) 2019-12-03 2019-12-03 Label data processing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN112905405B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010204863A (en) * 2009-03-02 2010-09-16 Fujitsu Ltd Annotation program, annotation device and annotation method
CN108874971A (en) * 2018-06-07 2018-11-23 北京赛思信安技术股份有限公司 A kind of tool and method applied to the storage of magnanimity labeling solid data
CN109240665A (en) * 2018-08-24 2019-01-18 北京北信源信息安全技术有限公司 Log recording method, device and electronic equipment
CN110321348A (en) * 2019-06-04 2019-10-11 腾讯科技(深圳)有限公司 A kind of data processing method, device and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10061805B2 (en) * 2015-02-25 2018-08-28 Sumo Logic, Inc. Non-homogenous storage of events in event data store
US11061572B2 (en) * 2016-04-22 2021-07-13 Advanced Micro Devices, Inc. Memory object tagged memory monitoring method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010204863A (en) * 2009-03-02 2010-09-16 Fujitsu Ltd Annotation program, annotation device and annotation method
CN108874971A (en) * 2018-06-07 2018-11-23 北京赛思信安技术股份有限公司 A kind of tool and method applied to the storage of magnanimity labeling solid data
CN109240665A (en) * 2018-08-24 2019-01-18 北京北信源信息安全技术有限公司 Log recording method, device and electronic equipment
CN110321348A (en) * 2019-06-04 2019-10-11 腾讯科技(深圳)有限公司 A kind of data processing method, device and computer equipment

Also Published As

Publication number Publication date
CN112905405A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
US9953639B2 (en) Voice recognition system and construction method thereof
US7269593B2 (en) Data processing apparatus and method
CN112882974B (en) JSON data conversion method and device, computer equipment and storage medium
CN110263317B (en) Method and device for generating document template
US20180190292A1 (en) Voice recognition system and construction method thereof
CN108694324B (en) Information leakage monitoring method and device
CN112148343B (en) Rule issuing method and device and terminal equipment
CN108845925B (en) Web page testing method and device, electronic equipment and computer readable medium
CN113268502A (en) Method and equipment for providing information
CN114490658A (en) Node display method, device, storage medium and program product
CN111083054B (en) Route configuration processing method and device, computer equipment and storage medium
CN113568925B (en) Message data conversion method and device, electronic equipment and storage medium
CN113126955A (en) Random data generation method and device, intelligent terminal and storage medium
CN112905405B (en) Label data processing method and device and storage medium
CN116048478B (en) Dictionary escape method, device, equipment and computer readable storage medium
CN114490673B (en) Data information processing method and device, electronic equipment and storage medium
CN113791809B (en) Application exception handling method and device and computer readable storage medium
CN112817782B (en) Data acquisition reporting method and device, electronic equipment and storage medium
CN111711605B (en) Data protocol active analysis method for Internet of things platform
CN114281688A (en) Codeless or low-code automatic case management method and device
CN111786814B (en) Log processing method and device
CN112650600B (en) Method, device and computer equipment for pushing message content
CN109905475B (en) Method for outputting cloud computing monitoring data in specified format based on SQL
CN115599657B (en) Software facility abnormity judgment method
US11704096B2 (en) Monitoring application code usage for improved implementation of reusable code

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