Method and device for calculating content label
By dividing content labels into periodic and non-periodic labels, and using the distributed computing power of the number warehouse, the real-time and efficiency problems of complex logical content label calculations are solved, and the standardized construction and flexible calculation of content label rules are realized. , applicable to various content subject labels, improving the scope of business analysis.
Patent Information
- Application Number
- CN202410898176.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively solve the real-time, calculation time, performance consumption and multi-dimensional query requirements of complex logical content label calculation, and lacks the standardized construction and flexible computing capabilities of content label rules.
By dividing content labels into periodic labels and non-periodic labels, using periodic timing scheduling calculations and real-time computing engines to process them separately, combining the distributed computing power of the number warehouse, designing content label rules and attribute data storage structures, realizing automated calculations and Aggregation analysis.
It improves the efficiency and flexibility of content label calculation, supports real-time and periodic calculations, reduces system power consumption, realizes multi-dimensional query capabilities, and applies multiple content subject label calculations, avoiding additional manual development work.
Smart Images

Figure CN118964375A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for calculating content tags. Background Art
[0002] Nowadays, by defining and combining content tags, you can realize the object selection function, such as personnel selection, product selection, etc. There are many existing methods to realize the object selection function, such as using computing engines such as spark, elasticsearch, clickhouse, or bitamp for calculation, but generally they convert the content tag calculation logic configured on the page into SQL query statements according to certain parsing methods, and some methods will further convert it into corresponding computing engine query statements, such as clickhose, to calculate the results.
[0003] With the continuous development of business, the requirements for content tag calculation are becoming higher and higher, such as real-time requirements, calculation time requirements, performance consumption requirements, support requirements for content tag calculation of complex logic, and multi-dimensional query requirements for content tag calculation results.
[0004] Data warehouse: The full name is data warehouse, which can be abbreviated as DW or DWH. A data warehouse is a strategic collection of all types of data support for decision-making processes at all levels of an enterprise. It is a single data store created for analytical reporting and decision support purposes. It provides guidance for business process improvement, monitoring time, cost, quality, and control for enterprises that need business intelligence.
[0005] Content: The substance or meaning contained within something, relative to its form. It can be a user, an article, or other items.
[0006] Content attributes: refers to a set of data that describes and characterizes the characteristics, features or descriptive information of the content; usually divided into: basic attributes, which are some attributes inherent to the content that change very rarely, such as place of origin, production date, user gender, product specifications, etc.; behavioral attributes, which are attributes generated by active or passive behavior of the content, such as the user's last visit time, amount spent in the past 30 days, number of likes, number of favorites, etc.
[0007] Content label: Content label is a highly refined feature identifier obtained by analyzing content information, and is also a key factor in forming a portrait. Summary of the invention
[0008] In order to solve the above problems, the embodiments of the present application provide a method and device for calculating content tags, which solve the problem of calculating content tags with complex logic and realize the standardized construction and flexible calculation of content tag rules.
[0009] In a first aspect, an embodiment of the present application provides a method for calculating a content tag, the method comprising:
[0010] Acquire content tags, and divide the content tags into periodic tags and non-periodic tags;
[0011] Calculating the content tag according to the periodic attribute of the content tag: performing periodic calculation on the periodic tag and calculating the non-periodic tag according to real-time demand;
[0012] The calculation results of the content tags are obtained, and the calculation results are aggregated, analyzed and stored according to preset tag rules.
[0013] Preferably, the “dividing the content tags into periodic tags and non-periodic tags” specifically includes:
[0014] Presetting an update period for the content tags, and dividing the content tags into periodic tags and non-periodic tags;
[0015] The update period includes at least a preset statistical period and a non-preset fixed period.
[0016] Preferably, the “calculating the content tag according to the periodic attribute of the content tag” specifically includes:
[0017] Performing periodic calculation on the periodic tag includes: performing calculation according to the periodic timing scheduling calculation engine of the periodic tag;
[0018] The real-time calculation of the non-periodic tag includes: when the real-time demand is obtained, using the real-time calculation engine to perform calculation; the real-time demand includes calculation request, update request, and settlement request.
[0019] Preferably, when the content tag is created / calculated for the first time, a real-time calculation engine is used for calculation.
[0020] Preferably, calculating the content tag specifically includes:
[0021] Presetting the judgment conditions and comparison values of the content attributes;
[0022] Obtaining an attribute value of the content attribute of the content tag;
[0023] Calculate the attribute value and the comparison value according to the judgment condition;
[0024] The judgment condition is an operation method between the attribute value and the comparison value, and the judgment condition at least includes: greater than, equal to, including, less than, among, all meet, one of the meet, and none of the meet. In specific implementation, the judgment condition is a single operation form or a feasible combination of multiple operation forms.
[0025] Preferably, the “obtaining the calculation results of the content tags, and performing aggregate analysis and storage on the calculation results according to preset tag rules” specifically includes:
[0026] Preset labeling rules, where the labeling rules are used to calculate the calculation results of multiple content attributes;
[0027] The calculation result of the content tag is obtained, and the calculation result of the content tag is output according to the tag rule and stored.
[0028] Preferably, the “aggregating, analyzing and storing the calculation results according to a preset tag rule” specifically includes:
[0029] The label rules include rule group conditions and label rule conditions;
[0030] Combining and classifying the content attributes;
[0031] Presetting a rule group condition for each combination, the rule group condition is used to calculate the calculation result of the content attribute in the combination;
[0032] Outputting the rule group result of each combination according to the rule group condition;
[0033] Preset multiple combined label rule conditions, wherein the label rule conditions are used to calculate multiple rule group results;
[0034] The calculation result of the content tag is output according to the tag rule condition and stored.
[0035] In a second aspect, an embodiment of the present application provides a device for calculating a content tag, the device comprising:
[0036] Data acquisition module: obtain content tags and divide the content tags into periodic tags and non-periodic tags;
[0037] Classification calculation module: calculate content tags according to the periodic attributes of content tags: perform periodic calculations on periodic tags and calculate non-periodic tags according to real-time needs;
[0038] Aggregation analysis module: obtains the calculation results of content tags, and aggregates and analyzes and stores the calculation results according to preset tag rules.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method provided in the first aspect or any possible implementation of the first aspect are implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect or any possible implementation manner of the first aspect.
[0041] The beneficial effects of the present invention are:
[0042] The present invention provides a method and device for calculating content tags. The content tag calculation logic of the page configuration is no longer directly converted into SQL query conditions. Instead, the content tag calculation logic of the page configuration is standardized and the content attribute data is objectified. According to the business understanding of tags and practical scenarios, the tag periodicity marks are stored, and the content tags are divided into periodic tags and non-periodic tags. The calculation process is automated, and real-time tag calculation and periodic tag calculation are supported at the same time. For periodic tag calculation, the distributed computing capability of the data warehouse is used to solve the pressure of batch content tag calculation and the efficiency problem of business query tags. The timing scheduling capability of the data warehouse platform is used to solve the problem of updating the calculation results of periodic tags.
[0043] Design and construct the content tag rule storage structure and the content tag attribute data storage structure. Combine the content tag rule storage structure and the content tag attribute data storage structure to design a universal content tag calculation logic to avoid additional manual development work, realize the standardized construction and flexible calculation of content tag rules, apply to a variety of different content subject tag calculations, and realize the simultaneous calculation of a variety of different subject tags.
[0044] Perform aggregate analysis and partition storage on content tag calculation results, provide multi-dimensional query capabilities for content tags, and expand the scope of business analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of a method for calculating content tags provided in an embodiment of the present application;
[0047] Figure 2A schematic diagram of the structure of a device for calculating content tags provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0049] Figure 4 Schematic diagram of the relationship between labels, rules and rule groups. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0051] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.
[0052] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.
[0053] See also Figure 1 , Figure 1 : is a flowchart of a method for calculating content tags provided in an embodiment of the present application. In an embodiment of the present application, the method includes:
[0054] S101: Obtain content tags, and divide the content tags into periodic tags and non-periodic tags.
[0055] The execution subject of the present application may be a data processing system of a database or a software program.
[0056] In this application, the entity objects of the content tags are diverse, such as individuals, articles, forums, etc., and the attribute information contained in the entity objects is the content attributes. Taking individuals as an example, such as {"name":"Zhang San","gender":"Male","date of birth":930216,"height":177,"number of days the app is opened this month":30,"number of check-ins this week":7,"total amount spent":2000,"hobbies":"cars, digital"}.
[0057] Based on the actual situation, the items of content attributes are generated according to demand, and the content attributes have changing characteristics under the influence of the actual environment. Some content attributes are variables, such as the cumulative amount of spending, number of check-in days, etc., while some content attributes are relatively fixed parameters, such as date of birth, gender, etc. For fixed parameters, there is no need to update, but for variables, they need to be updated.
[0058] In this application, content tags are divided periodically, including periodic content tags and non-periodic content tags. The basis for the division can be the periodic update requirements of the content attributes under the content tags, or the actual needs of the users. It can be understood that the higher the update frequency of the content tags, the stronger the timeliness of the data itself, and the lower the update frequency, the worse the timeliness; based on this, content tags can be assigned higher frequency cycles and relatively lower frequency cycles according to the specific requirements of the content tags. Specifically, for example, the number of posts and likes in a forum often requires a higher frequency update cycle to meet the instant operation requirements of the forum; and a user's weekly and monthly check-in situation can meet the actual statistical needs, reminder needs, etc. with a relatively low frequency update cycle.
[0059] Therefore, when calculating for different individual content tags, the present application utilizes the concept of periodic division of content tags to differentiate content tags, and implements periodic calculation and demand-based real-time calculation to achieve the purpose of reducing system power consumption.
[0060] It can be understood that for periodic calculations, no matter how many calculation requests appear within a cycle, a relatively stable result will be obtained based on the obtained data. That is, if the data remains unchanged, only one calculation is required, and the same settlement content can be output when responding to demands in subsequent cycles; while for demand-based real-time calculations, each calculation request may obtain different calculation results.
[0061] When the data changes or the calculation method is optimized and adjusted, the calculation should be re-based on the acquired data to obtain new settlement content. However, for periodic content tags, the data changes have a relatively stable cycle, and excluding human interference factors, this special situation can be ignored.
[0062] It is understandable that when calculating content tags, relatively fixed parameters other than variables can also be classified as periodic variables; since the update of periodic variables is implemented according to their period, when dealing with relatively fixed parameters, their update period can be set to a longer time span, and they do not need to be updated within a certain time span, so that they are not calculated frequently, but there is no restriction on their changes.
[0063] In one possible implementation, content tags can be divided according to the concept of periodicity, including periodic tags and non-periodic tags. In a specific implementation, an update period can be preset for the content tags, and the content tags can be divided into periodic tags and non-periodic tags, and different calculation methods can be used for the content tags with two periodic attributes.
[0064] It can be understood that the update cycle includes at least a preset statistical cycle and a non-preset fixed cycle. For example, the preset statistical cycle may be a statistical cycle for the number of likes, a statistical cycle for the increase in attention, etc., such as statistics once a week, once a month, once a year, etc.; the non-preset fixed cycle may be a calculation cycle for age, a calculation cycle for service life, etc., such as updating age once a year and updating service life once a day / weekly / monthly, etc.
[0065] In this application, the acquisition of content tags is based on stored data. Under this requirement, the content tag calculation logic of the page configuration can be standardized, the content attribute data can be objectified, and the content table rule storage structure and the content tag attribute data storage structure can be designed and constructed to realize the attribute extraction, circle selection calculation, etc. of the content tag.
[0066] In a feasible embodiment, a content tag rule storage structure can be preset, such as according to the business's understanding of tags and usage scenarios, and combined with the page content tag rule configuration form, the content tag calculation logic of the page configuration is parsed, and a reasonable content tag rule storage structure is designed and constructed to achieve standardized construction and flexible calculation of content tag rules.
[0067] Specifically, it can be divided into a label basic information structure table, a label rule group information structure table, and a label rule information structure table. The specific table elements are as follows:
[0068] Tag basic information structure table:
[0069]
[0070] Tag rule group information structure table:
[0071]
[0072] Tag rule information structure table:
[0073]
[0074] The relationship between tags, rules and rule groups is as follows: Figure 4 As shown:
[0075] In a feasible embodiment, the content tag attribute data storage structure is:
[0076] Objectify the content attribute data and generate a content attribute collection table in Json format. The specific table structure is as follows:
[0077]
[0078] By storing the content tags and their related rules as described above, when calculating the content tags, the specific attributes of the content tags can be directly obtained, and the related rules can be called for calculation, so as to select the target objects and high-quality objects.
[0079] In a feasible embodiment, a content attribute set table and tag rule data are obtained, and the rule data are combined; the tag rule data comes from a tag service database, that is, the content data of a tag basic information structure table, a tag rule group information structure table, and a tag rule information structure table generated according to the page tag rule configuration, and the three tables are associated and merged into one table to generate a rule combination table, and the table structure elements are as follows:
[0080]
[0081] On this basis, when calculating content tags, the content tag calculation tasks are divided according to the tag update cycle, and different calculation methods are implemented for content tags with different period attributes.
[0082] S102, performing content tag calculation according to the periodic attribute of the content tag: performing periodic calculation on periodic tags, and performing calculation on non-periodic tags according to real-time requirements.
[0083] In the embodiment of the present application, the periodic properties of the content tags can be automatically identified by the system or initially divided manually. In the subsequent implementation process, the periodic properties can be directly matched to facilitate the rapid calculation of the content tags.
[0084] In this application, calculating the content tag according to the periodic attribute of the content tag specifically includes:
[0085] Perform periodic calculations on periodic tags, that is, schedule the calculation engine to perform calculations according to the periodicity of the periodic tags. The batch calculation engine can be used in conjunction with the scheduled scheduling capabilities of the data warehouse platform to solve the update of periodic tags while reducing system performance consumption.
[0086] The non-periodic tags are calculated according to the real-time demand, that is, when the real-time demand is obtained, the real-time computing engine is used for calculation; the real-time demand includes calculation request, update request, and settlement request, wherein the calculation request can be triggered by the actual demand of the user, the update request can be triggered by the data update cycle based on the built-in storage system / database, and the settlement request can be triggered by the settlement demand based on the built-in storage system / database; specifically, the calculation request is the active demand of the user end, and the update request is the passive update behavior of the storage system, which can be preset by the staff; the settlement request is the periodic settlement, such as the year-end summary, the phased task goals, etc.
[0087] It is understandable that, except for the first creation of content tags, most tag calculations do not require real-time calculations, such as tags with strong periodicity, such as reaching the monthly payment target, weekly clocking in, whether you signed in yesterday, etc. Based on this, when a content tag is created / calculated for the first time, real-time calculation references can be used for calculation.
[0088] In the embodiment of the present application, the content tag calculation specifically includes:
[0089] Presetting the determination conditions and comparison values of the content attributes;
[0090] Obtaining an attribute value of the content attribute of the content tag;
[0091] Calculate the attribute value and the comparison value according to the judgment condition;
[0092] Among them, the comparison value can be an expected value input from the outside, such as the expected grade is 25 years old, the expected number of likes is more than 20,000, etc.; the comparison value is formed based on the specific object of the content attribute, the content attribute and the attribute value are associated and unified, and the attribute value is used to measure the magnitude or degree of the content attribute; the content attribute is the name of the subject, such as grade; the attribute value is the quantity measuring the subject, such as 28 years old.
[0093] In the present application, the judgment condition is the operation method between the attribute value and the comparison value. Exemplarily, the judgment condition can be less than, to filter the attribute value that is less than the comparison value. As in the example above, 28 years old is greater than 25 years old, so the individual corresponding to the content label is not in the circle, and only individuals under 25 years old are in the circle; therefore, the judgment condition can have a variety of operation methods according to actual needs, including at least: greater than, equal to, including, less than, among, all meet, one of the meet, and none of the meet.
[0094] When adapting to different content attributes and individuals, adaptive adjustments can be made to select targets and filter ranges.
[0095] S103: Obtain calculation results of content tags, and aggregate and analyze and store the calculation results according to preset tag rules.
[0096] In an embodiment of the present application, the content attributes contained in the content tag are calculated based on the judgment conditions. When the expected judgment is no, the calculation result is negative, indicating that the individual or the content attribute does not meet the selection criteria; when the expected judgment is yes, the calculation result is positive, indicating that the individual or the content attribute meets the selection criteria.
[0097] In one possible implementation, step S103 specifically includes:
[0098] Preset labeling rules, where the labeling rules are used to calculate the calculation results of multiple content attributes;
[0099] The calculation result of the content tag is obtained, and the calculation result of the content tag is output according to the tag rule and stored.
[0100] When storing, historical data and the latest data can be stored separately based on periodic updates, so as to calculate the causal coefficient of single item increments or related items and meet more practical selection needs.
[0101] In this application, for multiple content attributes, label rules can be set directly for each content attribute, and the content attributes can be calculated through the operation form guided by the label rules, and the calculation results can be output. In this relatively single selection requirement, the calculation results can be directly obtained; and the behavior of aggregate analysis in this process is only a single judgment, which can be directly obtained based on the calculation results of the content attributes without complex comparison and screening.
[0102] Considering the complexity of individual content labels, expectations are also diverse. For example, if there are expectations for only some of the individual content attributes, these expectations can be combined; if there are only necessary expectations for some content attributes and preferred expectations for some content attributes, these expected attributes can be combined separately; finally, the final calculation result is obtained based on the judgment of the attributes in each combination to meet the selection conditions. In this relatively complex selection requirement, it is not possible to draw a conclusion directly. It is necessary to use aggregate analysis to settle the results in each combination and the results between multiple combinations in turn to finally obtain the calculation result.
[0103] In a specific embodiment, the tag rule may be further refined to include a rule group condition and a tag rule condition, wherein the rule group condition is used to calculate the result of calculating the content attribute in the combination, and the tag rule condition is used to calculate multiple rule group results; specifically:
[0104] The label rules include rule group conditions and label rule conditions;
[0105] Combining and classifying the content attributes;
[0106] Presetting a rule group condition for each combination, the rule group condition is used to calculate the calculation result of the content attribute in the combination;
[0107] Outputting the rule group result of each combination according to the rule group condition;
[0108] Preset multiple combined label rule conditions, wherein the label rule conditions are used to calculate multiple rule group results;
[0109] The calculation result of the content tag is output according to the tag rule condition and stored.
[0110] Conditional screening starts from a single content attribute of a content tag, and the group result of each combination is output based on the judgment result of the content attribute within each combination. The content tag is finally judged based on the group results between multiple combinations, i.e. the final calculation result. This covers multiple and multi-faceted attribute judgments on content tags (individuals), resulting in more refined feature identification and a more accurate data portrait.
[0111] In the embodiment of the present application, the table structure of the content attribute combination table and the rule combination table can be used to design a matching general SQL calculation logic, thereby avoiding additional manual development work and automating the calculation process. The specific process is as follows:
[0112] The content attribute combination table and the rule combination table are associated and merged through the association key;
[0113] Extract object attribute values, taking hive as an example: use the built-in get_json_object function to implement it, specifically get_json_object(content attribute set, '$.${attribute}');
[0114] Rule attribute value judgment combines the attribute value judgment condition, the actual attribute value and the attribute judgment value to perform conditional comparison; the case when rule can be used to supplement the judgment conditions in order, and the rule attribute value judgment result is marked. If satisfied, it is marked as 1, and if not satisfied, it is marked as 0. For the convenience of the following description, the generated result field is recorded as rule_flag. The specific example is as follows:
[0115] “
[0116] Case
[0117] When attribute value judgment condition = greater than and attribute actual value > attribute judgment value then 1
[0118] When attribute value judgment condition = less than and attribute actual value < attribute judgment value then 1
[0119] When attribute value judgment condition = equal and attribute actual value = attribute judgment value then 1
[0120] When attribute value judgment condition = in which and REGEXP_COUNT (attribute judgment value, attribute actual value)>0then 1
[0121] When attribute value judgment condition = contains and REGEXP_COUNT (attribute actual value, attribute judgment value)>0then 1
[0122] When attribute value judgment condition = greater than N days from now and datediff (object attribute value, now(), 'dd') > rule attribute value then 1
[0123] Else 0
[0124] End rule_flag
[0125] ”.
[0126] According to the rule group condition aggregation judgment, group by content ID, tag ID, rule group ID, aggregate rule_flag, because the value is 1 or 0, the sum method can be used for aggregation, count rule_flag, use the count method, and judge the rule group conditions, rule_flag aggregation value, and rule_flag count value at the same time. If the condition is met, it is recorded as 1, and if it is not met, it is recorded as 0. The generated rule group judgment result is recorded as group_flag. The specific example is as follows:
[0127] “
[0128] Case
[0129] When the condition in the rule group = satisfies one of them and sum(rule_flag)>0then 1
[0130] When conditions in rule group = all satisfied and sum(rule_flag) = count(rule_flag) then 1
[0131] When the conditions in the rule group = all are not satisfied and sum(rule_flag) = 0 then 1
[0132] Else 0
[0133] End group_flag
[0134] ”.
[0135] According to the tag rule condition aggregation judgment, group by content ID, tag ID, and similarly aggregate group_flag. Since the value is 1 or 0, the sum method can be used for aggregation. Group_flag is counted. The count method is used to combine the tag rule condition, group_flag aggregation value, and group_flag count value for judgment. If the condition is met, it is recorded as 1, and if it is not met, it is recorded as 0. The generated tag rule condition judgment result is recorded as tag_flag. The specific example is as follows:
[0136] “
[0137] Case
[0138] When tag rule condition = satisfies one of them and sum(group_flag)>0 then 1
[0139] When tag rule condition = all full and sum(group_flag) = count(group_flag) then 1
[0140] When tag rule conditions = all not satisfied and sum(group_flag) = 0 then 1
[0141] Else 0
[0142] End tag_flag
[0143] ”.
[0144] Group by tag ID without partitioning, aggregate the tag set in the required format, and generate a tag content information table;
[0145] Group fixed-period partitions by tag ID, aggregate and calculate changes in the number of content covered by tags, support querying historical content ID information by tag, and generate historical content information tables;
[0146] Grouping by content ID without partitioning, aggregating tag sets in the required format, and generating a content tag information table;
[0147] Group fixed-period partitions by content ID, aggregate and calculate changes in the number of content ID tags, support querying historical tag information by content ID, and generate a historical tag information table.
[0148] By performing aggregate analysis and partitioned storage on the results of content tag calculations, the scope of analysis can be expanded. For example, tag changes can be analyzed by content dimension (such as the daily trend of article collection rankings) and content quantity changes can be analyzed by tag dimension (such as the weekly trend of the number of high-value user tags).
[0149] The following will be combined with the attached Figure 2 , the device for calculating content tags provided in the embodiment of the present application is introduced in detail. It should be noted that the attached Figure 2 The device for calculating content tags shown is used to execute the present application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.
[0150] See also Figure 2 , Figure 2 is a schematic diagram of a structure of a device for calculating content tags provided by an embodiment of the present application. Figure 2 As shown, the device comprises:
[0151] Data acquisition module 201: acquiring content tags, and dividing the content tags into periodic tags and non-periodic tags;
[0152] Classification calculation module 202: performs content tag calculation according to the periodic attribute of the content tag: performs periodic calculation on periodic tags, and performs calculation on non-periodic tags according to real-time requirements;
[0153] Aggregation analysis module 203: obtains the calculation results of the content tags, and performs aggregation analysis and storage on the calculation results according to preset tag rules.
[0154] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (Field-Programmable Gate Array, FPGA), an integrated circuit (Integrated Circuit, IC), etc.
[0155] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0156] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 3 As shown, the electronic device 300 may include: at least one central processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0157] The communication bus 302 is used to realize the connection and communication between these components.
[0158] The user interface 303 may include a display screen (Display) and a camera (Camera). The optional user interface 303 may also include a standard wired interface and a wireless interface.
[0159] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0160] Among them, the central processing unit 301 may include one or more processing cores. The central processing unit 301 uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the terminal 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the central processing unit 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The central processing unit 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics central processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the central processing unit 301, and it can be implemented separately through a chip.
[0161] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned central processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.
[0162] exist Figure 3 In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the central processor 301 can be used to call the application for calculating the content tag stored in the memory 305, and specifically perform the following operations:
[0163] Acquire content tags, and classify the content tags into periodic tags and non-periodic tags according to content attributes of the content tags;
[0164] Performing content tag calculation according to the periodic attribute of the content tag: performing periodic calculation on the periodic tag and performing real-time calculation on the non-periodic tag;
[0165] The calculation results of the content tags are obtained, and the calculation results are aggregated, analyzed and stored according to preset tag rules.
[0166] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0167] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0168] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0169] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0170] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0172] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.
[0173] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0174] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for calculating content tags, characterized in that: The method comprises: Acquire content tags, and divide the content tags into periodic tags and non-periodic tags; Calculating the content tag according to the periodic attribute of the content tag: performing periodic calculation on the periodic tag and calculating the non-periodic tag according to real-time demand; The calculation results of the content tags are obtained, and the calculation results are aggregated, analyzed and stored according to preset tag rules.
2. The method according to claim 1, characterized in that The “dividing the content tags into periodic tags and non-periodic tags” specifically includes: Presetting an update period for the content tags, and dividing the content tags into periodic tags and non-periodic tags; The update period includes at least a preset statistical period and a non-preset fixed period.
3. The method according to claim 1, characterized in that The “calculating the content tag according to the periodic attribute of the content tag” specifically includes: Performing periodic calculation on the periodic tag includes: performing calculation according to the periodic timing scheduling calculation engine of the periodic tag; The real-time calculation of the non-periodic tag includes: when the real-time demand is obtained, using the real-time calculation engine to perform calculation; the real-time demand includes calculation request, update request, and settlement request.
4. The method according to claim 3, characterized in that When the content tag is created / calculated for the first time, a real-time calculation engine is used for calculation.
5. The method according to claim 1, characterized in that Content tag calculation specifically includes: Presetting the judgment conditions and comparison values of the content attributes; Obtaining an attribute value of the content attribute of the content tag; Calculate the attribute value and the comparison value according to the judgment condition; The judgment condition is an operation method between the attribute value and the comparison value, and the judgment condition at least includes: greater than, equal to, including, less than, among, all meet, one of the meet, and none of the meet.
6. The method according to claim 5, characterized in that The "obtaining the calculation results of the content tags, and performing aggregate analysis and storage on the calculation results according to preset tag rules" specifically includes: Preset labeling rules, where the labeling rules are used to calculate the calculation results of multiple content attributes; The calculation result of the content tag is obtained, and the calculation result of the content tag is output according to the tag rule and stored.
7. The method according to claim 6, characterized in that The “aggregating, analyzing and storing the calculation results according to the preset label rules” specifically includes: The label rules include rule group conditions and label rule conditions; Combining and classifying the content attributes; Presetting a rule group condition for each combination, the rule group condition is used to calculate the calculation result of the content attribute in the combination; Outputting the rule group result of each combination according to the rule group condition; Preset multiple combined label rule conditions, wherein the label rule conditions are used to calculate multiple rule group results; The calculation result of the content tag is output according to the tag rule condition and stored.
8. A device for calculating content tags, characterized in that: include: Data acquisition module: obtain content tags and divide the content tags into periodic tags and non-periodic tags; Classification calculation module: calculate content tags according to the periodic attributes of content tags: perform periodic calculations on periodic tags and calculate non-periodic tags according to real-time needs; Aggregation analysis module: obtains the calculation results of content tags, and aggregates and analyzes and stores the calculation results according to preset tag rules.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that:When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
