CN113794579A - Label creating method, device, equipment, system and storage medium - Google Patents

Label creating method, device, equipment, system and storage medium Download PDF

Info

Publication number
CN113794579A
CN113794579A CN202110845296.7A CN202110845296A CN113794579A CN 113794579 A CN113794579 A CN 113794579A CN 202110845296 A CN202110845296 A CN 202110845296A CN 113794579 A CN113794579 A CN 113794579A
Authority
CN
China
Prior art keywords
label
target node
tag
node
identification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110845296.7A
Other languages
Chinese (zh)
Inventor
袁桂敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qianxin Technology Group Co Ltd, Secworld Information Technology Beijing Co Ltd filed Critical Qianxin Technology Group Co Ltd
Priority to CN202110845296.7A priority Critical patent/CN113794579A/en
Publication of CN113794579A publication Critical patent/CN113794579A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers

Abstract

The invention provides a label creating method, a device, equipment, a system and a storage medium, wherein the method is used for a label service system, a label data structure of the label service system is a forest data structure, and the method comprises the following steps: determining a first target node of a label to be created and a parent node of the first target node; determining a first tag identification of the first target node and a second tag identification of the parent node; and creating a label of the first target node according to the first label identification and the second label identification. The label creating method, the label creating device, the label creating equipment, the label creating system and the storage medium provided by the invention realize a label service system based on a forest data structure, and the forest data structure does not limit the number and the depth of labels, thereby improving the flexibility of label creation.

Description

Label creating method, device, equipment, system and storage medium
Technical Field
The present invention relates to the field of network security technologies, and in particular, to a method, an apparatus, a device, a system, and a storage medium for creating a tag.
Background
A tag is a form of data used to characterize a business entity. And depicting the business entity through the label, and reflecting the characteristics of the business entity from multiple angles.
However, the label implemented in the prior art has the following problems because different service modules respectively implement a set of programs: the method comprises the following steps that (1) because the label management programs of all service modules are not uniformly realized and the analysis logics are inconsistent, the readability is poor, the maintenance cost is high, and errors are easy to occur; secondly, because the label program is combined with the service code, the same label operation logic can be realized in different service modules once, and hard coding is realized, so that the expansibility is poor; and thirdly, label operation with the same business is repeatedly realized, and the workload and the labor cost are wasted.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a label creation method, a device, equipment, a system and a storage medium.
The invention provides a label creating method, which is used for a label service system, wherein a label data structure of the label service system is a forest data structure, and the method comprises the following steps:
determining a first target node of a label to be created and a parent node of the first target node;
determining a first tag identification of the first target node and a second tag identification of the parent node;
and creating a label of the first target node according to the first label identification and the second label identification.
According to a label creating method provided by the present invention, the determining a first target node of a label to be created and a parent node of the first target node includes:
receiving a first label request message sent by a service system, wherein the first label request message is generated by the service system according to a first set rule and is used for creating a label of the first target node, and the first set rule corresponds to the forest data structure;
performing message verification on the first tag request message to obtain a verification result;
and if the verification result is that the verification is passed, determining a first target node of the label to be created and a father node of the first target node according to the first label request message.
According to a tag creation method provided by the present invention, the performing a message check on the first tag request message includes:
and carrying out message verification on the first tag request message in a Data Transmission Object (DTO) mode.
According to the label creating method provided by the present invention, the first label request message includes the label name of the first target node, and the label name of the parent node and/or the second label identifier.
According to a label creating method provided by the present invention, the determining a first label identifier of the first target node and a second label identifier of the parent node includes:
generating the first label identification according to a second set rule;
if the first target node has the father node, determining the second label identification according to the father node;
if the first target node does not have the father node, determining that the label of the first target node is a top label, and setting the second label identification to be 0.
According to a label creating method provided by the present invention, creating a label of the first target node according to the first label identifier and the second label identifier includes:
determining the label level depth of the forest data structure according to the service level of a service system;
if the label of the first target node is determined to be a top label according to the second label identification, creating the label of the first target node at a top label level in the label level depth;
if the label of the first target node is determined not to be the top label according to the second label identification, determining that the label of the father node is in a first label level in the label level depth;
if the first label level is the top label level, taking the label of the first target node as a child node label of the parent node with the label expanded downwards, and creating the label of the first target node at the next label level with the label expanded downwards at the top label level;
and if the first label level is a label level expanded downwards from the top label level, taking the label of the first target node as a child node label of the label expanded downwards of the parent node, and creating the label of the first target node at a next label level expanded downwards from the first label level.
The label creation method provided by the invention further comprises the following steps:
receiving a second tag request message sent by a service system, where the second tag request message is used to implement at least one of the following functions:
adding a label;
updating the label;
deleting the label;
an enable/disable tag;
retrieving the tags by condition;
acquiring label details;
counting the labels according to conditions;
and the label is associated with the service query.
According to the label creating method provided by the invention, the second label request message is used for deleting the label of the second target node;
the method further comprises the following steps:
if the label of the second target node is a preset label, the label of the second target node is not deleted;
and if the label of the second target node is a non-preset label, deleting the label of the second target node.
According to the label creating method provided by the invention, the second label request message is used for inquiring the label associated service of a third target node;
the method further comprises the following steps:
acquiring a label association relation table used for inquiring the label association service, wherein the label association relation table comprises a label identification of each label in the forest data structure and a service identification of the service associated with each label;
inquiring the label association service of the third target node from the label association relation table to obtain an inquiry result;
and sending the query result to the service system.
The label creation method provided by the invention further comprises the following steps:
and creating a label association relation table, wherein the label association relation table comprises the label identification of each label in the forest data structure and the service identification of the service associated with each label.
According to the label creating method provided by the invention, the label service system comprises an Application Program Interface (API), and the API is used for message transmission between the label service system and the business system.
The invention also provides a label creating device, which is used for a label service system, wherein the label data structure of the label service system is a forest data structure, and the device comprises:
the system comprises a first determining module, a first judging module and a second determining module, wherein the first determining module is used for determining a first target node of a label to be created and a father node of the first target node;
a second determining module, configured to determine a first tag identifier of the first target node and a second tag identifier of the parent node;
and the creating module is used for creating the label of the first target node according to the first label identification and the second label identification.
The present invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the label creation method as described in any one of the above when executing the program.
The invention also provides a label management system, which is characterized by comprising a business system and a label service system; the service system is configured to generate a first tag request message, where the first tag request message is a request message that is generated by the service system according to a set rule and is used to create a tag of the first target node, and the set rule corresponds to a tag data structure of the tag service system; and sending the first tag request message to the tag service system; the label service system is used for executing the steps of any one of the label creation methods.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the label creation method as described in any of the above.
The invention also provides a computer program product having stored thereon a computer program which, when being executed by a processor, carries out the steps of the label creation method as defined in any one of the above.
According to the label creating method, the label creating device, the label creating equipment, the label creating system and the storage medium, the first target node of the label to be created and the father node of the first target node are determined, the first label identification of the first target node and the second label identification of the father node of the first target node are determined, and the label of the first target node is created according to the first label identification and the second label identification, so that the label service system based on the forest data structure is favorably realized, the forest data structure does not limit the number of labels and the depth of the labels, and the flexibility of label creation is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a tag creation method provided by the present invention;
FIG. 2 is a label diagram of a forest data structure provided by the present invention;
FIG. 3 is another schematic flow chart diagram of a label creation method provided by the present invention;
FIG. 4 is a diagram of the API service architecture provided by the present invention;
FIG. 5 is a schematic structural diagram of a label creation apparatus provided in the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. 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 invention.
The label creation method, apparatus, device, system, and storage medium of the present invention are described below with reference to fig. 1 to 6.
Fig. 1 is a schematic flow diagram of a label creating method provided by the present invention, and as shown in fig. 1, the label creating method of the present invention may be applied to a label service system, a label data structure of the label service system is a forest data structure, the forest data structure may have a plurality of trees, and each tree may have a plurality of levels and a plurality of nodes. The label creation method may include the steps of:
step 101, determining a first target node of a label to be created and a parent node of the first target node.
Step 102, determining a first tag identification of the first target node and a second tag identification of the parent node.
Step 103, creating a label of the first target node according to the first label identification and the second label identification.
Specifically, the tag service system for the present invention mainly provides the capability of independently managing tags, and can externally provide different tag operation service.
In this embodiment, a plurality of trees may be implemented by a first tag identifier (i.e., id) of the first target node and a second tag identifier (i.e., pid) of the parent node of the first target node, and each tree may have an infinite level forest data structure.
Such as: as shown in fig. 2, the tag name of the first target node is a notification handle, and the first tag identification (i.e., id) thereof is 3; the second label identification (i.e. pid) of its parent node is 1, i.e. the parent node is a situation awareness platform.
For another example: as shown in fig. 2, the tag name of the first target node is a situation-aware platform, and the first tag identifier (i.e., id) of the first target node is 1; the second label identification (i.e., pid) of its parent node is 0, i.e., the potential sensing platform is a top-level label and has no parent node.
For another example: as shown in fig. 2, the tag name of the first target node is a mail message, and the first tag identification (i.e., id) thereof is 8; the second tag identifier (i.e., pid) of its parent node is 2, i.e., the parent node is a mobile phone terminal.
For another example: as shown in fig. 2, the tag name of the first target node is a mobile phone terminal, and the first tag identifier (i.e., id) of the first target node is 2; the second tag identifier (i.e., pid) of the parent node is 0, that is, the mobile phone terminal is a top-level tag and has no parent node.
The label creating method provided by the invention can determine the first label identification of the first target node and the second label identification of the father node of the first target node by determining the first target node and the father node of the first target node of the label to be created, and create the label of the first target node according to the first label identification and the second label identification, so that the label service system based on the forest data structure is favorably realized, and the forest data structure does not limit the number of labels and the depth of the labels, thereby improving the flexibility of label creation.
Based on any one of the above embodiments, in this embodiment, in executing step 101, the method may include:
receiving a first label request message sent by a service system, wherein the first label request message is generated by the service system according to a first set rule and is used for creating a label of the first target node, and the first set rule corresponds to the forest data structure;
performing message verification on the first tag request message to obtain a verification result;
and if the verification result is that the verification is passed, determining a first target node of the label to be created and a father node of the first target node according to the first label request message.
Specifically, the label service system used in the invention can provide a set of design specifications (i.e. a first set rule) of forest data structures, which can be used by different business systems. And the business system can also generate a first label request message for creating the label according to the design specification of the forest data structure according to the respective business requirements.
Optionally, the first tag request message may comprise the tag name of the first target node, and the tag name of the parent node and/or the second tag identification.
Such as: the first tag request message may include:
Figure BDA0003180614930000081
after receiving the first tag request message, the tag service system can perform message verification on the first tag request message according to the design specification of the forest data structure to obtain a verification result, and if the verification result passes, a first target node of a tag to be created and a parent node of the first target node can be determined according to the first tag request message; if the verification is not passed, returning an abnormal message for indicating that the verification is not passed to the service system.
Optionally, when the first tag request message is subjected to message verification, the first tag request message may be subjected to message verification in a Data Transfer Object (DTO) manner. The DTO mode is mainly used for analyzing and checking the tag request parameters. And for the data passing the verification, performing normalization processing and then storing the data in a database, otherwise, returning the reason for failing the verification to the sender (namely the service system). Such as: the DTO is a data transmission object, a plurality of attributes exist in the object, and non-null, data type and default value verification can be performed on the attributes in the DTO in a functional mode.
In addition to the DTO scheme described above, logic verification may also be performed in the program logic. Compared with the DTO mode, the DTO mode is verified in an object-oriented mode, the code integrity is better, and the code is simpler.
In this embodiment, as shown in fig. 3, the process of implementing label creation between the label service system and the business system may include:
(1) the business system (i.e., platform, system module, terminal, etc. in fig. 3) assembles and transmits the tag message body.
Specifically, the tag message body is a request message which is generated by the business system according to a set rule and is used for creating a tag of the first target node, and the set rule corresponds to a forest data structure of the tag service system.
(2) And the label service system receives a label message body sent by the service system.
(3) The tag service system decodes the tag message body.
(4) And carrying out message verification on the decoded tag message body in a DTO mode.
(5) Judging whether the verification passes, if so, performing warehouse-falling storage according to the forest data result; if not, an exception message is returned to the service system (i.e., the platform, the system module, the terminal, etc. in fig. 3).
The label creating method provided by the invention can receive a first label request message sent by a service system, wherein the first label request message is a request message which is generated by the service system according to a set rule and is used for creating a label of a first target node, and the set rule corresponds to a forest data structure; performing message verification on the first tag request message to obtain a verification result; if the verification result is that the verification is passed, determining the first target node and the father node of the first target node according to the first label request message, so that the label request messages sent by all the service systems are unified, all labels are analyzed and normalized, the problems of disordered codes, poor readability and the like are avoided, the service program and the label program are decoupled, the reusability of the label service is enhanced, namely different service modules can reuse one set of label service; because the independent label service is a micro-service architecture, the platform portability is strong.
Based on any one of the above embodiments, in this embodiment, in executing step 102, the method may include:
generating the first label identification according to a second set rule;
if the first target node has the father node, determining the second label identification according to the father node;
if the first target node does not have the father node, determining that the label of the first target node is a top label, and setting the second label identification to be 0.
Specifically, the label service system used in the present invention may include, but is not limited to, the following four cases when determining the label identifier of each node:
(1) for a first target node without a parent node, the label of the first target node is a top-level label, and the label identifier of the parent node is defaulted to be 0) (namely, the default pid is 0, and the label identifier (namely, id) of the first target node can be automatically generated by a database according to the current sequence (namely, a second set rule); for a first target node with a parent node, a plurality of child node labels or infinite hierarchy grandchild nodes can be established, the label identification (i.e. pid) of the parent node can be transmitted by a label message body (i.e. the label message body is a request message which is generated by the business system according to a set rule and is used for creating the label of the first target node, the set rule corresponds to a forest data structure of the label service system) sent by the business system, and the label identification (i.e. id) can be automatically generated by a database according to the current sequence. Such as: the tag identification (i.e., id) may be generated by a snowflake algorithm, or sequentially, etc.
(2) For a preset tag, the corresponding id and pid values need to be planned in advance, and initialized into a database table, and meanwhile, a set field (i.e., is _ preset field) of the database table is set to 1, which is noted specifically: the preset tag is not allowed to be deleted, and the latest sequence value of the database needs to be updated to be the current value in a set (namely, alert sequence) mode so as to facilitate the automatic addition of the subsequent non-initialized data.
Wherein, the Is _ preset field represents whether a label Is preset or not; if 1, the representative is a preset tag, which needs to be initialized into the database at the time of installation and is not allowed to be deleted.
The alert sequence approach is one implementation of updating database sequences, which is a Structured Query Language (SQL) statement. Such as: after the preset tag is set, the serial number of the latest tag may be 5, and then the current database sequence is changed to 6 in an alert sequence manner, so that failure in subsequent new tag addition is avoided.
(3) The tag service also allows the tag identification (i.e., pid) of the custom parent node to be the top-level tag of 0, but this top-level tag is a non-preset tag, allowing deletion.
(4) For the label hierarchy, the label hierarchy can be increased according to specific services, but the design structure does not limit the number of top-level labels and the depth of the label hierarchy, so the label hierarchy is more flexible and has wide practicability, and a specific label creation example based on a forest data structure can be seen in fig. 2.
The label creating method provided by the invention can generate the first label identification according to the set database sequence rule, can determine the second label identification according to the father node aiming at the first target node with the father node, and can directly set the second label identification as 0 aiming at the first target node without the father node, thereby being beneficial to realizing a label service system based on a forest data structure, and the forest data structure does not limit the number of labels and the depth of the labels, thereby improving the flexibility of label creation.
Based on any one of the above embodiments, in this embodiment, in executing step 103, the method may include:
determining the label level depth of the forest data structure according to the service level of a service system;
if the label of the first target node is determined to be a top label according to the second label identification, creating the label of the first target node at a top label level in the label level depth;
if the label of the first target node is determined not to be the top label according to the second label identification, determining that the label of the father node is in a first label level in the label level depth;
if the first label level is the top label level, taking the label of the first target node as a child node label of the parent node with the label expanded downwards, and creating the label of the first target node at the next label level with the label expanded downwards at the top label level;
and if the first label level is a label level expanded downwards from the top label level, taking the label of the first target node as a child node label of the label expanded downwards of the parent node, and creating the label of the first target node at a next label level expanded downwards from the first label level.
In this embodiment, the label level depth of the forest data structure is determined according to the business level of the business system, such as: as shown in fig. 2, the label hierarchy of the forest data structure has a depth of 3 layers, including a top label hierarchy and a descendant label hierarchy extending downward from the top label hierarchy. The top-level label hierarchy comprises two top-level labels of a situation awareness platform and a mobile phone terminal. The sub-label hierarchy expanded downwards by the top-level label hierarchy comprises a sub-label expanded downwards by the top-level label of the situation awareness platform: reporting disposal, commanding and scheduling and treating resources; and the sub-label of the top label of the mobile phone terminal expanding downwards: e-mail messages, short message messages. The situation-aware platform's top level label downward-extending grandchild label hierarchy includes notification handling the downward-extending child labels: notified and archived; the grandchild tag hierarchy of the top-level tag downward extension of the mobile phone terminal comprises child tags of the mail message downward extension: notification messages, feedback messages.
In this embodiment, if it is determined that the label of the first target node is the top label according to the second label identifier, the label of the first target node is created at a top label level in the label level depth. Such as: and if the second label identification is 0, determining that the label of the first target node is the top-level label. For another example: as shown in fig. 2, the label of the first target node is a top-level label, and at this time, another top-level label, that is, the label of the first target node, may be created at a top-level label level (including two top-level labels, that is, the situation awareness platform and the mobile phone terminal).
In this embodiment, if it is determined that the tag of the first target node is not the top-level tag according to the second tag identifier, it is determined that the tag of the parent node is at the first tag level in the tag level depth. Such as: and if the second label identification is not 0, determining that the label of the first target node is not the top label. For another example: as shown in fig. 2, the label of the parent node may be a top level label hierarchy, or a descendant label hierarchy that extends downward from the top level label hierarchy.
In this embodiment, if the first label hierarchy is a top label hierarchy, the label of the first target node is used as a child node label of the parent node, and the label of the first target node is created at a next label hierarchy of the top label hierarchy. Such as: as shown in fig. 2, the label of the parent node is the top label of the situation awareness platform, and at this time, the label of the first target node may be extended downward at the top label of the situation awareness platform.
In this embodiment, if the first label hierarchy is a label hierarchy in which the top label hierarchy is expanded downward, the label of the first target node is used as a child node label in which the label of the parent node is expanded downward, and the label of the first target node is created in a next label hierarchy in which the label of the first target node is expanded downward. Such as: as shown in fig. 2, the label of the parent node is a child node label of the top-level label of the situational awareness platform, that is, a report handling, and at this time, the label of the first target node may be extended downward in the report handling of the child node label, so as to obtain a label tree structure finally.
The label establishing method provided by the invention can determine the label hierarchy depth of the forest data structure according to the service hierarchy of a service system, determine the position of the first target node in the label hierarchy depth according to the first label identification and the second label identification, and establish the label of the first target node at the position, thereby realizing the label tree structure, and the structure does not limit the number of labels and the label depth, thereby improving the flexibility of label establishment.
Based on any of the above embodiments, in this embodiment, the tag creation method may further include:
receiving a second tag request message sent by a service system, where the second tag request message is used to implement at least one of the following functions:
adding a label;
updating the label;
deleting the label;
an enable/disable tag;
retrieving the tags by condition;
acquiring label details;
counting the labels according to conditions;
and the label is associated with the service query.
Specifically, the tag service system for the present invention may provide a tag call service for a business system. As shown in fig. 4, the tag call service mainly includes: adding labels, updating labels, deleting labels, enabling/disabling labels, retrieving labels according to conditions, obtaining label details, counting labels according to conditions, inquiring label associated services and the like.
Wherein, adding the label refers to the process of label library falling.
Updating a tag, deleting a tag, enabling/disabling a tag all refer to operations directed to a stock-dropping tag.
Retrieving a tag by a condition refers to retrieving according to a certain condition. Such as: all child node tags under a parent tag are searched or retrieved implicitly by name.
Acquiring tag details refers to acquiring tag details. Such as: details of the "network attack skill tag" are obtained, who created it, when the creation event was, what traffic was mainly tagged, and what its parent node tag was and what its child node tag was.
The label is counted according to the condition, namely counting is carried out according to a certain condition. Such as: counting according to whether the preset is carried out or not to obtain the preset and non-preset ratio; statistics can also be performed according to each tree in the forest structure to see how many label nodes each tree has.
In order to meet the requirement, a service and label association relation table, namely a tb _ tag _ lin table, can be set, and a target service field and a label table are associated in a mode of a target service identifier (namely target) and a label identifier (tag _ id) in the table, so as to facilitate subsequent retrieval of different services from label dimensions.
The label creating method provided by the invention can receive a second label request message sent by the service system, and the second label request message is used for asking for a label to call the service, thereby improving the practicability of the label service system.
Based on any of the above embodiments, in this embodiment, the second tag request message is used to delete a tag of a second target node; the label creation method may further include: if the label of the second target node is a preset label, the label of the second target node is not deleted;
and if the label of the second target node is a non-preset label, deleting the label of the second target node.
Specifically, the second target node may be the same as or different from the first target node. The preset tag may refer to a preset tag that is not allowed to be deleted. The non-preset tag may refer to a custom tag that allows deletion. Such as: the top label with pid 0 is customized, but the top label is a non-preset label, and deletion is allowed.
The label service system used in the invention can provide label deletion service for the business system. If the label needing to be deleted is a preset label, the deletion is not allowed; and if the label needing to be deleted is a non-preset label, allowing deletion.
The label creation method provided by the invention can be used for deleting the label of the second target node by receiving a second label request message sent by a service system, and if the label of the second target node is a preset label, the label of the second target node is not deleted; if the label of the second target node is a non-preset label, the label of the second target node is deleted, so that the reliability of the label service system is improved.
Based on any of the above embodiments, in this embodiment, the second tag request message is used to query a tag association service of a third target node; the label creation method may further include:
acquiring a label association relation table used for inquiring the label association service, wherein the label association relation table comprises a label identification of each label in the forest data structure and a service identification of the service associated with each label;
inquiring the label association service of the third target node from the label association relation table to obtain an inquiry result;
and sending the query result to the service system.
Specifically, a service and tag association relationship table, namely tb _ tag _ lin table, may be set for the service and tag association query, that is, the query is about which service a tag is associated with, and a target service field and the tag table are associated by means of a target service identifier (i.e., target) and a tag identifier (tag _ id) in the table, so as to facilitate subsequent different service retrieval from the tag dimension.
The label creating method provided by the invention can receive a second label request message sent by a service system, wherein the second label request message is used for inquiring the label associated service of a third target node; at this time, the label associated service query service can be provided for the service according to the second label request message, so that the practicability of the label service system is improved.
Based on any of the above embodiments, in this embodiment, the tag creation method may further include: and creating a label association relation table, wherein the label association relation table comprises the label identification of each label in the forest data structure and the service identification of the service associated with each label.
The label establishing method provided by the invention can establish the label association relation table in order to provide the label association business query service for the business system, thereby being convenient for providing the label association business query service for the business system in time when receiving the label association business query request of the business system, and improving the accuracy and efficiency of the label service.
Based on any one of the above embodiments, in this embodiment, the tag service system includes an Application Programming Interface (API), where the API is used for message transmission between the tag service system and the service system.
Specifically, as shown in fig. 4, the tag service system used in the present invention may provide a uniform API service interface for the service system (i.e., the platform, the system module, the terminal, etc. in fig. 4) to be called by the service system (i.e., the platform, the system module, the terminal, etc. in fig. 4). The API service for improving the API service interface mainly comprises the following steps: add, update, delete, enable/disable, retrieve by condition, obtain details, count by condition, tag associated business query, etc.
The label creation method provided by the invention can provide a uniform API service interface for the business system, so that the repeated development of the same operation interface can be avoided, and the resource consumption is reduced. Moreover, by decoupling the service program and the tag program, tag management is independent to be tag service, so that the reusability of the tag service is enhanced, namely different service modules can reuse one set of tag service; because the independent label service is a micro-service architecture, the platform portability is strong.
The following describes the label creation apparatus provided by the present invention, and the label creation apparatus described below and the label creation method described above may be referred to correspondingly.
Fig. 5 is a schematic structural diagram of a tag creation apparatus provided by the present invention, and as shown in fig. 5, the tag creation apparatus provided by the present invention may be used in a tag service system, a tag data structure of the tag service system is a forest data structure, and the tag creation apparatus may include:
a first determining module 51, configured to determine a first target node of a tag to be created and a parent node of the first target node;
a second determining module 52, configured to determine the first tag identifier of the first target node and the second tag identifier of the parent node;
a creating module 53, configured to create a label of the first target node according to the first label identifier and the second label identifier.
The label creating device provided by the invention can determine the first label identification of the first target node and the second label identification of the father node of the first target node by determining the first target node and the father node of the first target node of the label to be created, and create the label of the first target node according to the first label identification and the second label identification, so that the label service system based on the forest data structure is favorably realized, and the forest data structure does not limit the number of labels and the depth of the labels, thereby improving the flexibility of label creation.
Based on any one of the above embodiments, in this embodiment, the first determining module 51 may include:
a receiving submodule, configured to receive a first tag request message sent by a service system, where the first tag request message is a request message that is generated by the service system according to a first set rule and is used to create a tag of the first target node, and the first set rule corresponds to the forest data structure;
the verification submodule is used for carrying out message verification on the first tag request message to obtain a verification result;
and the first determining submodule is used for determining a first target node of a label to be created and a father node of the first target node according to the first label request message if the verification result is that the label passes the verification.
The label creation device provided by the invention can receive a first label request message sent by a service system, wherein the first label request message is a request message which is generated by the service system according to a set rule and is used for creating a label of a first target node, and the set rule corresponds to a forest data structure; performing message verification on the first tag request message to obtain a verification result; if the verification result is that the verification is passed, determining the first target node and the father node of the first target node according to the first label request message, so that the label request messages sent by all the service systems are unified, all labels are analyzed and normalized, the problems of disordered codes, poor readability and the like are avoided, the service program and the label program are decoupled, the reusability of the label service is enhanced, namely different service modules can reuse one set of label service; because the independent label service is a micro-service architecture, the platform portability is strong.
Based on any of the above embodiments, in this embodiment, the checking sub-module may be specifically configured to perform message checking on the first tag request message in a data transfer object DTO manner.
Based on any of the foregoing embodiments, in this embodiment, the first tag request message includes the tag name of the first target node, and the tag name of the parent node and/or the second tag identifier.
Based on any of the above embodiments, in this embodiment, the second determining module 52 may include:
generating the first label identification according to a second set rule;
if the first target node has the father node, determining the second label identification according to the father node;
if the first target node does not have the father node, determining that the label of the first target node is a top label, and setting the second label identification to be 0.
The label creating device provided by the invention can generate the first label identification according to the set database sequence rule, can determine the second label identification according to the father node aiming at the first target node with the father node, and can directly set the second label identification as 0 aiming at the first target node without the father node, thereby being beneficial to realizing a label service system based on a forest data structure, and the forest data structure does not limit the number of labels and the depth of the labels, thereby improving the flexibility of label creation.
Based on any one of the above embodiments, in this embodiment, the creating module 53 includes:
the second determining submodule is used for determining the label level depth of the forest data structure according to the service level of the service system;
a first creating submodule, configured to create a label of the first target node at a top label level in the label level depth if it is determined that the label of the first target node is a top label according to the second label identifier;
a third determining submodule, configured to determine that the tag of the parent node is in a first tag level in the tag level depths if it is determined that the tag of the first target node is not the top-level tag according to the second tag identifier;
a second creating submodule configured to, if the first label hierarchy is the top label hierarchy, take a label of the first target node as a child node label of the parent node, which is extended downward, and create a label of the first target node at a next label hierarchy of the top label hierarchy, which is extended downward;
a third creating submodule, configured to, if the first label hierarchy is a label hierarchy in which the top label hierarchy is expanded downward, take a label of the first target node as a label of a child node in which a label of the parent node is expanded downward, and create a label of the first target node at a next label hierarchy in which the label of the first target node is expanded downward.
The label creating device provided by the invention can determine the label hierarchy depth of the forest data structure according to the service hierarchy of a service system, determine the position of the first target node in the label hierarchy depth according to the first label identification and the second label identification, and create the label of the first target node at the position, so that the label tree structure is realized, and the structure does not limit the number and the depth of the label, so that the flexibility of label creation is improved.
Based on any one of the above embodiments, in this embodiment, the method may further include:
a receiving module, configured to receive a second tag request message sent by a service system, where the second tag request message is used to implement at least one of the following functions:
adding a label;
updating the label;
deleting the label;
an enable/disable tag;
retrieving the tags by condition;
acquiring label details;
counting the labels according to conditions;
and the label is associated with the service query.
The label creating device provided by the invention can receive a second label request message sent by the service system, and the second label request message is used for asking for a label to call the service, so that the practicability of the label service system is improved.
Based on any of the above embodiments, in this embodiment, the second tag request message is used to delete a tag of a second target node; the device further comprises:
the first processing module is used for not deleting the label of the second target node if the label of the second target node is a preset label;
and the second processing module is used for deleting the label of the second target node if the label of the second target node is a non-preset label.
The label creation device provided by the invention can receive a second label request message sent by a service system, wherein the second label request message is used for deleting the label of a second target node, and if the label of the second target node is a preset label, the label of the second target node is not deleted; if the label of the second target node is a non-preset label, the label of the second target node is deleted, so that the reliability of the label service system is improved.
Based on any of the above embodiments, in this embodiment, the second tag request message is used to query a tag association service of a third target node; the device further comprises:
an obtaining module, configured to obtain a tag association relation table used for querying the tag association service, where the tag association relation table includes a tag identifier of each tag in the forest data structure and a service identifier of a service associated with each tag;
the query module is used for querying the label association service of the third target node from the label association relation table to obtain a query result;
and the sending module is used for sending the query result to the service system.
The label creation device provided by the invention can receive a second label request message sent by a service system, wherein the second label request message is used for inquiring the label associated service of a third target node; at this time, the label associated service query service can be provided for the service according to the second label request message, so that the practicability of the label service system is improved.
Based on any one of the above embodiments, in this embodiment, the method further includes:
and the creating module is used for creating a label association relation table, wherein the label association relation table comprises the label identification of each label in the forest data structure and the service identification of the service associated with each label.
The label creating device provided by the invention can create the label association relation table in order to provide the label association business query service for the business system, so that the label association business query service can be provided for the business system in time when the label association business query request of the business system is received, and the accuracy and the efficiency of the label service are improved.
Based on any one of the above embodiments, in this embodiment, the tag service system includes an API, and the API is used for message transmission between the tag service system and the business system.
The label creation device provided by the invention can provide a uniform API service interface for the service system, so that the repeated development of the same operation interface can be avoided, and the resource consumption is reduced. Moreover, by decoupling the service program and the tag program, tag management is independent to be tag service, so that the reusability of the tag service is enhanced, namely different service modules can reuse one set of tag service; because the independent label service is a micro-service architecture, the platform portability is strong.
Fig. 6 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 6, the electronic device may be used in a tag service system, and includes: a processor (processor)610, a communication Interface (Communications Interface)620, a memory (memory)630 and a communication bus 640, wherein the processor 610, the communication Interface 620 and the memory 630 communicate with each other via the communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a tag creation method comprising:
determining a first target node of a label to be created and a parent node of the first target node;
determining a first tag identification of the first target node and a second tag identification of the parent node;
and creating a label of the first target node according to the first label identification and the second label identification.
In addition, the logic instructions in the memory 630 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
On the other hand, the invention also provides a label management system, which comprises the label service system and the business system shown in any embodiment;
the service system is configured to generate a first tag request message, where the first tag request message is a request message that is generated by the service system according to a set rule and is used to create a tag of the first target node, and the set rule corresponds to a tag data structure of the tag service system; and sending the first tag request message to the tag service system.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the label creation method provided by the above methods, the method comprising:
determining a first target node of a label to be created and a parent node of the first target node;
determining a first tag identification of the first target node and a second tag identification of the parent node;
and creating a label of the first target node according to the first label identification and the second label identification.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the label creation methods provided above, the method comprising:
determining a first target node of a label to be created and a parent node of the first target node;
determining a first tag identification of the first target node and a second tag identification of the parent node;
and creating a label of the first target node according to the first label identification and the second label identification.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (16)

1. A label creation method is used for a label service system, a label data structure of the label service system is a forest data structure, and the method comprises the following steps:
determining a first target node of a label to be created and a parent node of the first target node;
determining a first tag identification of the first target node and a second tag identification of the parent node;
and creating a label of the first target node according to the first label identification and the second label identification.
2. The label creation method of claim 1, wherein said determining a first target node to create a label and a parent node of the first target node comprises:
receiving a first label request message sent by a service system, wherein the first label request message is generated by the service system according to a first set rule and is used for creating a label of the first target node, and the first set rule corresponds to the forest data structure;
performing message verification on the first tag request message to obtain a verification result;
and if the verification result is that the verification is passed, determining a first target node of the label to be created and a father node of the first target node according to the first label request message.
3. The tag creation method according to claim 2, wherein the message checking the first tag request message includes:
and carrying out message verification on the first tag request message in a Data Transmission Object (DTO) mode.
4. The label creation method according to claim 2, wherein the first label request message includes the label name of the first target node, and the label name of the parent node and/or the second label identification.
5. The tag creation method of any of claims 1 to 4, wherein said determining a first tag identification of the first target node and a second tag identification of the parent node comprises:
generating the first label identification according to a second set rule;
if the first target node has the father node, determining the second label identification according to the father node;
if the first target node does not have the father node, determining that the label of the first target node is a top label, and setting the second label identification to be 0.
6. The label creation method of claim 1, wherein creating the label for the first target node based on the first label identifier and the second label identifier comprises:
determining the label level depth of the forest data structure according to the service level of a service system;
if the label of the first target node is determined to be a top label according to the second label identification, creating the label of the first target node at a top label level in the label level depth;
if the label of the first target node is determined not to be the top label according to the second label identification, determining that the label of the father node is in a first label level in the label level depth;
if the first label level is the top label level, taking the label of the first target node as a child node label of the parent node with the label expanded downwards, and creating the label of the first target node at the next label level with the label expanded downwards at the top label level;
and if the first label level is a label level expanded downwards from the top label level, taking the label of the first target node as a child node label of the label expanded downwards of the parent node, and creating the label of the first target node at a next label level expanded downwards from the first label level.
7. The label creation method according to claim 1, further comprising:
receiving a second tag request message sent by a service system, where the second tag request message is used to implement at least one of the following functions:
adding a label;
updating the label;
deleting the label;
an enable/disable tag;
retrieving the tags by condition;
acquiring label details;
counting the labels according to conditions;
and the label is associated with the service query.
8. The label creation method of claim 7, wherein the second label request message is used to delete a label of a second target node;
the method further comprises the following steps:
if the label of the second target node is a preset label, the label of the second target node is not deleted;
and if the label of the second target node is a non-preset label, deleting the label of the second target node.
9. The label creation method of claim 7, wherein the second label request message is used to query a third target node for label associated traffic;
the method further comprises the following steps:
acquiring a label association relation table used for inquiring the label association service, wherein the label association relation table comprises a label identification of each label in the forest data structure and a service identification of the service associated with each label;
inquiring the label association service of the third target node from the label association relation table to obtain an inquiry result;
and sending the query result to the service system.
10. The label creation method according to claim 1 or 7, characterized by further comprising:
and creating a label association relation table, wherein the label association relation table comprises the label identification of each label in the forest data structure and the service identification of the service associated with each label.
11. The label creation method of claim 2, 6, 7, 8 or 9 wherein the label service system includes an Application Program Interface (API) for message transmission between the label service system and the business system.
12. A tag creation apparatus, wherein the apparatus is used for a tag service system, a tag data structure of the tag service system is a forest data structure, and the apparatus comprises:
the system comprises a first determining module, a first judging module and a second determining module, wherein the first determining module is used for determining a first target node of a label to be created and a father node of the first target node;
a second determining module, configured to determine a first tag identifier of the first target node and a second tag identifier of the parent node;
and the creating module is used for creating the label of the first target node according to the first label identification and the second label identification.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the label creation method according to any of claims 1 to 11 are implemented when the program is executed by the processor.
14. A label management system is characterized by comprising a business system and a label service system;
the service system is configured to generate a first tag request message, where the first tag request message is a request message that is generated by the service system according to a first set rule and is used to create a tag of the first target node, and the first set rule corresponds to a tag data structure of the tag service system; and sending the first tag request message to the tag service system;
the label serving system is adapted to perform the steps of the label creation method of any one of claims 1 to 11.
15. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the label creation method according to any one of claims 1 to 11.
16. A computer program product having executable instructions stored thereon, which instructions, when executed by a processor, cause the processor to carry out the steps of the label creation method as claimed in any one of claims 1 to 11.
CN202110845296.7A 2021-07-26 2021-07-26 Label creating method, device, equipment, system and storage medium Pending CN113794579A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110845296.7A CN113794579A (en) 2021-07-26 2021-07-26 Label creating method, device, equipment, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110845296.7A CN113794579A (en) 2021-07-26 2021-07-26 Label creating method, device, equipment, system and storage medium

Publications (1)

Publication Number Publication Date
CN113794579A true CN113794579A (en) 2021-12-14

Family

ID=78876921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110845296.7A Pending CN113794579A (en) 2021-07-26 2021-07-26 Label creating method, device, equipment, system and storage medium

Country Status (1)

Country Link
CN (1) CN113794579A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050016A1 (en) * 2003-09-02 2005-03-03 International Business Machines Corporation Selective path signatures for query processing over a hierarchical tagged data structure
JP2009245196A (en) * 2008-03-31 2009-10-22 Nippon Telegr & Teleph Corp <Ntt> Content management device and method, and program
CN101795197A (en) * 2005-04-19 2010-08-04 三星电子株式会社 Tag generation method in broadcast encryption system
US20140122430A1 (en) * 2012-11-01 2014-05-01 Red Hat Israel, Ltd. Retrieving historical tags hierarchy plus related objects
CN104394604A (en) * 2014-11-26 2015-03-04 武汉理工大学 Wireless ad hoc network based electronic price biding system and communication method
CN109121436A (en) * 2015-11-25 2019-01-01 蒂米菲尔股份有限公司 Augmentation, exploration and Maintenance Significant Items method layered
CN111026753A (en) * 2019-12-04 2020-04-17 北京明略软件系统有限公司 Label storage method and device based on tree structure
CN111226205A (en) * 2017-08-31 2020-06-02 美光科技公司 KVS tree database
CN111625694A (en) * 2020-06-05 2020-09-04 中国银行股份有限公司 Multistage label processing method and device and computer equipment
CN112000849A (en) * 2020-08-21 2020-11-27 河南中原消费金融股份有限公司 Unified label library management method, device, equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050016A1 (en) * 2003-09-02 2005-03-03 International Business Machines Corporation Selective path signatures for query processing over a hierarchical tagged data structure
CN101795197A (en) * 2005-04-19 2010-08-04 三星电子株式会社 Tag generation method in broadcast encryption system
JP2009245196A (en) * 2008-03-31 2009-10-22 Nippon Telegr & Teleph Corp <Ntt> Content management device and method, and program
US20140122430A1 (en) * 2012-11-01 2014-05-01 Red Hat Israel, Ltd. Retrieving historical tags hierarchy plus related objects
CN104394604A (en) * 2014-11-26 2015-03-04 武汉理工大学 Wireless ad hoc network based electronic price biding system and communication method
CN109121436A (en) * 2015-11-25 2019-01-01 蒂米菲尔股份有限公司 Augmentation, exploration and Maintenance Significant Items method layered
CN111226205A (en) * 2017-08-31 2020-06-02 美光科技公司 KVS tree database
CN111026753A (en) * 2019-12-04 2020-04-17 北京明略软件系统有限公司 Label storage method and device based on tree structure
CN111625694A (en) * 2020-06-05 2020-09-04 中国银行股份有限公司 Multistage label processing method and device and computer equipment
CN112000849A (en) * 2020-08-21 2020-11-27 河南中原消费金融股份有限公司 Unified label library management method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张博;盛魁;陈继祥;董辉;: "一种改进的内存索引算法在中药追溯数据处理中的应用", 通化师范学院学报, no. 06 *

Similar Documents

Publication Publication Date Title
KR100866076B1 (en) Method and device for management of tree data exchange
CN110598280B (en) Equipment simulation system and method and computer readable storage medium
CN107889069B (en) Short message gateway selection method, device, server and readable storage medium
CN103190123B (en) For the method and apparatus distributing the message of issue
US20200213365A1 (en) Tag-Based Security Policy Creation in a Distributed Computing Environment
CN109788026B (en) Message processing method and device
CN112256318B (en) Construction method and equipment for dependent product
CN111475369A (en) Log monitoring adding method and device, computer equipment and storage medium
CN110795315A (en) Method and device for monitoring service
CN114125049B (en) Telemetry message processing method, device, equipment and storage medium
CN112217684A (en) API gateway monitoring method, device and system
CN112231055A (en) Mirror image management method and device
CN101667932A (en) Method of network element equipment log management and device
CN107885634B (en) Method and device for processing abnormal information in monitoring
CN114208114A (en) Multi-view security context per participant
CA3065729A1 (en) Business rules processing framework
CN113014618B (en) Message processing method and system and electronic equipment
CN113794579A (en) Label creating method, device, equipment, system and storage medium
CN110688355A (en) Method and device for changing container state
CN115242434A (en) Application program interface API identification method and device
CN112052341A (en) Knowledge graph pruning method and device
CN112235367A (en) Method, system, terminal and storage medium for subscribing entity behavior relation message
US20120096063A1 (en) Method for managing configuration information of an outsourced part, and method and system for managing an alarm of an outsourced part
CN112671825B (en) Kafka message processing method and system
CN112148479B (en) Data processing method, device and computer equipment based on Siddi log audit

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