Method and apparatus for filtering content, and electronic device and medium
By combining Bloom filter and mapping filter, efficient filtering and tenant-level configuration of non-compliant content in the mobile Internet is achieved, and the problem that traditional technology cannot achieve tenant-level blacklist and whitelist export is solved, and content distribution is improved security and user experience.
Patent Information
- Application Number
- PCT/CN2024/096452
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-19
- Filing Date
- 2024-05-30
- Publication Date
- 2024-12-26
AI Technical Summary
The existing technology is difficult to effectively filter a large amount of non-compliant content in the mobile Internet, such as malicious advertising, violent content and false information. Especially in the content distribution scenarios for tenants, traditional Bloom filters cannot achieve tenant-level blacklists and Whitelist export affects the compliance and security of content and user experience.
Combining the Bloom filter and the mapping filter, a Bloom filter for global filtering and a mapping filter for personalized filter is generated. By hashing the mapping relationship between the bit array and the tenant identity and the content identity, the target content can be achieved. Efficient filtering and tenant-level configuration can query the blacklist and whitelist of the target tenant and export the corresponding filter status.
It realizes fast and efficient filtering of large-scale content, flexible tenant-level configuration and presentation, meets copyright requirements, simplifies content compliance operations, and improves the security and user experience of content distribution.
Smart Images

Figure CN2024096452_26122024_PF_FP_ABST
Abstract
Description
Method, device, electronic device, and medium for filtering content
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 19, 2023, with application number 202310729819.0 and invention name “Methods, devices, electronic devices and media for filtering content”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present disclosure relates generally to the field of computers, and more particularly, to methods, apparatuses, electronic devices, and media for filtering content. Background Art
[0004] With the rapid growth of content on the mobile internet, a large amount of non-compliant content has emerged, such as malicious advertisements, violent content, and false information. Therefore, effective filtering of non-compliant content is necessary during content distribution. Content filtering is becoming increasingly important in content distribution services, as the release of non-compliant content harms the interests of content distribution platforms and impacts the user experience.
[0005] Furthermore, in tenant-oriented content scenarios, content distribution across multiple tenants is crucial. Secure content distribution is crucial, and compliance and security requirements apply to both tenants and the overall content layer, requiring tenant-level configuration. Furthermore, since different tenants have different permissions, tenant-level configuration is also required.
[0006] Summary of the Invention
[0007] Embodiments of the present disclosure provide a method, apparatus, electronic device, and computer-readable storage medium for filtering content.
[0008] According to a first aspect of the present disclosure, a method for filtering content is provided. The method includes generating a Bloom filter for global filtering of content, the Bloom filter including a bit array for querying a filtering state based on a set of hashes. The method also includes generating a mapping filter for personalized filtering of content, the mapping filter including a mapping relationship between a tenant identifier and a content identifier, the mapping filter being capable of querying at least one item in a blacklist and a whitelist for a target tenant. In addition, the method also includes determining the filtering state of the target content for the target tenant based on the Bloom filter and the mapping filter.
[0009] In a second aspect of the present disclosure, a device for filtering content is provided. The device includes a Bloom filter generation module, which is configured to generate a Bloom filter for global filtering of content, and the Bloom filter includes a bit array for querying the filtering state according to a set of hashes. The device also includes a mapping filter generation module, which is configured to generate a mapping filter for personalized filtering of content, and the mapping filter includes a mapping relationship between a tenant identifier and a content identifier, and the mapping filter can query at least one item in a blacklist and a whitelist for a target tenant. In addition, the device also includes a filtering state determination module, which is configured to determine the filtering state of the target content for the target tenant based on the Bloom filter and the mapping filter.
[0010] According to a third aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory coupled to the processor, wherein the memory has instructions stored therein, and when the instructions are executed by the processor, the electronic device executes the method according to the first aspect.
[0011] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein one or more computer instructions are stored on the computer-readable storage medium, wherein the one or more computer instructions are executed by a processor to implement the method according to the first aspect.
[0012] This summary is intended to introduce a selection of concepts in a simplified form that are further described below in the detailed description. It is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0014] FIG1 illustrates a schematic diagram of an example environment in which various embodiments of the present disclosure may be implemented;
[0015] FIG2 shows a flowchart of a method for filtering content according to certain embodiments of the present disclosure;
[0016] FIG3 illustrates a schematic diagram of a process for determining a global filtering state using a Bloom filter according to certain embodiments of the present disclosure;
[0017] FIG4 shows a schematic diagram of a mapping filter according to certain embodiments of the present disclosure;
[0018] FIG5 shows a schematic diagram of a content filtering architecture according to certain embodiments of the present disclosure;
[0019] FIG6 is a schematic diagram of a filter cache loading process according to certain embodiments of the present disclosure;
[0020] FIG7 shows a block diagram of an apparatus for filtering content according to some embodiments of the present disclosure.
[0021] FIG8 illustrates a block diagram of an electronic device according to certain embodiments of the present disclosure.
[0022] Throughout the drawings, the same or similar reference numbers denote the same or similar elements. DETAILED DESCRIPTION
[0023] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0024] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0025] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or the same objects, unless explicitly stated otherwise. Other explicit and implicit definitions may also be included below.
[0026] Nowadays, various content platforms play a vital role in daily life, distributing vast amounts of content to users through them. However, due to the sheer volume of information, the amount of non-compliant content is also substantial. For information security reasons, filtering non-compliant content is necessary. Traditional Bloom filters can achieve large-scale filtering, but because they store bit arrays, they cannot export filter lists. In some tenant-oriented scenarios, providing tenants with a list is necessary, and Bloom filters alone cannot achieve this.
[0027] The embodiments of the present disclosure integrate a mapping filter based on a Bloom filter. When the two are deployed simultaneously to achieve rapid filtering of large-scale content, they can also export corresponding blacklists and / or whitelists for target tenants, such as a whitelist of content and / or authors that tenants cannot present, and a whitelist of content and / or authors that tenants can present. Not only does it achieve efficient filtering of large-scale content, but it also achieves flexible tenant-level configuration and presentation. In some embodiments, the use of Bloom filters and mapping filters can achieve flexible tenant-level configuration to resolve copyright issues, and can meet the requirements of some specific tenants being able to release or some specific tenants not being able to release. At the same time, a control platform is provided to facilitate operations and quickly implement compliance operation configuration, as well as related query functions.
[0028] FIG1 illustrates a schematic diagram of an example environment 100 in which various embodiments of the present disclosure may be implemented. As shown in FIG1 , example environment 100 may include a computing device 110, which may be a user terminal, mobile device, computer, or the like. It may also be a computing system, a single server, a distributed server, or a cloud-based server. Computing device 110 may receive content 150-1, content 150-2, content 150-3, content 150-4, content 150-5, content 150-6, ..., content 150-N (individually or collectively referred to as content 150), where N is the number of stored content. In a content distribution platform, the number of received content, N, can reach hundreds of millions. Content 150 may include, but is not limited to, articles, videos, or images, as well as any combination thereof. Content 150 may be distributed to various tenants, who may then redistribute the acquired content to their own users. Each tenant has a primary user and multiple sub-users, and each cluster belongs to different tenants. Clusters and data between tenants are completely isolated. For security and compliance purposes, security filtering is required when content is distributed to tenants.
[0029] Computing device 110 may also include a content filtering system 120. For example, content filtering system 120 may be deployed in computing device 110. Content filtering system 120 may be used to determine filtering states of content 150, namely, filtering state 160-1, filtering state 160-2, filtering state 160-2, filtering state 160-3, filtering state 160-4, filtering state 160-5, filtering state 160-6, ..., filtering state 160-N (individually or collectively referred to as filtering states 160), where content 150-1 corresponds to filtering state 160-1, content 150-2 corresponds to filtering state 160-2, ..., content 150-N corresponds to filtering state 160-N.
[0030] Based on the filtering status 160 of content 150, it can be determined whether content 150 is to be filtered, and whether content 150 is to be distributed to tenants 170-1, 170-2, 170-3, ..., 170-M (individually or collectively referred to as tenants 170), where M is the number of tenants. For example, based on the filtering status 160-1 of content 150-1, it is determined that content 150-1 can be distributed to tenant 170-1. When multiple contents are distributed to tenants based on the filtering status, the tenants can distribute these contents on their own platforms. For example, individual users can view these contents when browsing using the tenants' clients. It is understood that different contents 150 can have different filtering statuses 160 for different tenants 170. For example, content 150-2 can be distributed to tenants 170-2 and 170-3, but cannot be distributed to other tenants. In other words, only tenants 170-2 and 170-3 own the copyright to content 150-2. In addition, based on the filtering status 160 - 3 of the content 150 - 3 , it is determined that the content 150 - 3 needs to be filtered and cannot be distributed to any tenant, etc. Thus, common copyright requirements in tenant-oriented scenarios such as only specific customers can release or only specific customers cannot release are implemented.
[0031] Referring to Figure 1 , content filtering system 120 includes a Bloom filter 130. Using Bloom filter 130, large-scale content 150 can be filtered quickly and efficiently globally. For example, Bloom filter 130 can be constructed by periodically scanning data in a database. When filtering content 150, the Bloom filter 130 can be checked to determine whether content 150 is present in Bloom filter 130. A Bloom filter is a space-efficient probabilistic data structure used to determine whether an element is likely to exist in a set, enabling efficient filtering. A Bloom filter consists of a bit array. When using a Bloom filter to determine an element, multiple hash functions are first used to obtain multiple hash values for the element. The bit array is then indexed using these multiple hash values to determine whether the bit value at the corresponding position in the bit array is 0 or 1. Therefore, using a Bloom filter allows for very fast filtering of large-scale content. However, the false positive problem of Bloom filters becomes more severe as the data size increases. A "false positive" refers to the fact that a Bloom filter can only determine that data is definitely not present in the Bloom filter, but cannot guarantee that the data is actually present.
[0032] 1 , the content filtering system 120 also includes a mapping filter 140. Based on global filtering, the mapping filter 140 can further determine the filtering status 160 of content 150 for tenant 170. For example, the mapping filter can be used to query a content blacklist for tenant 170. If content 150 is on the blacklist, filtering of the content 150 for tenant 170 is required. Alternatively, the mapping filter can be used to query a content whitelist for tenant 170. If content 150 is on the whitelist, filtering of the content 150 for tenant 170 is not required.
[0033] It should be understood that the architecture and functions in the example environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure. The embodiments of the present disclosure may also be applied to other environments with different structures and / or functions.
[0034] The following describes in detail the process according to an embodiment of the present disclosure in conjunction with Figures 2 to 8. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It is understood that the embodiments described below may also include additional actions not shown and / or may omit the actions shown, and the scope of the present disclosure is not limited in this respect.
[0035] FIG2 shows a flow chart of a method 200 for filtering content according to certain embodiments of the present disclosure. In block 202, a Bloom filter is generated for global filtering of content, the Bloom filter including a bit array that queries a filter state based on a set of hashes. For example, the filtering state of the content is determined by querying whether the content exists in the Bloom filter. In some embodiments, the Bloom filter includes a bit array that queries a filter state based on a set of hashes, and the filtering state of the content is determined by the bit array. In the scenario of large-scale content filtering, content filtering can be efficiently implemented using a Bloom filter. An example implementation of a Bloom filter is described below in conjunction with FIG3 .
[0036] In box 204, a mapping filter is generated for personalized filtering of content. The mapping filter includes a mapping relationship between a tenant identifier and a content identifier. The mapping filter can query at least one of a blacklist and a whitelist for a target tenant. In some embodiments, personalized filtering of content can be performed through a mapping filter to implement tenant-level configuration. For example, by querying a blacklist or a whitelist for a target tenant, it is determined whether the content is to be presented to the tenant. By combining blacklists and whitelists in a hierarchical manner, common copyright requirements in tenant-oriented scenarios such as only specific customers can release content or only specific customers cannot release content can be implemented. An example implementation of a mapping filter is described below in conjunction with FIG4 .
[0037] At block 206, the target content's filtering status for the target tenant is determined based on the Bloom filter and the mapping filter. For example, the target content's filtering status for the target tenant may be determined by performing global filtering using the Bloom filter and personalized filtering using the mapping filter. It should be understood that different target content may have different filtering statuses for different target tenants.
[0038] Therefore, according to method 200 of an embodiment of the present disclosure, a mapping filter is integrated on the basis of a Bloom filter. When both are deployed simultaneously to realize rapid filtering of large-scale content, corresponding blacklists and / or whitelists can also be exported for target tenants, thereby realizing not only efficient filtering of large-scale content but also flexible tenant-level configuration and presentation.
[0039] FIG3 shows a schematic diagram of a process 300 for determining a global filtering state using a Bloom filter according to certain embodiments of the present disclosure. As shown in FIG3 , a content identifier 302 and a tenant identifier 304 are first obtained, and then the content identifier 302 and the tenant identifier 304 are combined to obtain a combined identifier 306. For example, in some embodiments, the content identifier 302 and the tenant identifier 304 are in the form of strings, and thus the content identifier 302 and the tenant identifier 304 can be combined by concatenating the strings. It should be understood that there are other forms of combinations of the content identifier 302 and the tenant identifier 304, and the present disclosure does not limit this.
[0040] Next, the combined identifier 306 is processed using hash functions 308-1, 308-2, and 308-3 to obtain hash values 310-1, 310-2, and 310-3, respectively. Hash functions 308-1, 308-2, and 308-3 are different hash functions, and therefore the obtained hash values 310-1, 310-2, and 310-3 are also different. It should be understood that the use of three hash functions here is merely for illustrative purposes. In other embodiments, more or fewer hash functions may be used, depending on the actual usage scenario.
[0041] Then, by using hash value 310-1, hash value 310-2, and hash value 310-3 as index subscripts, the bit values at the corresponding index subscripts of Bloom filter bit array 312 are queried to determine the global filtering state 314. For example, in some embodiments, when the bit value at the corresponding index subscript of Bloom filter bit array 312 is 0, it can be determined that the combination of content identifier 302 and tenant identifier 304 is not in the Bloom filter bit array 312 and therefore does not need to be filtered. It should be understood that Bloom filters are constructed for specific businesses, and different businesses may have different Bloom filters.
[0042] Therefore, according to the process 300 of the embodiment of the present disclosure, a Bloom filter can be used to quickly and efficiently perform global filtering on large-scale content. Since a bit array is used for judgment, global filtering saves memory and responds quickly.
[0043] Figure 4 illustrates a schematic diagram of a mapping filter 400 according to certain embodiments of the present disclosure. As shown in Figure 4 , mapping filter 400 includes tenants 410, 420, 430, and 440. It should be understood that the number of tenants depends on the actual number of tenants on the content platform. Four tenants are shown here as an example to illustrate the implementation of the mapping filter. When a content collection 412 associated with tenant 410 is needed, a query can be performed from mapping filter 400 using the identifier of tenant 410 to obtain content collection 412. It should be understood that content collection 412 includes a blacklist 414 and a whitelist 416 for tenant 410. This means that any content listed in blacklist 414 cannot be distributed to tenant 410, while any content listed in whitelist 416 can be distributed to tenant 410. Furthermore, blacklist 414 and whitelist 416 can be multi-dimensional and not limited to the identifier of the content itself. They can also include content author identifiers, keyword identifiers, and more. For example, if blacklist 414 includes the identifier of a specific author, then all content associated with that author cannot be distributed to tenant 410. Similarly, when it is necessary to obtain content set 422 related to tenant 420, the identifier of tenant 420 can be used to query from mapping filter 400 to obtain content set 422, thereby obtaining blacklist 424 and whitelist 426; when it is necessary to obtain content set 432 related to tenant 430, the identifier of tenant 430 can be used to query from mapping filter 400 to obtain content set 432, thereby obtaining blacklist 434 and whitelist 436; when it is necessary to obtain content set 442 related to tenant 440, the identifier of tenant 440 can be used to query from mapping filter 400 to obtain content set 442, thereby obtaining blacklist 444 and whitelist 446, and so on.
[0044] In addition, the whitelist and blacklist for tenants can not only be used to filter content, but also for downstream businesses. For example, if the downstream business needs to obtain the blacklist 414 and whitelist 416 for tenant 410, it can be queried in the mapping filter 400 through the tenant identifier of tenant 410, which is very flexible. The Bloom filter cannot realize the function of list export, but using the mapping filter 400, personalized blacklists and whitelists can be configured for each tenant at the tenant level, and blacklists and whitelists can also be flexibly exported for use by downstream businesses. For example, the business of the downstream recommendation engine relies on the mapping filter 400 to obtain the blacklist and whitelist for each tenant, and on this basis, better personalized recommendation services are provided. It should be understood that the tenant's blacklist and whitelist discussed here are not the tenant's privacy information, but are configured for the tenant by the content distribution platform.
[0045] Figure 5 illustrates a schematic diagram of a content filtering architecture 500 according to certain embodiments of the present disclosure. As shown in Figure 5 , architecture 500 may include an application layer 510, which primarily handles the use and configuration of content filtering services. Application layer 510 may include a control module 520, which manages rules and lists. Control module 520 includes a rule management module 522, which allows for the addition, deletion, and modification of rules. Furthermore, control module 520 includes a list management module 522, which allows for the configuration of tenant blacklists and whitelists, such as adding or removing content from a blacklist. Control module 520 also includes a history log 526, which allows for the review of rule and list configuration records, such as when a new rule was launched or when content was added to a tenant's blacklist. This facilitates timely identification of any issues that arise. Control module 520 provides capabilities such as content removal, author list configuration, archiving of removal operations, and querying removed content. At the query level, data redundancy is transferred to table reading and search analysis engines (for example, Elasticsearch) to improve operational query efficiency and meet demand without affecting the core online filtering business.
[0046] The application layer 510 also includes downstream services 530, which can use the services provided by the content filtering service interface 540. Examples of downstream services 530 include basic services 532, algorithms 534, and platforms 536. These services require the content filtering service interface 540 to determine whether specific content is filtered, whether specific content can be distributed to a specific tenant, and the blacklist and whitelist of a specific tenant. In some embodiments, the content filtering service interface 540 is based on the Thrift development interface output capability, which solves cross-language issues between downstream services and the server, facilitating rapid deployment and invocation of services.
[0047] In the architecture 500, a storage layer 550 is also included. The storage layer is mainly used to build a Bloom filter 582 and a mapping filter 584 in memory. Referring to Figure 5, the storage layer may include a database 560, which stores relevant data used to build filters. It should be understood that when only filter descriptions are used, Bloom filters 582 and mapping filters 584 are included. The database 560 may include rules 564. The rules 564 may be configured through the rule management 522 described above, or may be configured in other ways. The rules 562 may include a business type 564, a tenant identifier 566, and a content set 568. For example, the business type 564 specifies the business for which the filter is constructed. In some embodiments, different filters are constructed for different businesses. The tenant identifier 566 includes all tenants to be configured in the filter, and the content set 568 includes all content to be configured in the filter. Bloom filter 582 and mapping filter 584 are loaded into server memory 580 via filter cache service 570. Content filtering service interface 540 can use Bloom filter 582 and mapping filter 584 in server memory 580 to provide content filtering services and blacklist / whitelist query services to various downstream services. In some embodiments, when a downstream service provides a tenant ID and a content ID, Bloom filter 582 and mapping filter 584 can be used to determine whether the content is releasable for the tenant. For example, the tenant ID and content ID can be combined to query Bloom filter 582, or the tenant ID and content ID can be used as keys to query mapping filter 584 to determine whether the content is releasable for the tenant.
[0048] Through the content filtering architecture 500, a mapping filter 584 is integrated on the basis of the Bloom filter 582. When both are deployed simultaneously to achieve rapid filtering of large-scale content, corresponding blacklists and / or whitelists can also be exported for target tenants. By combining blacklists and whitelists in layers, common copyright filtering requirements in tenant-oriented scenarios such as only specific customers can be released or only specific customers cannot be released are achieved. As a result, multi-dimensional shielding, tenant-level shielding and other functions are provided in the content compliance filtering scenario, and the services provided can take effect quickly, support a large amount of shielding, and the operation is simple and fast. In addition, the recommendation engine and the server provide unified compliance filtering capabilities to ensure the safety of content release.
[0049] Figure 6 is a schematic diagram of the filter cache loading process 600 according to certain embodiments of the present disclosure. As shown in Figure 6, the filter construction task module 602 will regularly execute the filter construction task with a period 620. For example, the period 620 can be 3 minutes, 5 minutes or other time intervals. After starting to execute the filter construction task, the filter construction task module 602 will scan the database 604, read the rule data, tenant data, content data, etc. used to construct the filter from the database 604, to generate a Bloom filter and a mapping filter, and upload them to the object storage service module 606. The object storage service provides complete object lifecycle management, supports mirroring back to the source, event notification, upload callback and other functions, and provides a variety of quick data management methods. In addition, the object storage service provides version control and security level settings to effectively avoid accidental deletion of data, and provides an effective off-site disaster recovery mechanism through cross-regional replication. Therefore, by using the object storage service module 606, filters can be efficiently stored and managed.
[0050] The filter loading task module 608 periodically executes the filter loading task at a period 630. For example, the period 630 can be 30 seconds, 1 minute, or other time intervals, but the period 630 is typically shorter than the period 620. After starting the filter loading task, the filter loading task module 608 loads the Bloom filter 612 and the mapping filter 614 from the object storage service module 606 into the server's memory 610. In some embodiments, when querying the Bloom filter, the tenant ID and the content ID can be combined to check whether the combination is in the Bloom filter 612. When querying the mapping filter 612, the tenant ID and the content ID can be used as keys to determine the filtering status of the tenant ID and the content ID.
[0051] Figure 7 shows a block diagram of an apparatus 700 for filtering content according to some embodiments of the present disclosure. As shown in Figure 7, the apparatus 700 includes a Bloom filter generation module 702, which is configured to generate a Bloom filter for global filtering of content, and the Bloom filter includes a bit array for querying a filtering state according to a set of hashes. The apparatus 700 also includes a mapping filter generation module 704, which is configured to generate a mapping filter for personalized filtering of content, and the mapping filter includes a mapping relationship between a tenant identifier and a content identifier, and the mapping filter is capable of querying at least one item in a blacklist and a whitelist for a target tenant. In addition, the apparatus 700 also includes a filtering state determination module 706, which is configured to determine the filtering state of the target content for the target tenant based on the Bloom filter and the mapping filter.
[0052] FIG8 shows a block diagram of an electronic device 800 according to certain embodiments of the present disclosure. FIG8 shows a block diagram of an electronic device 800 according to certain embodiments of the present disclosure, and the device 800 may be a device or apparatus described in an embodiment of the present disclosure. As shown in FIG8 , the device 800 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or computer program instructions loaded from a storage unit 808 into a random access memory (RAM) 803. In RAM 803, various programs and data required for the operation of the device 800 can also be stored. CPU / GPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804. Although not shown in FIG8 , the device 800 may also include a coprocessor.
[0053] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard and mouse; an output unit 807, such as various types of displays and speakers; a storage unit 808, such as a magnetic disk and optical disk; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0054] The various methods or processes described above may be performed by the CPU / GPU 801. For example, in some embodiments, the methods may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU / GPU 801, one or more steps or actions in the methods or processes described above may be performed.
[0055] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0056] Computer-readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device.Computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination thereof.More specific examples (non-exhaustive list) of computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove having instructions stored thereon, and any suitable combination thereof.Computer-readable storage medium used herein is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (for example, light pulses by fiber optic cables), or electrical signals transmitted by wires.
[0057] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0058] The computer program instructions for performing the disclosed operation can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data or source code or the object code written in any combination of one or more programming languages, programming languages include object-oriented programming languages, and conventional procedural programming languages.Computer-readable program instructions can be performed completely on a user's computer, partially on a user's computer, performed as an independent software package, partly on a user's computer and partly on a remote computer, or performed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network-including local area network (LAN) or wide area network (WAN), or can be connected to an external computer (such as utilizing an internet service provider to connect by the internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to carry out personalized customization electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLA), this electronic circuit can perform computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0059] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0060] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0061] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a special hardware-based system that performs the prescribed function or action, or can be implemented by a combination of special hardware and computer instructions.
[0062] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or technical improvements to existing technologies, or to enable other persons skilled in the art to understand the embodiments disclosed herein.
[0063] Some example implementations of the present disclosure are listed below.
[0064] Example 1. A method for filtering content, comprising:
[0065] generating a Bloom filter for globally filtering the content, the Bloom filter comprising a bit array that filters a state according to a set of hash queries;
[0066] generating a mapping filter for performing personalized filtering on the content, the mapping filter including a mapping relationship between a tenant identifier and a content identifier, the mapping filter being capable of querying at least one of a blacklist and a whitelist for a target tenant; and
[0067] Based on the Bloom filter and the mapping filter, a filtering status of target content for the target tenant is determined.
[0068] Example 2. The method of example 1, wherein generating the bloom filter for globally filtering content comprises:
[0069] constructing the bit array of the Bloom filter in a first cycle based on data in a database, wherein the bit array is constructed based on a set of hash values generated by a set of hash functions, and positions in the bit array corresponding to the set of hash values are set to 1; and
[0070] The constructed Bloom filter is uploaded to the object storage service.
[0071] Example 3. The method of Examples 1-2, further comprising:
[0072] The constructed Bloom filter is loaded into a memory of a server in a second cycle, wherein the second cycle is smaller than the first cycle.
[0073] Example 4. The method of Examples 1-3, wherein generating the mapping filter for personalized filtering of content comprises:
[0074] constructing the mapping filter in the first cycle based on the data in the database; and
[0075] Uploading the constructed mapping filter to the object storage service; and
[0076] The constructed mapping filter is loaded into the memory of the server in the second cycle.
[0077] Example 5. The method according to examples 1-4, wherein the building or the loading is performed separately for each business type.
[0078] Example 6. The method of Examples 1-5, wherein determining the filtering status of the target content for the target tenant based on the Bloom filter and the mapping filter comprises:
[0079] Determining a global filtering state by querying the target tenant and the target content using the Bloom filter; and
[0080] Based on the global filtering state, the filtering state of the target content for the target tenant is determined by querying the target tenant using the mapping filter.
[0081] Example 7. The method of Examples 1-6, wherein determining the global filtering state by querying the target tenant and the target content using the Bloom filter comprises:
[0082] Determining multiple hash values for the target tenant and the target content based on the tenant identifier and the content identifier;
[0083] Based on the multiple hash values, obtaining multiple bit values in the bit array of the Bloom filter corresponding to the multiple hash values; and
[0084] Based on the plurality of bit values, the global filter state is determined.
[0085] Example 8. The method of Examples 1-7, wherein determining the filtering status of the target content for the target tenant by querying the target tenant using the mapping filter based on the global filtering status comprises:
[0086] Based on the target tenant, obtaining at least one of the blacklist and the whitelist for the target tenant; and
[0087] The filtering status of the target content for the target tenant is determined based on the global filtering status, at least one of the blacklist and the whitelist, and a filtering priority.
[0088] Example 9. The method of Examples 1-8, wherein the filtering priority is used to determine a priority relationship between the blacklist and the whitelist.
[0089] Example 10. The method of Examples 1-9, wherein the filtering priority is configurable to adjust the priority relationship between the blacklist and the whitelist.
[0090] Example 11. The method of Examples 1-10, wherein at least one of the blacklist and the whitelist for the target tenant is used as downstream data.
[0091] Example 12. The method of Examples 1-11, wherein the blacklist and the whitelist include at least one of a content identifier, an author identifier, and a keyword identifier associated with the target content.
[0092] Example 13. The method of Examples 1-12, further comprising:
[0093] A second filtering state of the second target content for the second target tenant is determined based on the Bloom filter and the mapping filter.
[0094] Example 14. An apparatus for filtering content, the apparatus comprising:
[0095] a Bloom filter generation module configured to generate a Bloom filter for globally filtering content, the Bloom filter comprising a bit array of a filter state according to a set of hash queries;
[0096] a mapping filter generation module configured to generate a mapping filter for personalized filtering of content, the mapping filter including a mapping relationship between a tenant identifier and a content identifier, the mapping filter being capable of querying at least one of a blacklist and a whitelist for a target tenant; and
[0097] The filtering state determination module is configured to determine a filtering state of the target content for the target tenant based on the Bloom filter and the mapping filter.
[0098] Example 15. The apparatus of Example 14, wherein the Bloom filter generation module comprises:
[0099] a Bloom filter construction module configured to construct the bit array of the Bloom filter in a first cycle based on data in a database, wherein the bit array is constructed based on a set of hash values generated by a set of hash functions, and positions in the bit array corresponding to the set of hash values are set to 1; and
[0100] The Bloom filter uploading module is configured to upload the constructed Bloom filter to the object storage service.
[0101] Example 16. The apparatus of Examples 14-15, further comprising:
[0102] The Bloom filter loading module is configured to load the constructed Bloom filter into the memory of the server in a second cycle, wherein the second cycle is smaller than the first cycle.
[0103] Example 17. The apparatus of Examples 14-16, wherein the mapping filter generation module comprises:
[0104] a mapping filter building module configured to build the mapping filter in the first cycle based on the data in the database; and
[0105] a mapping filter uploading module, configured to upload the constructed mapping filter to the object storage service; and
[0106] A mapping filter loading module is configured to load the constructed mapping filter into the memory of the server in the second cycle.
[0107] Example 18. The apparatus of Examples 14-17, wherein the building or the loading is performed separately for each service type.
[0108] Example 19. The apparatus of Examples 14-18, wherein the filter state determination module comprises:
[0109] a global filtering state determining module configured to determine a global filtering state by querying the target tenant and the target content using the Bloom filter; and
[0110] The second filtering state determining module is configured to determine the filtering state of the target content for the target tenant by querying the target tenant using the mapping filter based on the global filtering state.
[0111] Example 20. The apparatus of Examples 14-19, wherein the global filter state determination module comprises:
[0112] a hash value determination module configured to determine a plurality of hash values for the target tenant and the target content based on the tenant identifier and the content identifier;
[0113] A bit value determination module is configured to obtain, based on the multiple hash values, a plurality of bit values in the bit array of the Bloom filter corresponding to the multiple hash values; and
[0114] The second global filter state determination module is configured to determine the global filter state based on the multiple bit values.
[0115] Example 21. The apparatus of Examples 14-20, wherein the second filtering state determination module comprises:
[0116] a list determination module, configured to obtain at least one of the blacklist and the whitelist for the target tenant based on the target tenant; and
[0117] The third filtering status determination module is configured to determine the filtering status of the target content for the target tenant based on the global filtering status, at least one of the blacklist and the whitelist, and a filtering priority.
[0118] Example 22. The apparatus of Examples 14-21, wherein the filtering priority is used to determine a priority relationship between the blacklist and the whitelist.
[0119] Example 23. The apparatus of Examples 14-22, wherein the filtering priority is configurable to adjust the priority relationship between the blacklist and the whitelist.
[0120] Example 24. The apparatus of Examples 14-23, wherein at least one of the blacklist and the whitelist for the target tenant is used as downstream data.
[0121] Example 25. The apparatus of Examples 14-24, wherein the blacklist and the whitelist include at least one of a content identifier, an author identifier, and a keyword identifier associated with the target content.
[0122] Example 26. The apparatus of Examples 14-25, further comprising:
[0123] The fourth filtering state determining module is configured to determine a second filtering state of the second target content for the second target tenant based on the Bloom filter and the mapping filter.
[0124] Example 27. An electronic device comprising:
[0125] processor; and
[0126] a memory coupled to the processor, the memory having instructions stored therein, the instructions, when executed by the processor, causing the device to perform actions, the actions comprising:
[0127] generating a Bloom filter for globally filtering the content, the Bloom filter comprising a bit array that filters a state according to a set of hash queries;
[0128] generating a mapping filter for performing personalized filtering on the content, the mapping filter including a mapping relationship between a tenant identifier and a content identifier, the mapping filter being capable of querying at least one of a blacklist and a whitelist for a target tenant; and
[0129] Based on the Bloom filter and the mapping filter, a filtering status of target content for the target tenant is determined.
[0130] Example 28. The electronic device of Example 27, wherein generating the Bloom filter for globally filtering content comprises:
[0131] constructing the bit array of the Bloom filter in a first cycle based on data in a database, wherein the bit array is constructed based on a set of hash values generated by a set of hash functions, and positions in the bit array corresponding to the set of hash values are set to 1; and
[0132] The constructed Bloom filter is uploaded to the object storage service.
[0133] Example 29. The electronic device of Examples 27-28, wherein the actions further comprise:
[0134] The constructed Bloom filter is loaded into a memory of a server in a second cycle, wherein the second cycle is smaller than the first cycle.
[0135] Example 30. The electronic device of Examples 27-29, wherein generating the mapping filter for personalized filtering of content comprises:
[0136] constructing the mapping filter in the first cycle based on the data in the database; and
[0137] Uploading the constructed mapping filter to the object storage service; and
[0138] The constructed mapping filter is loaded into the memory of the server in the second cycle.
[0139] Example 31. The electronic device of Examples 27-30, wherein the building or the loading is performed separately for each service type.
[0140] Example 32. The electronic device of Examples 27-31, wherein determining the filtering status of the target content for the target tenant based on the Bloom filter and the mapping filter comprises:
[0141] Determining a global filtering state by querying the target tenant and the target content using the Bloom filter; and
[0142] Based on the global filtering state, the filtering state of the target content for the target tenant is determined by querying the target tenant using the mapping filter.
[0143] Example 33. The electronic device of Examples 27-32, wherein determining the global filtering state by querying the target tenant and the target content using the Bloom filter comprises:
[0144] Determining multiple hash values for the target tenant and the target content based on the tenant identifier and the content identifier;
[0145] Based on the multiple hash values, obtaining multiple bit values in the bit array of the Bloom filter corresponding to the multiple hash values; and
[0146] Based on the plurality of bit values, the global filter state is determined.
[0147] Example 34. The electronic device of Examples 27-33, wherein determining the filtering status of the target content for the target tenant by querying the target tenant using the mapping filter based on the global filtering status comprises:
[0148] Based on the target tenant, obtaining at least one of the blacklist and the whitelist for the target tenant; and
[0149] The filtering status of the target content for the target tenant is determined based on the global filtering status, at least one of the blacklist and the whitelist, and a filtering priority.
[0150] Example 35. An electronic device according to Examples 27-34, wherein the filtering priority is used to determine a priority relationship between the blacklist and the whitelist.
[0151] Example 36. An electronic device according to Examples 27-35, wherein the filtering priority is configurable to adjust the priority relationship between the blacklist and the whitelist.
[0152] Example 37. The electronic device of Examples 27-36, wherein at least one of the blacklist and the whitelist for the target tenant is used as downstream data.
[0153] Example 38. The electronic device of Examples 27-37, wherein the blacklist and the whitelist include at least one of a content identifier, an author identifier, and a keyword identifier associated with the target content.
[0154] Example 39. The electronic device of Examples 27-38, wherein the actions further comprise:
[0155] A second filtering state of the second target content for the second target tenant is determined based on the Bloom filter and the mapping filter.
[0156] Example 40. A computer-readable storage medium having one or more computer instructions stored thereon, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of Examples 1 to 13.
[0157] Example 41. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform the method of any one of Examples 1 to 13.
[0158] Although the present disclosure has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for filtering content, comprising: generating a Bloom filter for global filtering of content, the Bloom filter comprising a bit array of filter states according to a set of hash queries; Generate a mapping filter for personalized filtering of content, the mapping filter including a mapping relationship between a tenant identifier and a content identifier, and the mapping filter can query at least one item in a blacklist and a whitelist for a target tenant; as well as Based on the Bloom filter and the mapping filter, a filtering state of the target content for the target tenant is determined.
2. The method according to claim 1, wherein generating the Bloom filter for globally filtering content comprises: Based on the data in the database, construct the bit array of the Bloom filter in a first cycle, wherein the bit array is constructed based on a set of hash values generated by a set of hash functions, and positions in the bit array corresponding to the set of hash values are set to 1; as well as The constructed Bloom filter is uploaded to an object storage service.
3. The method according to claim 2, further comprising: The constructed Bloom filter is loaded into a memory of a server in a second cycle, wherein the second cycle is smaller than the first cycle.
4. The method according to claim 3, wherein generating the mapping filter for personalized filtering of content comprises: constructing the mapping filter in the first cycle based on the data in the database; as well as Uploading the constructed mapping filter to the object storage service; as well as The constructed mapping filter is loaded into the memory of the server in the second cycle. The method according to claim 3 , wherein the building or the loading is performed separately for each service type.
6. The method according to claim 1, wherein determining the filtering status of the target content for the target tenant based on the Bloom filter and the mapping filter comprises: Determine a global filtering state by querying the target tenant and the target content using the Bloom filter; as well as Based on the global filtering state, the filtering state of the target content for the target tenant is determined by querying the target tenant using the mapping filter.
7. The method according to claim 6, wherein determining the global filtering state by querying the target tenant and the target content using the Bloom filter comprises: Determine multiple hash values for the target tenant and the target content based on the tenant identifier and the content identifier; Based on the multiple hash values, obtaining multiple bit values in the bit array of the Bloom filter corresponding to the multiple hash values; as well as Based on the plurality of bit values, the global filter state is determined.
8. The method according to claim 6, determining the filtering status of the target content for the target tenant by querying the target tenant using the mapping filter based on the global filtering status comprises: Based on the target tenant, obtaining at least one item of the blacklist and the whitelist for the target tenant; as well as Based on the global filtering state, at least one of the blacklist and the whitelist, and filtering priority, determining the filtering status of the target content for the target tenant. 9 . The method according to claim 8 , wherein the filtering priority is used to determine a priority relationship between the blacklist and the whitelist. 10 . The method according to claim 9 , wherein the filtering priority is configurable for adjusting the priority relationship between the blacklist and the whitelist. The method according to claim 8 , wherein at least one of the blacklist and the whitelist for the target tenant is used as downstream data. 12 . The method according to claim 11 , wherein the blacklist and the whitelist include at least one of a content identifier, an author identifier, and a keyword identifier associated with the target content.
13. The method according to any one of claims 1 to 12, further comprising: Based on the Bloom filter and the mapping filter, a second filtering state of the second target content for the second target tenant is determined.
14. A device for filtering content, the device comprising: a Bloom filter generation module configured to generate a Bloom filter for global filtering of content, the Bloom filter comprising a bit array of a filter state according to a set of hash queries; A mapping filter generation module, configured to generate a mapping filter for personalized filtering of content, wherein the mapping filter includes a mapping relationship between a tenant identifier and a content identifier, and the mapping filter can query at least one item in a blacklist and a whitelist for a target tenant; as well as The filtering state determination module is configured to determine the filtering state of the target content for the target tenant based on the Bloom filter and the mapping filter.
15. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 13. 16 . A computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement the method according to claim 1 .
Citation Information
Patent Citations
File access request processing method and device and server
CN112148676A
IP address processing method and device, storage medium and processor
CN113572747A
Paas platform-oriented tenant data processing method and device
CN116049180A
Method and device for filtering content, electronic equipment and medium
CN116821520A
System and method for mapping identifier with locator using bloom filter
US20150370906A1
Cited By
Data back-to-source method, device and system
CN121334246A
