Service distribution method and device, electronic equipment and storage medium
Through the unified storage format and query dimension processing of business content, the problem of low distribution efficiency among massive content is solved, and efficient business content storage and distribution is achieved.
Patent Information
- Application Number
- CN202411139200.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-13
AI Technical Summary
In the process of retrieval and distribution of massive content, there are problems of low distribution efficiency and high complexity, especially because different business content data use different storage structures, the storage and distribution of each type of content need to be processed separately. .
By determining content query conditions, storing and querying business contents based on query dimensions and attribute fields, and sorting and distributing them using a unified storage format and query dimensions, the storage and distribution process of business contents is simplified.
It realizes efficient storage and query of business content, reduces development costs, improves distribution efficiency, simplifies distribution process, and meets user diversity needs.
Smart Images

Figure CN119127939A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the technical field of content data processing, and in particular to a service distribution method, device, electronic device and storage medium. Background Art
[0002] With the expansion of content types and the growth of content quantity, how to retrieve a set of content streams suitable for various distribution scenarios from the massive content and distribute them to meet the diverse needs of users for obtaining content, and in the process reduce development costs and improve distribution efficiency has become an urgent problem to be solved.
[0003] In the related art, different business content data are stored in different data structures, so different business content data need to be stored separately according to needs during the storage and distribution process. This means that when the content data is subsequently retrieved, each type of content data needs to be searched separately, resulting in low distribution efficiency and other issues. Summary of the invention
[0004] In order to solve the above-mentioned problems existing in the prior art, the first aspect of the present invention provides a business distribution method, including: determining a content query condition, wherein the content query condition is determined based on a query dimension, wherein the query dimension includes multiple attribute fields, wherein the attribute field is consistent with the attribute field included in the business content storage format; in the stored business content, querying the business content that is consistent with the attribute field under the dimension corresponding to the content query condition, wherein the stored business content includes business content stored in a unified storage format according to the attribute field; and distributing the queried business content.
[0005] In one embodiment, determining the content query condition includes: obtaining a content package, parsing the content package, and obtaining the content package query condition, wherein the content package includes business content that has been queried based on the attribute field under the dimension corresponding to the content package query condition, and the content package query condition is a content query condition corresponding to the business content included in the query content package; obtaining a query dimension and / or a sorting rule, and splicing the content package query condition, the query dimension and / or the sorting rule to obtain the content query condition.
[0006] In one implementation, distributing the queried business content includes: sorting the queried business content on the corresponding query dimension according to the query dimension and the sorting rule; and distributing the sorted business content.
[0007] In one implementation, obtaining the content query condition includes: determining a query identifier, where the query identifier is used to uniquely identify a combination of a content package query condition, a query dimension, and a sorting rule; and based on the query identifier, obtaining the content query condition that matches the query identifier.
[0008] In one embodiment, the stored business content is stored in the following manner: determining one or more attribute types corresponding to the business content, and determining the attribute fields included in the one or more attribute types; in response to the corresponding attribute type and attribute field being stored in the stored business content, filling the corresponding field content at the corresponding attribute field according to the attribute field and the attribute type, so as to store the business content according to the attribute field.
[0009] In one embodiment, the method further includes: in response to the corresponding attribute type and / or attribute field not being stored in the stored business content, adding attribute type and / or attribute field, and filling field content in the added attribute type and / or attribute field to store the business content according to the attribute field.
[0010] The second aspect of the present invention provides a business distribution device, the device comprising: a determination unit, used to determine a content query condition, the content query condition is determined based on a query dimension, the query dimension includes a plurality of attribute fields, wherein the attribute fields are consistent with the attribute fields included in the business content storage format. A processing unit, used to search for business content consistent with the attribute fields under the dimension corresponding to the content query condition in the stored business content, wherein the stored business content includes business content stored in a unified storage format according to the attribute fields, and distribute the queried business content.
[0011] In one embodiment, the determination unit determines the content query condition in the following manner, including: obtaining a content package and parsing the content package to obtain a content package query condition, wherein the content package includes business content that has been queried based on an attribute field under a dimension corresponding to the content package query condition, and the content package query condition is a content query condition corresponding to the business content included in the query content package; obtaining a query dimension and / or a sorting rule, and concatenating the content package query condition, the query dimension and / or the sorting rule to obtain a content query condition.
[0012] In one implementation, the processing unit distributes the queried business content in the following manner: sorting the queried business content on the corresponding query dimension according to the query dimension and the sorting rule; and distributing the sorted business content.
[0013] In one embodiment, the determination unit obtains the content query condition in the following manner: determining a query identifier, the query identifier being used to uniquely identify a combination corresponding to a content package query condition, a query dimension, and a sorting rule; based on the query identifier, obtaining the content query condition matching the query identifier.
[0014] In one embodiment, the stored business content is stored in the following manner: determining one or more attribute types corresponding to the business content, and determining the attribute fields included in the one or more attribute types; in response to the corresponding attribute type and attribute field being stored in the stored business content, filling the corresponding field content at the corresponding attribute field according to the attribute field and the attribute type, so as to store the business content according to the attribute field.
[0015] In one embodiment, the device also includes: in response to the corresponding attribute type and / or attribute field not being stored in the stored business content, adding attribute type and / or attribute field, and filling field content in the added attribute type and / or attribute field to store the business content according to the attribute field.
[0016] A third aspect of the present invention provides an electronic device, comprising: a memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the method described in the first aspect or any one of the implementations of the first aspect.
[0017] A fourth aspect of the present invention provides a computer-readable storage medium, which stores instructions. When the instructions are executed by a processor, the method described in the first aspect or any one of the embodiments of the first aspect is executed.
[0018] In the business distribution method provided by the present invention, content query conditions are determined based on query dimensions, and business content that is consistent with the attribute fields under the corresponding dimensions in the content query conditions is obtained from the stored business content stored in a unified storage format according to attribute fields, thereby achieving unified storage and query of business content, reducing the complexity of business content storage and query, and improving the efficiency of business content search and distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0020] Figure 1 The figure is a flow chart showing a service distribution method according to an exemplary embodiment.
[0021] Figure 2 The figure is a schematic diagram showing a normalized data storage process according to an exemplary embodiment.
[0022] Figure 3 The figure is a flowchart of a method for storing stored business content according to an exemplary embodiment.
[0023] Figure 4 The present invention is a flowchart showing a method of determining a content query condition and distributing service content according to an exemplary embodiment.
[0024] Figure 5 The present invention is a flowchart of a method for determining a content query condition according to an exemplary embodiment.
[0025] Figure 6 It is a schematic diagram of a method for determining a query identifier according to an exemplary embodiment.
[0026] Figure 7 It is a schematic diagram of a method for determining a content query condition according to an exemplary embodiment.
[0027] Figure 8 The present invention is a sequence diagram showing an execution process of a service content storage method according to an exemplary embodiment.
[0028] Fig. 9 The diagram is a schematic diagram of a method for generating and using a query identifier according to an exemplary embodiment.
[0029] Fig.10 The figure is a block diagram of a service distribution device according to an exemplary embodiment.
[0030] Fig.11 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0031] The principle and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way.
[0032] It should be noted that although the expressions "first", "second", etc. are used herein to describe different modules, steps, data, etc. of the embodiments of the present invention, the expressions "first", "second", etc. are only used to distinguish between different modules, steps, data, etc., and do not indicate a specific order or importance. In fact, the expressions "first", "second", etc. can be used interchangeably.
[0033] In the accompanying drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limitations on the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure. The embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.
[0034] The business distribution method provided by the embodiment of the present disclosure is applied to the field of data processing. The business distribution method provided by the embodiment of the present disclosure mainly determines the query conditions including the query dimension, queries the stored business content, obtains the business content of the attribute fields in the stored business content corresponding to the query dimension in the query condition, and distributes the queried business content. With the expansion of content types and the increase in the amount of content, how to retrieve a set of content streams suitable for various distribution scenarios from massive content to meet the diverse needs of users to obtain content, and in the process reduce development costs and improve distribution efficiency, has become an urgent problem to be solved.
[0035] In the related art, different business contents are stored in different storage formats. For example, in a database storing business contents, different types of business contents are stored in different data tables, and the attribute fields or field settings contained in different data tables are not completely the same. Therefore, when distributing the stored data in the related art, it is necessary to query the business contents in different data tables based on different content query conditions, and obtain different business contents respectively, and distribute the obtained different business contents together as the business contents to be distributed, which has the problems of low data storage efficiency and complicated content distribution process.
[0036] In an exemplary embodiment, taking tourism-related content as an example, the business forms of user-generated content (UGC) include: long text and pictures, short text and pictures, videos, questions and answers, etc.; the business forms of professionally generated content (PGC) include official guides, gameplay, etc. The distribution of content includes various information streams, search result content streams, etc. For different distribution scenarios, different combinations and sorting of these contents are required in order to present content that better meets user needs. In related technologies, each business content stores corresponding content data, and the content distributor, according to demand, requests an interface from each content business, sorts and assembles the content after obtaining it, and then returns it. Each additional distribution scenario requires joint development by the business party and the distributor, and as the content types expand and diversify, it becomes increasingly inefficient.
[0037] In view of this, an embodiment of the present disclosure provides a business distribution method, which determines content query conditions based on query dimensions, queries business content that is consistent with the attribute fields under the dimension corresponding to the query conditions from stored business content stored in a unified storage format according to attribute fields, and distributes the queried content, thereby improving the storage efficiency of business content and simplifying the complexity of the business content distribution process.
[0038] Figure 1 is a flow chart of a service distribution method according to an exemplary embodiment. Figure 1 shown.
[0039] In step S11, a content query condition is determined. The content query condition is determined based on a query dimension. The query dimension includes a plurality of attribute fields. The attribute fields are consistent with the attribute fields included in the business content storage format.
[0040] In the disclosed embodiment, the content query condition is used to perform a query operation on the stored business content, and obtain the business content that meets the content query condition in the stored business content. For example, the content query condition can be to filter some or all attribute fields in the stored business content containing multiple attribute fields, and obtain the business content in the stored business content that is consistent with the attribute fields included in the content query condition.
[0041] In the embodiment of the present disclosure, the attribute fields included in the query dimension all exist in the multiple attribute fields included in the stored business content. For example, if the business content storage format includes five attributes A, B, C, D and E, the attribute fields included in the query dimension may be A, C and D.
[0042] In the disclosed embodiment, in the content query condition determined based on the query dimension, logical operators such as "AND", "OR", and "NOT" can be used to combine different attribute fields to express different logical combination expressions. For example, if the business content storage format includes A, B, C, D, and E, and the query dimension includes three attribute fields A, C, and D, then the content query condition can be "A AND C NOT D", which means obtaining the business content corresponding to the attribute fields A and C in the stored business content, and not obtaining the business content corresponding to the attribute field D. For the unmentioned attribute fields B and E, it can be determined whether to query the two attribute fields B and E based on the preset default query settings.
[0043] In step S12, the stored business contents are searched for business contents having the same attribute fields under the dimension corresponding to the content query condition.
[0044] In the embodiment of the present disclosure, the stored business content includes business content stored in a unified storage format according to attribute fields.
[0045] In the embodiments of the present disclosure, the stored business content can be stored in a database or file system that can store multiple attribute fields. For example, the stored business content can be stored in a relational database (RDBMS), a NoSQL database, and a document storage database. It should be understood that the above data storage method for storing the stored business content is only for illustrative purposes, and the embodiments of the present disclosure do not limit the data storage method for storing the stored business content.
[0046] In the embodiment of the present disclosure, the business content can be stored in a normalized manner by setting a unified normalization interface. The schematic diagram of the normalized data storage is as follows: Figure 2 As shown, Figure 2 It is a schematic diagram of a normalized data storage process according to an exemplary embodiment. The business type is uniformly generated and managed by the normalized storage, and the business type identifier (id) registered in the normalized storage data is recorded through the configuration (conf) file. For example, the business identifier corresponding to the guide business in the configuration file is 1, the business identifier corresponding to the travel notes business is 2, and the business identifier corresponding to the video business is 3. When a new business needs to be connected to the storage, a new type id is assigned to the newly added business in the configuration file. And set the factory class to obtain the business class according to the business type. For example, the business class corresponding to the guide business type is the guide class (Guide), the business class corresponding to the travel notes business type is the travel notes class (Note), and the business class corresponding to the video business type is the video class (Video). The business details interface is defined as an abstract interface by the normalized storage, and each business implements it separately, and informs the normalized storage implementation class, which is registered in the code by the normalized storage.
[0047] In an embodiment of the present disclosure, if the unified storage format of the stored business content is A, B, C, D and E, the content query condition can be "A AND C NOT D", and it is set not to obtain the unmentioned attribute fields, then the business content consistent with the attribute fields under the dimension corresponding to the content query condition is queried in the stored business content, that is, the queried business content is the business content corresponding to the attribute fields A and C in the stored business content.
[0048] In step S13, the queried business content is distributed.
[0049] In the disclosed embodiment, distribution can be that the server sends the queried business content to one or more electronic devices or other servers that trigger the use of content query conditions to obtain the queried business content. For example, if the user clicks on the "Spring Flower Viewing" interface on the terminal, the business content corresponding to the content query condition "Spring Flower Viewing" in the stored business content is obtained, and the server sends the queried business content matching "Spring Flower Viewing" to the terminal.
[0050] In the disclosed embodiment, by searching for business content that is consistent with the attribute fields in the dimension corresponding to the content query conditions according to the content query conditions, and distributing the queried business content, the stored business content that is stored in the unified storage format can be queried and distributed, thereby improving the distribution efficiency of the business content.
[0051] Figure 3 is a flowchart of a method for storing stored business content according to an exemplary embodiment. Figure 3 shown.
[0052] In step S21, one or more attribute types corresponding to the business content are determined, and attribute fields included in the one or more attribute types are determined.
[0053] In the disclosed embodiment, the business content may correspond to a variety of attribute types. For example, a strategy graphic content with a word count greater than a preset threshold may belong to both a long graphic service and a strategy service.
[0054] In the disclosed embodiment, an attribute type may include multiple attribute fields. For example, as shown in Table 1, Table 1 includes the attribute fields of the long image and text attribute type, wherein the attribute name represents the name of the attribute field, represents a specific feature or field of the data, the field name represents the name of the attribute field when the data is stored, the business identifier is recorded as busi_id, the title information is recorded as title, the text information is recorded as content, the author information is recorded as uid, the atlas information is recorded as img_list, the release time is recorded as ctime, the number of words is recorded as words_num, and the address information may include an associated destination identifier and an associated point of interest identifier, the associated destination identifier is recorded as mdd_list, the associated point of interest identifier is recorded as poi_list, the content level is recorded as level, the associated tag is recorded as tag_list, the content quality score is recorded as score, and the number of likes is recorded as like_num. Among them, the point of interest identifier is used to identify the point of interest, and the point of interest (POI) specifically refers to the specific location information and name on the map. The field type of the business identifier and author information is a long integer data type (long), the field type of the title information and body information is a long string data type (text), the field type of the atlas information and associated tags is a keyword array data type (keyword), the field type of the release information is a date data type (date), the field type of the number of characters, associated destination identifier, associated point of interest identifier, content rating and number of likes is an integer data type (integer), and the field type of the content quality score is a floating point data type (float), among which the associated destination identifier and associated point of interest identifier are arrays.
[0055] Table 1
[0056]
[0057]
[0058] In step S22a, in response to the corresponding attribute type and attribute field being stored in the stored business content, the corresponding attribute field is filled with corresponding field content according to the attribute field and attribute type, so as to store the business content according to the attribute field.
[0059] In the disclosed embodiment, if the corresponding attribute type and attribute field already exist in the stored business content, the storage is directly written into the corresponding attribute field according to the attribute field and attribute type.
[0060] In an exemplary embodiment, the attribute types and attribute fields stored in the stored business content are shown in Table 2, and each data is composed of a unique identifier, a business identifier, an attribute type, title information, text information, author information, atlas information, publishing time, number of characters and address information. Different data in the business table are distinguished by business identifiers. As shown in Table 2, the stored business content is the data corresponding to the unique identifier 11, the corresponding business identifier is 1, the attribute type is 1, the title information is "Title 1", the text information is "Content 1", the author information is 1, the atlas information is 1, the publishing time is "Date 1", the number of characters is "Character 1", the associated destination identifier is "101,102", and the associated point of interest identifier is "1001,1002". If the newly added business content is data corresponding to the unique identifier 21, the corresponding business identifier is 2, the attribute type is 1, the corresponding title information is "Title 2", the text information is "Content 2", the author information is 2, the atlas information is 2, the release time is "Date 2", the number of characters is "Character 2", the associated destination identifier is "201,202", and the associated point of interest identifier is "2001,2002". If there is no new attribute type and attribute field in the newly added business content with the unique identifier 21, the business content with the unique identifier 21 is directly written into Table 2 without modifying the attribute field.
[0061] Table 2
[0062]
[0063] In step S22b, in response to the fact that the corresponding attribute type and / or attribute field is not stored in the stored business content, an attribute type and / or attribute field is added, and the field content is filled in the added attribute type and / or attribute field to store the business content according to the attribute field.
[0064] In the embodiment of the present disclosure, if it is detected that the attribute type in the newly added service content is an attribute type that has not been stored in the stored service content, a value of the attribute type is added to identify the attribute type of the newly added service content.
[0065] In an exemplary embodiment, as shown in Table 3, the stored business content is data corresponding to the unique identifier 11, the corresponding business identifier is 1, the attribute type is 1, the title information is "title 1", the text information is "content 1", the author information is 1, the atlas information is 1, the publishing time is "date 1", the number of characters is "character 1", the associated destination identifier is "101, 102", and the associated point of interest identifier is "1001, 1002". If the newly added business content is data corresponding to the unique identifier 22, the corresponding business identifier is 2, the attribute type is 2, the corresponding title information is "title 2", the text information is "content 2", the author information is 2, the atlas information is 2, the publishing time is "date 2", the number of characters is "character 2", the associated destination identifier is "201, 202", and the associated point of interest identifier is "2001, 2002". Since the attribute type of the newly added business content is an attribute type that has not been stored in the stored business content, a value of attribute type 2 can be added to identify the attribute type of the newly added business content.
[0066] Table 3
[0067]
[0068] In the embodiment of the present disclosure, the content query condition can be determined by additional query dimensions and / or sorting rules based on the content package composed of the queried business content.
[0069] Figure 4 FIG. 1 is a flowchart showing a method of determining a content query condition and distributing service content according to an exemplary embodiment. Figure 4 shown.
[0070] In step S31, a content package is acquired and parsed to obtain a content package query condition.
[0071] In the embodiment of the present disclosure, the content package query condition is a content query condition corresponding to the business content included in the query content package.
[0072] In the disclosed embodiment, the content package is obtained by querying the stored business content through the content package query condition, including the business content that has been queried based on the attribute field under the dimension corresponding to the content package query condition. By parsing the content package, the content package query condition used when querying the business content in the content package can be obtained.
[0073] In step S32, the query dimension and / or sorting rule is obtained, and the content package query condition, the query dimension and / or the sorting rule are concatenated to obtain the content query condition.
[0074] In the disclosed embodiment, the query dimensions obtained may be part or all of the query dimensions included in the multiple query dimensions corresponding to the content package query conditions, and the sorting rule may be sorting according to one or more of the obtained query dimensions.
[0075] In the disclosed embodiment, the content package query conditions are adjusted and spliced by query dimensions and / or sorting rules to obtain new content query conditions. For example, if the uniform storage format of the stored business content includes five attribute fields A, B, C, D and E, the content package query condition represents the acquisition of the business content corresponding to the attribute fields A, C and D in the stored business content, and the obtained content package includes the business content corresponding to the attribute fields A, C and D in the stored business content. After the content package is obtained and parsed, the content package query condition is obtained as the business content corresponding to the query attribute fields A, C and D, then the obtained query dimension can represent the business content corresponding to the query attribute fields A and C, and the sorting rule can be to sort the business content based on C.
[0076] In step S33, the queried business contents are sorted on the corresponding query dimensions according to the query dimensions and sorting rules.
[0077] In the disclosed embodiment, if the query dimension and sorting rule are obtained, the query dimension and sorting method are limited based on the content package query condition obtained based on the content package. For example, the uniform storage format of the stored business content includes five attribute fields A, B, C, D and E. The content package query condition represents the acquisition of the business content corresponding to the attribute fields A, C and D in the stored business content, and the obtained content package includes the business content corresponding to the attribute fields A, C and D in the stored business content. And the query dimension obtained represents the business content with the query attribute field A being A1, and the sorting rule is to sort the business content based on C. Then, based on the business content stored in the content package, the business content with the attribute field A being A1 is screened, and the screened business content is sorted according to the business content of C.
[0078] In step S34, the sorted business contents are distributed.
[0079] In the first embodiment of the present invention, by parsing the existing content package, the content package query conditions are obtained, and on the basis of the content package query conditions, the obtained query dimensions and sorting rules are combined to obtain new content query conditions, and the distribution of new content query data is realized, which effectively utilizes the existing content package for business content distribution and reduces the complexity of business content distribution.
[0080] In the disclosed embodiment, by determining the query identifier, it is possible to quickly obtain the content query condition for sorting and filtering the content packages according to the query dimension and the sorting rule.
[0081] Figure 5 is a flowchart of a method for determining a content query condition according to an exemplary embodiment. Figure 5 shown.
[0082] In step S41, a query identifier is determined.
[0083] In the disclosed embodiment, the query identifier is used to uniquely identify a combination of a content package query condition, a query dimension, and a sorting rule. The query identifier can be used to indicate a content package query condition, a preset query dimension, and a sorting rule corresponding to an existing content package.
[0084] In step S42, based on the query identifier, a content query condition matching the query identifier is obtained.
[0085] In the disclosed embodiment, based on the content package query condition, query dimension and sorting rule determined by the query identifier, the content package query condition, query dimension and sorting rule are combined to obtain the corresponding content query condition.
[0086] In an exemplary embodiment, the query identifier can be recorded as code, and the user identifier can be called uid, such as Figure 6 As shown, Figure 6 This is a schematic diagram of a query identifier determination method according to an exemplary embodiment. According to the distribution scenario requirements, the call dimensions (destination, POI, tag, etc.) and sorting methods of the content in the content package can be set in the background to generate a call code. Through the unified content package interface, the code and other parameters required for the call dimensions are passed in to obtain the content data. A content package can set different call dimensions and sorting methods to generate different codes. Figure 6 In the example, code1 indicates that uid is used as the query dimension, publishing time is used as the sorting rule, and the query dimension and sorting rule are combined as the calling rule to query the content package. Code2 indicates that the destination is used as the query dimension, the number of likes is used as the sorting rule, and the query dimension and sorting rule are combined as the calling rule to query the content package.
[0087] In the disclosed embodiment, by setting a query identifier, it is possible to quickly determine the content query condition for querying the content package using the corresponding query dimension and sorting rule.
[0088] In an exemplary embodiment, the process of generating a content package based on a content query condition is as follows: Figure 7 As shown, Figure 7It is a schematic diagram of a method for determining content query conditions according to an exemplary embodiment. The search background provides a rich data query dimension. For digital (count) type attributes, such as the number of words, the number of pictures, the number of likes, etc., interval query capabilities are provided; for array type attributes, such as associated destinations (identified by ID), POI (identified by ID), and tags (identified by tag names), batch matching capabilities are provided, and single, partial matching, and complete matching can be selected; for string (text) type attributes, such as text and title, phrase matching capabilities are provided, and full-text retrieval is performed using the word segmenter and inverted index of the Elasticsearch search engine (ElasticsearchEngine, es). In order to meet more flexible query requirements during operation and use, the search background also provides a logical combination of search conditions. When multiple query dimensions are set, the query conditions are in an "and" relationship and form a condition group. Multiple condition groups can be added, and the condition groups are in an "or" relationship. At the same time, a "blacklist" condition group, also known as an exclusion condition group, can be created to exclude some content from the query results. The condition group and other condition groups are in a "non" relationship. After editing the query conditions and obtaining a set of content, you can directly export the content list for subsequent operations, or save the query conditions to generate a content package. After generating a content package, you can perform secondary operations on the content in the package, such as pinning a certain content, editing the title and cover image displayed when a certain content is distributed, etc. All operations are only effective in the content package and do not affect the properties of the content itself or the display and sorting of the content in other distribution scenarios. Figure 7 In the query conditions, the query conditions mainly include the filtering condition group and the exclusion condition group, and the relationship between the two is "not". Among them, the filtering condition group includes condition group 1 and condition group 2, and the relationship between condition group 1 and condition group 2 is "or". Condition group 1 includes filtering dimension 1 and filtering dimension 2, and the relationship between the two is "and". Condition group 2 includes filtering dimension 3 and filtering dimension 4, and the relationship between the two is "and". The exclusion condition group includes condition group 3 and condition group 4, and the relationship between condition group 3 and condition group 4 is "or". Condition group 3 includes filtering dimension 5 and filtering dimension 6, and the relationship between the two is "and". Condition group 4 includes filtering dimension 7 and filtering dimension 8, and the relationship between the two is "and".
[0089] In an exemplary embodiment, the execution process of the service content storage method provided by the embodiment of the present disclosure is as follows: Figure 8 As shown, Figure 8 FIG. 1 is a sequence diagram showing the execution process of a business content storage method according to an exemplary embodiment. Figure 8In the process of content publishing, the data is edited and submitted by the user author and saved to the corresponding business line. At the same time, each business line notifies the normalized storage through the message queue. The normalized storage consumes the messages in the message queue through the resident process, obtains the business type and business identifier (id) from the message body, calls the business details interface to obtain the content data, and stores it.
[0090] In an exemplary embodiment, the process of generating and using the query identifier is as follows: Fig. 9 As shown, Fig. 9 This is a schematic diagram of a method for generating and using a query identifier according to an exemplary embodiment. After the content package interface receives the code, it first obtains the corresponding content package id, call dimension and sorting rule through the code, and then obtains the query condition through the content package id, assembles and parses the query condition, call dimension and sorting rule together into a completed query statement, requests normalization and storage to obtain a content list, and then adjusts the content sorting, renders content beautification and other related data according to the operation results of the content package.
[0091] In an embodiment of the present disclosure, by determining content query conditions, business content that is consistent with the attribute fields under the dimension corresponding to the content query conditions is queried and distributed from the stored business content, including business content stored in a unified storage format according to attribute fields, thereby achieving search and distribution of the stored business content.
[0092] Based on the same concept, the embodiment of the present disclosure also provides a service distribution device.
[0093] It is understandable that the service distribution device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0094] Fig.10 FIG. 1 is a block diagram of a service distribution device 100 according to an exemplary embodiment. Fig.10 , the device includes a determining unit 101 and a processing unit 102.
[0095] The determining unit 101 is used to determine a content query condition, where the content query condition is determined based on a query dimension, where the query dimension includes a plurality of attribute fields, wherein the attribute field is consistent with the attribute field included in the business content storage format.
[0096] The processing unit 102 is used to search for business content that is consistent with the attribute field under the dimension corresponding to the content query condition in the stored business content, wherein the stored business content includes business content stored in a unified storage format according to the attribute field, and distribute the searched business content.
[0097] In one implementation, the determination unit 101 determines the content query condition in the following manner, including: obtaining a content package, parsing the content package, and obtaining a content package query condition, wherein the content package includes business content that has been queried based on an attribute field under a dimension corresponding to the content package query condition, and the content package query condition is a content query condition corresponding to the business content included in the query content package; obtaining a query dimension and / or a sorting rule, and concatenating the content package query condition, the query dimension and / or the sorting rule to obtain the content query condition.
[0098] In one implementation, the processing unit 102 distributes the queried business content in the following manner: sorting the queried business content on the corresponding query dimension according to the query dimension and the sorting rule; and distributing the sorted business content.
[0099] In one implementation, the determination unit 101 obtains the content query condition in the following manner: determining a query identifier, the query identifier being used to uniquely identify a combination of a content package query condition, a query dimension, and a sorting rule; based on the query identifier, obtaining the content query condition matching the query identifier.
[0100] In one embodiment, the stored business content is stored in the following manner: determining one or more attribute types corresponding to the business content, and determining the attribute fields included in the one or more attribute types; in response to the corresponding attribute types and attribute fields being stored in the stored business content, filling in the corresponding field content at the corresponding attribute field according to the attribute field and attribute type, so as to store the business content according to the attribute field.
[0101] In one embodiment, the device also includes: in response to the corresponding attribute type and / or attribute field not being stored in the stored business content, adding attribute type and / or attribute field, and filling field content in the added attribute type and / or attribute field to store the business content according to the attribute field.
[0102] Fig.11It is a block diagram of an electronic device 200 shown according to an exemplary embodiment. The electronic device 200 includes a memory 201, a processor 202, and an input / output (I / O) interface 203. The memory 201 is used to store instructions. The processor 202 is used to call the instructions stored in the memory 201 to execute the service distribution method of the embodiment of the present invention. The processor 202 is connected to the memory 201 and the I / O interface 203 respectively, for example, through a bus system and / or other forms of connection mechanisms (not shown). The memory 201 can be used to store programs and data, including the programs of the method involved in the embodiment of the present invention. The processor 202 executes various functional applications and data processing of the electronic device 200 by running the programs stored in the memory 201.
[0103] In the embodiment of the present invention, the processor 202 can be implemented in at least one hardware form of a digital signal processor (Digital Signal Processing, DSP), a field programmable gate array (Field-Programmable Gate Array, FPGA), and a programmable logic array (Programmable Logic Array, PLA). The processor 202 can be a central processing unit (Central Processing Unit, CPU) or one or a combination of other forms of processing units with data processing capabilities and / or instruction execution capabilities.
[0104] The memory 201 in the embodiment of the present invention may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), flash memory, hard disk drive (HDD) or solid-state drive (SSD).
[0105] In the embodiment of the present invention, the I / O interface 203 may be used to receive input instructions (such as digital or character information, and key signal input related to user settings and function control of the electronic device 200), and may also output various information to the outside (such as images or sounds). In the embodiment of the present invention, the I / O interface 203 may include one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel.
[0106] It is to be understood that, although the operations are described in a specific order in the drawings in the embodiments of the present invention, it should not be understood as requiring to perform these operations in the specific order shown or in a serial order, or requiring to perform all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0107] The methods and devices involved in the embodiments of the present invention can be implemented using standard programming techniques, using rule-based logic or other logic to implement various method steps. It should also be noted that the words "device" and "module" used herein and in the claims are intended to include implementations using one or more lines of software code and / or hardware implementations and / or devices for receiving input.
[0108] Any steps, operations or procedures described herein may be performed or implemented using one or more hardware or software modules, either alone or in combination with other devices. In one embodiment, the software module is implemented using a computer program product including a computer-readable medium containing computer program code, which can be executed by a computer processor to perform any or all of the described steps, operations or procedures.
[0109] The foregoing description of the implementation of the present invention has been given for purposes of illustration and description. The foregoing description is not intended to be exhaustive nor to limit the invention to the exact form disclosed, and various variations and modifications are possible in accordance with the above teachings or may be obtained from the practice of the invention. These embodiments are selected and described in order to illustrate the principles of the invention and its practical application, so that those skilled in the art can utilize the invention in various embodiments and with various modifications suitable for the particular use contemplated.
Claims
1. A service distribution method, characterized in that: include: Determining a content query condition, wherein the content query condition is determined based on a query dimension, wherein the query dimension includes a plurality of attribute fields, wherein the attribute fields are consistent with the attribute fields included in the business content storage format; Searching for business content that is consistent with the attribute field under the dimension corresponding to the content query condition in the stored business content, wherein the stored business content includes business content stored in a unified storage format according to the attribute field; Distribute the queried business content.
2. The method according to claim 1, characterized in that The determining of the content query condition includes: Obtaining a content package and parsing the content package to obtain a content package query condition, wherein the content package includes business content that has been queried based on an attribute field under a dimension corresponding to the content package query condition, and the content package query condition is a content query condition corresponding to the business content included in the query content package; Acquire query dimensions and / or sorting rules, and concatenate the content package query condition, the query dimensions and / or the sorting rules to obtain a content query condition.
3. The method according to claim 2, characterized in that The business content obtained through the distribution query includes: According to the query dimension and the sorting rule, sort the queried business content on the corresponding query dimension; Distribute sorted business content.
4. The method according to claim 2 or 3, characterized in that: The obtaining of the content query condition includes: Determine a query identifier, where the query identifier is used to uniquely identify a combination of a content package query condition, a query dimension, and a sorting rule; Based on the query identifier, a content query condition matching the query identifier is obtained.
5. The method according to claim 1, characterized in that The stored business content is stored in the following manner: Determine one or more attribute types corresponding to the business content, and determine the attribute fields included in the one or more attribute types; In response to the corresponding attribute type and attribute field being stored in the stored business content, the corresponding attribute field is filled with corresponding field content according to the attribute field and the attribute type, so as to store the business content according to the attribute field.
6. The method according to claim 5, characterized in that The method further comprises: In response to the fact that the corresponding attribute type and / or attribute field is not stored in the stored business content, an attribute type and / or attribute field is added, and field content is filled in the added attribute type and / or attribute field to store the business content according to the attribute field.
7. A service distribution device, characterized in that: include: A determination unit, configured to determine a content query condition, wherein the content query condition is determined based on a query dimension, wherein the query dimension includes a plurality of attribute fields, wherein the attribute fields are consistent with the attribute fields included in the business content storage format; The processing unit is used to search for business content that is consistent with the attribute field under the dimension corresponding to the content query condition in the stored business content, wherein the stored business content includes business content stored in a unified storage format according to the attribute field, and distribute the queried business content.
8. The device according to claim 7, characterized in that The determining unit determines the content query condition in the following manner, including: Obtaining a content package and parsing the content package to obtain a content package query condition, wherein the content package includes business content that has been queried based on an attribute field under a dimension corresponding to the content package query condition, and the content package query condition is a content query condition corresponding to the business content included in the query content package; Acquire query dimensions and / or sorting rules, and concatenate the content package query condition, the query dimensions and / or the sorting rules to obtain a content query condition.
9. The device according to claim 8, characterized in that The processing unit distributes the queried business content in the following manner: According to the query dimension and the sorting rule, sort the queried business content on the corresponding query dimension; Distribute sorted business content.
10. The device according to claim 8 or 9, characterized in that The determining unit obtains the content query condition in the following manner: Determine a query identifier, where the query identifier is used to uniquely identify a combination of a content package query condition, a query dimension, and a sorting rule; Based on the query identifier, a content query condition matching the query identifier is obtained.
11. The device according to claim 7, characterized in that The stored business content is stored in the following manner: Determine one or more attribute types corresponding to the business content, and determine the attribute fields included in the one or more attribute types; In response to the corresponding attribute type and attribute field being stored in the stored business content, the corresponding attribute field is filled with corresponding field content according to the attribute field and the attribute type, so as to store the business content according to the attribute field.
12. The device according to claim 11, characterized in that The device also includes: In response to the fact that the corresponding attribute type and / or attribute field is not stored in the stored business content, an attribute type and / or attribute field is added, and field content is filled in the added attribute type and / or attribute field to store the business content according to the attribute field.
13. An electronic device, characterized in that: The electronic device comprises: a memory for storing instructions; and A processor, configured to call the instructions stored in the memory to execute the service distribution method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed by the processor, the service distribution method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Method and device for writing data in database, method and device for querying data in database and database management system
CN107451142A
Content distribution method and device, computer equipment and storage medium
CN115422465A
Information query method and device, equipment and storage medium
CN117951181A
System and method for distributing queries to a group of databases and expediting data access
US20080104089A1
