Movatterモバイル変換


[0]ホーム

URL:


CN112422668B - Storage method and device for network community, electronic equipment and readable medium - Google Patents

Storage method and device for network community, electronic equipment and readable medium
Download PDF

Info

Publication number
CN112422668B
CN112422668BCN202011245811.XACN202011245811ACN112422668BCN 112422668 BCN112422668 BCN 112422668BCN 202011245811 ACN202011245811 ACN 202011245811ACN 112422668 BCN112422668 BCN 112422668B
Authority
CN
China
Prior art keywords
partition
post
information
pointer
linked list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011245811.XA
Other languages
Chinese (zh)
Other versions
CN112422668A (en
Inventor
肖锋
程杰仕
逄增耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co LtdfiledCriticalBeijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011245811.XApriorityCriticalpatent/CN112422668B/en
Publication of CN112422668ApublicationCriticalpatent/CN112422668A/en
Application grantedgrantedCritical
Publication of CN112422668BpublicationCriticalpatent/CN112422668B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application provides a storage method for a network community, and relates to the technical field of internet and information flow. The specific implementation scheme is as follows: storing each partition in the network in a single-direction linked list mode; the partition node corresponding to the partition stores partition information; storing all the labels in each partition in a bidirectional linked list mode; and the paste node corresponding to the paste stores paste information. The storage method has universality, and realizes quick creation and quick application, thereby reducing the management cost of the network community. The application also provides a storage device, an electronic device and a readable medium for the network community.

Description

Translated fromChinese
用于网络社区的存储方法、装置、电子设备及可读介质Storage method, device, electronic device and readable medium for network community

技术领域technical field

本申请涉及计算机技术领域,具体涉及互联网和信息流技术,尤其涉及用于网络社区的存储方法、装置、电子设备及可读介质。The present application relates to the field of computer technology, specifically to the Internet and information flow technology, and in particular to a storage method, device, electronic device and readable medium for network communities.

背景技术Background technique

移动互联网时代,各类应用程序APP层出不穷,APP之间的竞争越来越激烈,尤其是同一品类APP之间的竞争更加激烈。为了能够在激烈的竞争中生存下去,APP提供商和运营商不仅需要提供更好的服务和产品体验,还需要能够快速迭代,以夺得先机并获得更多用户。In the era of mobile Internet, all kinds of application programs and APPs emerge in an endless stream, and the competition among APPs is becoming more and more fierce, especially the competition between APPs of the same category is more intense. In order to survive in the fierce competition, APP providers and operators not only need to provide better service and product experience, but also need to be able to iterate quickly to seize the opportunity and acquire more users.

发明内容Contents of the invention

提供了一种分区存储方法及装置、电子设备、计算机可读介质。Provided are a partition storage method and device, electronic equipment, and a computer-readable medium.

根据第一方面,提供了一种用于网络社区的存储方法,包括:According to a first aspect, a storage method for an online community is provided, comprising:

将网络内各分区采用单向链表方式存储;其中,所述分区对应的分区节点存储有分区信息;Store each partition in the network in the form of a one-way linked list; wherein, the partition node corresponding to the partition stores partition information;

将每个所述分区内的各贴子采用双向链表方式存储;其中,所述贴子对应的贴子节点存储有贴子信息。Each post in each partition is stored in a doubly linked list; wherein, the post node corresponding to the post stores post information.

根据第二方面,提供了一种用于网络社区的存储装置,包括:According to a second aspect, a storage device for a network community is provided, comprising:

第一存储模块,用于将网络内各分区采用单向链表方式存储;其中,所述分区对应的分区节点存储有分区信息;The first storage module is used to store each partition in the network in the form of a one-way linked list; wherein, the partition node corresponding to the partition stores partition information;

第二存储模块,将每个所述分区内的各贴子采用双向链表方式存储;其中,所述贴子对应的贴子节点存储有贴子信息。The second storage module stores the posts in each partition in the form of a doubly linked list; wherein, the post nodes corresponding to the posts store post information.

根据第三方面,提供了网络社区管理方法,包括:According to a third aspect, a network community management method is provided, including:

在网络社区内创建分区,并将所述分区采用单向链表方式存储;其中,所述分区对应的分区节点存储有分区信息;Create partitions in the network community, and store the partitions in a one-way linked list; wherein, the partition nodes corresponding to the partitions store partition information;

获取所述分区内的贴子,将所述贴子采用双向链表方式存储;其中,所述贴子对应的贴子节点存储有贴子信息。Obtain the posts in the partition, and store the posts in a doubly linked list; wherein, the post nodes corresponding to the posts store post information.

根据第四方面,提供了一种电子设备,其包括:According to a fourth aspect, there is provided an electronic device comprising:

至少一个处理器;以及at least one processor; and

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行用于网络社区的存储方法和管理方法中任一项所述的方法。The memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor, so that the at least one processor can perform the storage method and the management method for the network community any one of the methods described.

根据第五方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行上述任意一种用于网络社区的存储方法和管理方法中任一项所述的方法。According to a fifth aspect, there is provided a non-transitory computer-readable storage medium storing computer instructions, the computer instructions are used to make the computer execute any one of the above-mentioned storage methods and management methods for network communities method described in the item.

根据第六方面,提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现上述用于网络社区的存储方法中任一项所述的方法。According to a sixth aspect, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method described in any one of the above storage methods for network communities is implemented.

本申请提供的用于网络社区的存储方法,社区内各分区采用单向链表方式存储,将每个分区内的各贴子采用双向链表方式存储,以使网络社区具有通用性,在创建或修改分区时,无需开发人员重新设计、开发产品,只需要在分区节点修改分区信息,实现了快速创建和快速应用,从而降低网络社区的管理成本。In the storage method for online communities provided by this application, each partition in the community is stored in a one-way linked list, and each post in each partition is stored in a two-way linked list, so that the online community is universal. When partitioning, there is no need for developers to redesign and develop products, and only need to modify the partition information at the partition node, which realizes rapid creation and rapid application, thereby reducing the management cost of the online community.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will be readily understood through the following description.

附图说明Description of drawings

附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used to better understand the solution, and do not constitute a limitation to the application. in:

图1为本申请实施例提供的一种网络社区的存储方法的流程图;FIG. 1 is a flowchart of a storage method for a network community provided by an embodiment of the present application;

图2为本申请实施例提供的一种网络社区的存储架构图;FIG. 2 is a storage architecture diagram of a network community provided by an embodiment of the present application;

图3为本申请实施例提供的一种用于网络社区的存储装置的原理框图;FIG. 3 is a functional block diagram of a storage device used in a network community provided by an embodiment of the present application;

图4为本申请实施例提供的一种网络社区管理方法的流程图;FIG. 4 is a flowchart of a network community management method provided by an embodiment of the present application;

图5为本申请实施例提供的一种网络社区的架构图;FIG. 5 is an architecture diagram of a network community provided by an embodiment of the present application;

图6为本申请实施例提供的一种新建分区的流程图;FIG. 6 is a flowchart of a newly created partition provided by an embodiment of the present application;

图7为本申请实施例提供的一种修改分区名称的流程图;FIG. 7 is a flow chart of modifying a partition name provided by an embodiment of the present application;

图8为本申请实施例提供的一种删除分区的流程图;FIG. 8 is a flow chart of deleting a partition provided by an embodiment of the present application;

图9为本申请实施例提供的一种新增或删除贴子的流程图;FIG. 9 is a flow chart of adding or deleting a post provided by the embodiment of the present application;

图10a为本申请实施例提供的一种新增贴子的示意图;Fig. 10a is a schematic diagram of a new post provided by the embodiment of the present application;

图10b为本申请实施例提供的一种删除贴子的示意图;Fig. 10b is a schematic diagram of a deleted post provided by the embodiment of the present application;

图11是用来实现本申请实施例的用于网络社区的存储方法的电子设备的框图。Fig. 11 is a block diagram of an electronic device used to implement the storage method for a network community according to the embodiment of the present application.

具体实施方式Detailed ways

以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

在不冲突的情况下,本申请各实施例及实施例中的各特征可相互组合。In the case of no conflict, each embodiment of the present application and each feature in the embodiment can be combined with each other.

如本文所使用的,术语“和/或”包括一个或多个相关列举条目的任何和所有组合。As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

本文所使用的术语仅用于描述特定实施例,且不意欲限制本申请。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。The terminology used herein is for describing particular embodiments only and is not intended to limit the application. As used herein, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that when the terms "comprising" and/or "consisting of" are used in this specification, the stated features, integers, steps, operations, elements and/or components are specified to be present but not excluded to be present or Add one or more other features, integers, steps, operations, elements, components and/or groups thereof.

网络社区APP是使用频率较多的应用程序之一,如贴吧、知乎、脉脉、腾讯新闻、头条等。不同类型的APP均包括多个分区tab,如最新、关注、推荐、精华、热榜等分区,每个分区下有贴子列表。这些分区的名称固定,每个用户的分区名称都相同,无法修改,不能调整分区的展示顺序。而且,由于APP的存储方式不能兼顾通用性,导致APP不能快速应用。当需要增加一个分区时,不仅要新建一个分区,还需要单独在该分区下的贴子内容建立一个贴子列表,这就需要开发上线。另外,在上线时,需要采用小流量的方式去配置,因此需要产品发布上线。开发上线和产品发布上线都需要耗费大量人力。Online community APP is one of the most frequently used applications, such as Tieba, Zhihu, Maimai, Tencent News, Toutiao, etc. Different types of APPs include multiple partition tabs, such as the latest, attention, recommendation, essence, hot list and other partitions, and each partition has a list of posts. The names of these partitions are fixed, and the partition names of each user are the same, which cannot be modified, and the display order of the partitions cannot be adjusted. Moreover, since the storage method of the APP cannot take into account the versatility, the APP cannot be quickly applied. When a partition needs to be added, not only a new partition needs to be created, but also a list of postings needs to be created separately for the content of the postings under the partition, which requires development and online. In addition, when going online, it needs to be configured with a small flow, so the product needs to be released and launched. Both development and product launch require a lot of manpower.

例如,在APP服务商需要开发一个针对热点事件A的分区时,需要开发人员设计、开发“热点事件A”的新产品,并针对该新产品建立贴子列表才能上线。而且,在上线时,还需要采用小流量方式对该新产品发布上线,这需要耗费大量的人力资源,而且应用速度慢,服务商无法快速推出抢占市场,以获得更多的客户。For example, when an APP service provider needs to develop a partition for hot event A, developers need to design and develop a new product of "hot event A", and create a post list for the new product before it goes online. Moreover, when going online, the new product needs to be launched in a small-traffic method, which requires a lot of human resources, and the application speed is slow, and service providers cannot quickly launch it to seize the market and gain more customers.

针对网络社区APP中存在的至少上述问题之一,提供一种用于网络社区的存储方法、存储装置、网络社区的管理方法、电子设备及计算机可读存储介质。Aiming at at least one of the above-mentioned problems in the online community APP, a storage method, a storage device, a management method for the online community, electronic equipment, and a computer-readable storage medium for the online community are provided.

第一方面,本申请实施例提供一种网络社区的存储方法,该存储方法主要是对网络社区的分区和贴子的存储方式进行改进,以使网络社区兼具通用性,能够快速应用。In the first aspect, the embodiment of the present application provides a storage method of an online community. The storage method mainly improves the partitioning of the online community and the storage method of posts, so that the online community is versatile and can be quickly applied.

图1为本申请实施例提供的一种网络社区的存储方法的流程图,图2为本申请实施例提供的一种网络社区的存储架构图。参阅图1和图2,本申请实施例提供的网络社区的存储方法包括:FIG. 1 is a flowchart of a method for storing a network community provided by an embodiment of the present application, and FIG. 2 is a diagram of a storage architecture of a network community provided by an embodiment of the present application. Referring to Fig. 1 and Fig. 2, the storage method of the network community provided by the embodiment of the present application includes:

步骤101,将网络社区内各分区采用单向链表方式存储。Step 101, store each partition in the network community in the form of a one-way linked list.

其中,单项链表是指分区只有一个指向下一分区的指针,每个分区节点只能单向读取。分区的元数据是结构化数据,可采用MySQL方式存储。Among them, the single-item linked list means that the partition has only one pointer to the next partition, and each partition node can only read in one direction. The metadata of the partition is structured data, which can be stored in MySQL.

如图2所示,网络社区包括n个分区,其中,n为大于或等于1的整数。分区1只有指向分区2的指针,分区2只有指向分区3的指针,以此类推,分区n-1只有指向分区n的指针。As shown in FIG. 2 , the network community includes n partitions, where n is an integer greater than or equal to 1. Partition 1 has only a pointer to partition 2, partition 2 has only a pointer to partition 3, and so on, partition n-1 has only a pointer to partition n.

在一些实施例中,网络社区的分区所对应的分区节点存储有该分区的分区信息。其中,分区信息包括分区的分区名称和分区标识、下一分区的指针信息、所述分区内的贴子数量、所述分区内首个贴子的指针信息和最后一个贴子的指针信息中的至少一项。In some embodiments, the partition node corresponding to the partition of the network community stores the partition information of the partition. Wherein, the partition information includes the partition name and partition identifier of the partition, the pointer information of the next partition, the number of posts in the partition, the pointer information of the first post in the partition, and the pointer information of the last post in the partition. at least one.

在对某个分区进行编辑时,只需要修改该分区及与其相邻的分区的分区信息即可。例如,当新建一个分区时,只需要将该分区插入想要的位置,并修改该分区及与其相邻的上一分区和下一分区的分区信息。当删除一个分区时,将该分区删除,并修改与其相邻的上一分区和下一分区的分区信息。当需要修改该分区的名称时,只需要修改该分区的分区信息。When editing a partition, you only need to modify the partition information of this partition and its adjacent partitions. For example, when creating a new partition, it is only necessary to insert the partition into a desired position, and modify the partition information of the partition and its adjacent previous and next partitions. When deleting a partition, delete the partition, and modify the partition information of the previous partition and the next partition adjacent to it. When the name of the partition needs to be modified, only the partition information of the partition needs to be modified.

步骤102,将每个分区内的各贴子采用双向链表方式存储。Step 102, storing each post in each partition in the form of a doubly linked list.

其中,双向链表是指贴子既有指向下一个贴子的指针,还有一个指向前一贴子的指针。每个贴子既能向下单向读取,又能向前找到前一贴子。Among them, the doubly linked list means that a post has both a pointer to the next post and a pointer to the previous post. Each post can not only be read downwards, but also forward to find the previous post.

在一些实施例中,贴子数据是拉链结构数据,可采用MySQL方式存储。In some embodiments, the post data is data in a zipper structure, which can be stored in MySQL.

如图2所示,网络社区中的每个分区内包括m个贴子,其中,m为大于或等于1的整数。例如,在分区1内包括m个贴子,贴子1包括贴子2的指针,贴子2既包括贴子2的指针,又包括贴子3的指针,依次类推,贴子m-1包括贴子m-2的指针,又包括贴子m的指针。As shown in FIG. 2 , each partition in the network community includes m posts, where m is an integer greater than or equal to 1. For example, there are m posts in partition 1, post 1 includes pointers to post 2, post 2 includes both pointers to post 2 and pointers to post 3, and so on, post m-1 includes The pointer of post m-2 includes the pointer of post m.

在一些实施例中,贴子对应的贴子节点存储有贴子信息,贴子信息包括所述贴子的标识、发贴时间、指向前一贴子的指针和指向下一个贴子的指针。In some embodiments, a post node corresponding to a post stores post information, and the post information includes an identifier of the post, posting time, a pointer to a previous post, and a pointer to a next post.

当需要修改贴子时,只需要修改该贴子的贴子信息以及与该贴子相邻的贴子的贴子信息。例如,当新建一个贴子时,将该贴子插入相应的位置,并修改该贴子的贴子信息,即除添加该贴子的标识和发帖时间外,还要添加与其相邻的前一贴子指针和下一贴子的指针。当删除一个贴子时,删除该贴子,并修改与其相邻的前一贴子和下一贴子的贴子信息。对于与删除贴子相邻的前一贴子的贴子信息,需要修改其下一贴子的指针;对于与删除贴子相邻的下一贴子的贴子信息,需要修改其前一贴子的指针。例如,当删除贴子2时,需要修改贴子1的下一贴子的指针,即将贴子1的下一贴子的指针指向贴子3,以及贴子3的前一贴子的指针,即贴子3的前一贴子的指针指向贴子1。When a post needs to be modified, only the post information of the post and the post information of the adjacent posts need to be modified. For example, when creating a new post, insert the post into the corresponding position, and modify the post information of the post, that is, in addition to adding the logo and posting time of the post, it is also necessary to add the previous post adjacent to it. A pointer to the post and a pointer to the next post. When deleting a post, delete the post, and modify the post information of the previous post and the next post adjacent to it. For the post information of the previous post adjacent to the deleted post, the pointer of the next post needs to be modified; for the post information of the next post adjacent to the deleted post, the previous post needs to be modified child pointer. For example, when post 2 is deleted, the pointer of the next post of post 1 needs to be modified, that is, the pointer of the next post of post 1 points to post 3, and the pointer of the previous post of post 3, That is, the pointer of the previous post of post 3 points to post 1.

在一些实施例中,每个分区内的贴子按照发帖的时间顺序存储。例如,贴子1、贴子2、……、贴子m按照发帖时间顺序排列。当需要新建贴子时,通过检索发帖时间将该贴子插入对应的位置,再添加该贴子的前一贴子的指针和下一贴子的指针。In some embodiments, the posts in each partition are stored in chronological order of posting. For example, post 1, post 2, ..., post m are arranged in order of posting time. When it is necessary to create a new post, insert the post into the corresponding position by retrieving the posting time, and then add the pointer of the previous post and the pointer of the next post of the post.

需要说明的是,当新建分区和贴子时,可以先将分区利用单向链表方式存储,再将分区下的贴子按照双向链表方式存储。当仅建立分区而不在该分区下建立贴子时,仅将分区按照单向链表方式存储。当仅建立贴子时,按照双向链表方式存储该贴子。It should be noted that when creating new partitions and posts, the partitions can be stored in a one-way linked list first, and then the posts under the partitions can be stored in a two-way linked list. When only creating a partition without creating a post under the partition, only the partition is stored in the form of a one-way linked list. When only postings are created, the postings are stored in the form of a doubly linked list.

本申请提供的用于网络社区的存储方法,网络社区内各分区采用单向链表方式存储,将每个分区内的各贴子采用双向链表方式存储,以使网络社区具有通用性,在创建或修改分区时,无需开发人员重新设计、开发产品,只需要在分区节点修改分区信息,实现了快速创建和快速应用,从而降低网络社区的管理成本。In the storage method for online communities provided by this application, each partition in the online community is stored in a one-way linked list, and each post in each partition is stored in a two-way linked list, so that the online community has versatility. When modifying partitions, developers do not need to redesign and develop products, and only need to modify partition information at the partition node, which realizes rapid creation and rapid application, thereby reducing the management cost of the online community.

第二方面,本申请实施例提供一种用于网络社区的存储装置,该存储装置对网络社区的分区和贴子的存储方式进行改进,并使网络社区兼具通用性,从而能够快速应用。In the second aspect, the embodiment of the present application provides a storage device for a network community. The storage device improves the partitioning of the network community and the storage method of posts, and makes the network community universal, so that it can be quickly applied.

图3为本申请实施例提供的一种用于网络社区的存储装置的原理框图。参考图2和图3,本申请实施例提供的用于网络社区的存储装置包括:Fig. 3 is a functional block diagram of a storage device used in a network community provided by an embodiment of the present application. Referring to Figure 2 and Figure 3, the storage device for the network community provided by the embodiment of the present application includes:

第一存储模块301,用于将网络内各分区采用单向链表方式存储。Thefirst storage module 301 is configured to store each partition in the network in the form of a one-way linked list.

其中,单项链表是指分区只有一个指向下一分区的指针,每个分区节点只能单向读取。Among them, the single-item linked list means that the partition has only one pointer to the next partition, and each partition node can only read in one direction.

如图2所示,网络社区包括n个分区,其中,n为大于或等于1的整数。分区1只有指向分区2的指针,分区2只有指向分区3的指针,以此类推,分区n-1只有指向分区n的指针。As shown in FIG. 2 , the network community includes n partitions, where n is an integer greater than or equal to 1. Partition 1 has only a pointer to partition 2, partition 2 has only a pointer to partition 3, and so on, partition n-1 has only a pointer to partition n.

在一些实施例中,网络社区的分区所对应的分区节点存储有该分区的分区信息。其中,分区信息包括分区的分区名称和分区标识、下一分区的指针信息、所述分区内的贴子数量、所述分区内首个贴子的指针信息和最后一个贴子的指针信息中的至少一项。In some embodiments, the partition node corresponding to the partition of the network community stores the partition information of the partition. Wherein, the partition information includes the partition name and partition identifier of the partition, the pointer information of the next partition, the number of posts in the partition, the pointer information of the first post in the partition, and the pointer information of the last post in the partition. at least one.

第二存储模块302,将每个所述分区内的各贴子采用双向链表方式存储。Thesecond storage module 302 stores the posts in each partition in the form of a doubly linked list.

其中,双向链表是指贴子既有指向下一个贴子的指针,还有一个指向前一贴子的指针。每个贴子既能向下单向读取,又能向前找到前一贴子。Among them, the doubly linked list means that a post has both a pointer to the next post and a pointer to the previous post. Each post can not only be read downwards, but also forward to find the previous post.

如图2所示,网络社区中的每个分区内包括m个贴子,其中,m为大于或等于1的整数。例如,在分区1内包括m个贴子,贴子1包括贴子2的指针,贴子2既包括贴子2的指针,又包括贴子3的指针,依次类推,贴子m-1包括贴子m-2的指针,又包括贴子m的指针。As shown in FIG. 2 , each partition in the network community includes m posts, where m is an integer greater than or equal to 1. For example, there are m posts in partition 1, post 1 includes pointers to post 2, post 2 includes both pointers to post 2 and pointers to post 3, and so on, post m-1 includes The pointer of post m-2 includes the pointer of post m.

在一些实施例中,贴子对应的贴子节点存储有贴子信息,贴子信息包括所述贴子的标识、发贴时间、指向前一贴子的指针和指向下一个贴子的指针。In some embodiments, a post node corresponding to a post stores post information, and the post information includes an identifier of the post, posting time, a pointer to a previous post, and a pointer to a next post.

当需要修改贴子时,只需要修改该贴子的贴子信息以及与该贴子相邻的贴子的贴子信息。例如,当新建一个贴子时,将该贴子插入相应的位置,并修改该贴子的贴子信息,即除添加该贴子的标识和发帖时间外,还要添加与其相邻的前一贴子指针和下一贴子的指针。当删除一个贴子时,删除该贴子,并修改与其相邻的前一贴子和下一贴子的贴子信息。对于与删除贴子相邻的前一贴子的贴子信息,需要修改其下一贴子的指针;对于与删除贴子相邻的下一贴子的贴子信息,需要修改其前一贴子的指针。例如,当删除贴子2时,需要修改贴子1的下一贴子的指针,即将贴子1的下一贴子的指针指向贴子3,以及贴子3的前一贴子的指针,即贴子3的前一贴子的指针指向贴子1。When a post needs to be modified, only the post information of the post and the post information of the adjacent posts need to be modified. For example, when creating a new post, insert the post into the corresponding position, and modify the post information of the post, that is, in addition to adding the logo and posting time of the post, it is also necessary to add the previous post adjacent to it. A pointer to the post and a pointer to the next post. When deleting a post, delete the post, and modify the post information of the previous post and the next post adjacent to it. For the post information of the previous post adjacent to the deleted post, the pointer of the next post needs to be modified; for the post information of the next post adjacent to the deleted post, the previous post needs to be modified child pointer. For example, when post 2 is deleted, the pointer of the next post of post 1 needs to be modified, that is, the pointer of the next post of post 1 points to post 3, and the pointer of the previous post of post 3, That is, the pointer of the previous post of post 3 points to post 1.

在一些实施例中,每个分区内的贴子按照发帖的时间顺序存储。例如,贴子1、贴子2、……、贴子m按照发帖时间顺序排列。当需要新建贴子时,通过检索发帖时间将该贴子插入对应的位置,再添加该贴子的前一贴子的指针和下一贴子的指针。In some embodiments, the posts in each partition are stored in chronological order of posting. For example, post 1, post 2, ..., post m are arranged in order of posting time. When it is necessary to create a new post, insert the post into the corresponding position by retrieving the posting time, and then add the pointer of the previous post and the pointer of the next post of the post.

需要说明的是,当新建分区和贴子时,可以先将分区利用单向链表方式存储,再将分区下的贴子按照双向链表方式存储。当仅建立分区而不在该分区下建立贴子时,仅将分区按照单向链表方式存储。当仅建立贴子时,按照双向链表方式存储该贴子。It should be noted that when creating new partitions and posts, the partitions can be stored in a one-way linked list first, and then the posts under the partitions can be stored in a two-way linked list. When only creating a partition without creating a post under the partition, only the partition is stored in the form of a one-way linked list. When only postings are created, the postings are stored in the form of a doubly linked list.

本申请提供的用于网络社区的存储装置,第一存储模块将网络社区内各分区采用单向链表方式存储,第二存储模块将每个分区内的各贴子采用双向链表方式存储,以使网络社区具有通用性,在创建或修改分区时,无需开发人员重新设计、开发产品,只需要在分区节点修改分区信息,实现了快速创建和快速应用,从而降低网络社区的管理成本。In the storage device used in the online community provided by this application, the first storage module stores each partition in the online community in a one-way linked list, and the second storage module stores each post in each partition in a two-way linked list, so that The online community is versatile. When creating or modifying a partition, developers do not need to redesign or develop products. They only need to modify the partition information at the partition node, which realizes rapid creation and rapid application, thereby reducing the management cost of the online community.

第三方面,本申请实施例提供一种网络社区管理方法,该方法对网络社区的分区和贴子的存储方式进行改进,并使网络社区兼具通用性,从而能够快速应用。In the third aspect, the embodiment of the present application provides a network community management method, which improves the partitioning of the network community and the storage method of postings, and makes the network community universal, so that it can be quickly applied.

图4为本申请实施例提供的一种网络社区管理方法的流程图。参考图4,本实施例提供的网络社区管理方法,包括:FIG. 4 is a flow chart of a network community management method provided by an embodiment of the present application. Referring to FIG. 4, the network community management method provided by this embodiment includes:

步骤401,在网络社区内创建分区,并将所述分区采用单向链表方式存储。Step 401, creating partitions in the network community, and storing the partitions in the form of a one-way linked list.

其中,单项链表是指分区只有一个指向下一分区的指针,每个分区节点只能单向读取。Among them, the single-item linked list means that the partition has only one pointer to the next partition, and each partition node can only read in one direction.

如图2所示,网络社区包括n个分区,其中,n为大于或等于1的整数。分区1只有指向分区2的指针,分区2只有指向分区3的指针,以此类推,分区n-1只有指向分区n的指针。As shown in FIG. 2 , the network community includes n partitions, where n is an integer greater than or equal to 1. Partition 1 has only a pointer to partition 2, partition 2 has only a pointer to partition 3, and so on, partition n-1 has only a pointer to partition n.

在一些实施例中,网络社区的分区所对应的分区节点存储有该分区的分区信息。其中,分区信息包括分区的分区名称和分区标识、下一分区的指针信息、所述分区内的贴子数量、所述分区内首个贴子的指针信息和最后一个贴子的指针信息中的至少一项。In some embodiments, the partition node corresponding to the partition of the network community stores the partition information of the partition. Wherein, the partition information includes the partition name and partition identifier of the partition, the pointer information of the next partition, the number of posts in the partition, the pointer information of the first post in the partition, and the pointer information of the last post in the partition. at least one.

步骤402,获取所述分区内的贴子,将所述贴子采用双向链表方式存储。Step 402, acquiring posts in the partition, and storing the posts in a doubly linked list.

其中,双向链表是指贴子既有指向下一个贴子的指针,还有一个指向前一贴子的指针。每个贴子既能向下单向读取,又能向前找到前一贴子。Among them, the doubly linked list means that a post has both a pointer to the next post and a pointer to the previous post. Each post can not only be read downwards, but also forward to find the previous post.

在一些实施例中,贴子对应的贴子节点存储有贴子信息,贴子信息包括所述贴子的标识、发贴时间、指向前一贴子的指针和指向下一个贴子的指针。In some embodiments, a post node corresponding to a post stores post information, and the post information includes an identifier of the post, posting time, a pointer to a previous post, and a pointer to a next post.

在一些实施例中,每个分区内的贴子按照发帖的时间顺序存储。例如,贴子1、贴子2、……、贴子m按照发帖时间顺序排列。当需要新建贴子时,通过检索发帖时间将该贴子插入对应的位置,再添加该贴子的前一贴子的指针和下一贴子的指针。In some embodiments, the posts in each partition are stored in chronological order of posting. For example, post 1, post 2, ..., post m are arranged in order of posting time. When it is necessary to create a new post, insert the post into the corresponding position by retrieving the posting time, and then add the pointer of the previous post and the pointer of the next post of the post.

贴子采用双向链表方式存储,同时按照发帖时间顺序存储,可以支持按照时间正序、倒序检索,从而提高网络社区的使用更加便利,改善用户的体验。Posts are stored in a two-way linked list, and stored in the order of posting time, which can support retrieval in forward and reverse time order, so as to make the use of the online community more convenient and improve user experience.

在一些实施例中,步骤401,在网络内创建分区,将所述分区采用单向链表方式存储,包括:获取所述分区的分区名称和分区标识;基于所述分区名称和所述分区标识创建所述分区;将创建的分区采用单向链表方式存储。In some embodiments,step 401, creating partitions in the network and storing the partitions in a singly linked list includes: obtaining the partition name and partition identifier of the partition; creating a partition based on the partition name and the partition identifier. The partition; the partition to be created is stored in the form of a one-way linked list.

其中,分区名称可以由客户自定义,分区的标识由发号器生成。由于网络社区APP内分区数据是社区数目与每个社区内分区的量级相乘,因此,网络社区内需要多张数据库表存储,使用数据库自增标识容易导致分区标识重复。发号器生成分区标识相对于数据自增标识而言,可以避免分区标识重复,方便后续扩展。Among them, the name of the partition can be customized by the customer, and the identification of the partition is generated by the number issuer. Since the partition data in the online community APP is multiplied by the number of communities and the magnitude of the partitions in each community, multiple database tables are required for storage in the online community, and the use of database auto-increment identifiers may easily lead to duplicate partition identifiers. Compared with the data self-incrementing identifier, the partition identifier generated by the issuer can avoid duplication of partition identifiers and facilitate subsequent expansion.

在创建分区时,基于分区名称和分区标识建立分区,分区采用单向链表方式存储,并在分区节点存储下一分区的指针信息,分区内的贴子数量、分区内首个贴子的指针信息和最后一个贴子的指针信息。When creating a partition, create a partition based on the partition name and partition identifier. The partition is stored in a one-way linked list, and the pointer information of the next partition, the number of posts in the partition, and the pointer information of the first post in the partition are stored in the partition node. and a pointer to the last post.

在一些实施例中,在网络内创建分区,将所述分区采用单向链表方式存储之前,还包括:对分区名称的合理性进行判断,并在分区名称的合理的情况下,基于分区名称和分区标识创建所述分区。In some embodiments, before creating partitions in the network and storing the partitions in a one-way linked list, it also includes: judging the rationality of the partition name, and if the partition name is reasonable, based on the partition name and The partition ID creates the partition.

其中,合理性是指符合社会普通价值观,涉黄、涉赌、涉毒不符合社会普通价值观。涉黄赌毒的名称是不符合合理性的名称。判断分区名称是否合理,若不合理,则无法创建分区。只有在所述分区名称的合理的情况下,基于所述分区名称和所述分区标识创建所述分区。Among them, rationality means that it conforms to the common values of society, and those involved in pornography, gambling, and drugs do not conform to the common values of society. The names related to pornography, gambling and drugs are unreasonable names. Determine whether the partition name is reasonable, if not, the partition cannot be created. The partition is created based on the partition name and the partition identifier only if the partition name is reasonable.

在一些实施例中,将创建的分区采用单向链表方式存储之后,还可以包括:接收删除分区的删除指令;其中,所述删除指令包括所述分区的标识;基于所述删除指令删除所述分区,并更新所述单向链表中的分区顺序。In some embodiments, after storing the created partitions in a one-way linked list, it may further include: receiving a delete instruction to delete a partition; wherein, the delete instruction includes the identifier of the partition; and delete the partition based on the delete instruction. partition, and update the order of the partitions in the singly linked list.

用户通过终端发送删除分区的删除指令,存储装置收到删除指令后,根据分区标识找到需要删除的分区,将该分区删除,并更新单向链表中的分区顺序,以及删除该分区下的贴子拉链。The user sends a delete command to delete a partition through the terminal. After receiving the delete command, the storage device finds the partition to be deleted according to the partition ID, deletes the partition, updates the order of the partitions in the one-way linked list, and deletes the postings under the partition. zipper.

在一些实施例中,将创建的所述分区采用单向链表方式存储之后,还包括:接收修改所述分区的修改指令;其中,所述修改指令包括所述分区的标识、修改后的所述分区的名称和所述分区的序号;基于所述修改指令修改并更新所述分区的分区信息。In some embodiments, after storing the created partition in the form of a one-way linked list, it further includes: receiving a modification instruction for modifying the partition; wherein, the modification instruction includes the identifier of the partition, the modified The name of the partition and the serial number of the partition; modify and update the partition information of the partition based on the modification instruction.

用户通过终端发送修改指令,存储装置基于修改指令对应的分区标识,需要修改分区的分区信息。The user sends a modification instruction through the terminal, and the storage device needs to modify the partition information of the partition based on the partition identifier corresponding to the modification instruction.

图5为本申请实施例提供的一种网络社区的架构图。参考图5,分区创建、分区编辑和分区查询是基于分区缓存模块501,分区缓存模块501以Redis Hash结构存储,分区相关的元数据采用MySQL方式存储于第一存储模块502,分区中的贴子数据采用MySQL方式存储于第二存储模块503,贴子数据为拉链结构数据。第一存储模块502和第二存储模块503为永久存储模块。FIG. 5 is an architecture diagram of a network community provided by an embodiment of the present application. Referring to Fig. 5, partition creation, partition editing and partition query are based on the partition cache module 501. The partition cache module 501 is stored in a Redis Hash structure, and the metadata related to the partition is stored in the first storage module 502 in MySQL mode. Posts in the partition The data is stored in the second storage module 503 in the form of MySQL, and the post data is zipper structure data. The first storage module 502 and the second storage module 503 are permanent storage modules.

在使用网络社区的数据时,由于数据读取的场景远大于修改写入的场景,为应对高并发场景,使用Redis Hash结构存储分区的数据,即,在使用这些数据时,将分区信息放置在缓存层,并以Redis Hash结构存储,以达到缓存作用。When using the data of the network community, since the scenario of data reading is much larger than the scenario of modifying and writing, in order to cope with high concurrency scenarios, the Redis Hash structure is used to store partitioned data, that is, when using these data, the partition information is placed in The cache layer is stored in the Redis Hash structure to achieve the caching effect.

其中,分区的结构可以采用如下方式:Among them, the partition structure can be as follows:

分区ID=>{field:value}。其中,field为分区id,value为分区的名称及展示顺序的组合,Partition ID => {field:value}. Among them, field is the partition id, and value is the combination of the name of the partition and the display order.

例如,分区ID{For example, Partition ID {

tab_id_1:tab_name_1:2,//分区1的名称是tab_name_1,排序2。tab_id_1:tab_name_1:2, //The name of partition 1 is tab_name_1, sort 2.

tab_id_2:tab_name_2:4,//分区2的名称是tab_name_2,排序4tab_id_2:tab_name_2:4, //The name of partition 2 is tab_name_2, sorted 4

tab_id_3:tab_name_3:1,//分区3的名称是tab_name_3,排序1tab_id_3:tab_name_3:1, //The name of partition 3 is tab_name_3, sorted 1

tab_id_4:tab_name_4:3,//分区4的名称是tab_name_4,排序3tab_id_4:tab_name_4:3, //The name of partition 4 is tab_name_4, sorted 3

}}

整个网络社区的分区数据集合可以表示为:The partition data set of the entire network community can be expressed as:

Set={fid1:{f1:v1,f2:v2},fid2:{f1:v1,f2:v2},fid3:{f1:v1,f2:v2}…,fidn:{f1:v1,f2:v2}Set={fid1:{f1:v1,f2:v2},fid2:{f1:v1,f2:v2},fid3:{f1:v1,f2:v2}...,fidn:{f1:v1,f2:v2 }

其中,fidn表示第n个网络社区;第n个网络社区包括两个分区,其中,第一个分区的标识为f1,分区名称及展示顺序的组合为V1;第二个分区的标识为f2,分区名称及展示顺序的组合为V2。Among them, fidn represents the nth online community; the nth online community includes two partitions, wherein the first partition is identified as f1, and the combination of the partition name and display order is V1; the second partition is identified as f2, The combination of partition name and display order is V2.

在一些实施例中,分区的元数据采用MySQL永久存储,每个分区记录方式如下:In some embodiments, the metadata of the partition is permanently stored in MySQL, and the record method of each partition is as follows:

record:{fid,tab_id,tab_name,sort,is_del}record: {fid, tab_id, tab_name, sort, is_del}

其中,fid为网络社区ID,tab_id为分区标识,tab_name为分区名称,sort为分区的排序顺序,is_del为是否删除(分区删除操作可以为逻辑删除,数据依旧保留)。Among them, fid is the network community ID, tab_id is the partition identifier, tab_name is the partition name, sort is the sort order of the partitions, and is_del is whether to delete (the partition deletion operation can be logic deletion, and the data is still retained).

在一些实施例中,分区中的贴子数据使用MySQL方式存储,并运用拉链结构的双向链表方式实现高效、灵活的存取。In some embodiments, the post data in the partition is stored using MySQL, and a zipper-structured doubly-linked list is used to achieve efficient and flexible access.

为了更好地理解本申请实施例提供的网络社区管理方法,下面以实际应用场景进行介绍。In order to better understand the network community management method provided by the embodiment of the present application, an actual application scenario will be introduced below.

图6为本申请实施例提供的一种新建分区的流程图。参考图6,新建分区的步骤包括:FIG. 6 is a flow chart of creating a new partition provided by the embodiment of the present application. Referring to Figure 6, the steps to create a new partition include:

步骤601,获取分区名称。Step 601, obtain a partition name.

在一些实施例中,用户可以自己定义分区名称,或者由服务商推荐分区名称。在服务商推荐分区名称时,服务商可以根据相同或相似类型的网络社区推荐若干分区名称,供用户选择。In some embodiments, the user can define the partition name by himself, or the service provider recommends the partition name. When the service provider recommends a partition name, the service provider may recommend several partition names based on the same or similar types of network communities for users to choose.

步骤602,对分区名称进行过滤。Step 602, filter the partition name.

其中,过滤是指对分区名称的合理性进行判断,将不合理的名称过滤掉。对于不合理的分区名称,直接停止或暂停后续的流程。Wherein, filtering refers to judging the rationality of partition names, and filtering out unreasonable names. For unreasonable partition names, stop or suspend subsequent processes directly.

例如,当分区名称涉及黄、赌、毒等不合理的名称时,可以提醒用户选择其它的分区名称,直至分区名称满足条件再进行后续流程。For example, when the partition name involves unreasonable names such as pornography, gambling, drugs, etc., the user can be reminded to choose another partition name, and the subsequent process will not proceed until the partition name meets the conditions.

步骤603,获取分区标识。Step 603, obtain the partition ID.

其中,分区标识是分区身份的标识,在整个网络社区内,所有的分区标识不能重复。Wherein, the partition identifier is the identifier of the partition identity, and in the entire network community, all partition identifiers cannot be repeated.

在一些实施例中,分区标识通过发号器服务生成,这样不仅可以避免分区标识重复,还有利于后续分区的扩展。In some embodiments, the partition ID is generated by the issuer service, which not only avoids duplication of partition IDs, but also facilitates the expansion of subsequent partitions.

步骤604,存储分区标识和分区名称。Step 604, storing the partition identifier and partition name.

将分区标识和分区名称存储在Redis,并持久化到第一存储模块。本申请分区是以单向链表方式存储,因此,该新建分区的排序可以默认为本网络社区中分区最大数加1。Store the partition identifier and partition name in Redis, and persist them to the first storage module. The application partitions are stored in the form of a one-way linked list. Therefore, the sorting of the newly created partitions can default to the maximum number of partitions in this network community plus 1.

步骤605,在新建分区下创建贴子。Step 605, create a post under the newly created partition.

在新建分区下创建贴子,贴子可以是其它分区的贴子,也可以是新创建的贴子。Create a post under the newly created partition. The post can be a post in another partition or a newly created post.

步骤606,将贴子采用双向链表方式存储。Step 606, store the posts in a doubly linked list.

将贴子存储在第二存储模块。例如,将贴子的标识和发贴时间存储在第二存储模块。本申请实施例中,贴子是采用双向链表方式存储,每个贴子节点还存储有指向前一贴子的指针和指向下一个贴子的指针。Store the posts in the second storage module. For example, the identification and posting time of the post are stored in the second storage module. In the embodiment of the present application, the posts are stored in a doubly linked list, and each post node also stores a pointer to the previous post and a pointer to the next post.

在创建分区写的贴子后,修改第一存储模块的分区节点信息,分区内的贴子数量、分区内首个贴子的指针信息和最后一个贴子的指针信息。After creating the post written by the partition, modify the partition node information of the first storage module, the number of posts in the partition, the pointer information of the first post and the pointer information of the last post in the partition.

图7为本申请实施例提供的一种修改分区名称的流程图。参考图7,本申请实施例提供的修改分区名称的步骤,包括:FIG. 7 is a flow chart of modifying a partition name provided by an embodiment of the present application. Referring to Figure 7, the steps for modifying the partition name provided by the embodiment of the present application include:

步骤701,获取分区名称。Step 701, obtain the partition name.

在一些实施例中,用户可以自己定义分区名称,或者由服务商推荐分区名称。在服务商推荐分区名称时,服务商可以根据相同或相似类型的网络社区推荐若干分区名称,供用户选择。In some embodiments, the user can define the partition name by himself, or the service provider recommends the partition name. When the service provider recommends a partition name, the service provider may recommend several partition names based on the same or similar types of network communities for users to choose.

步骤702,对分区名称进行过滤。Step 702, filter the partition name.

其中,过滤是指对分区名称的合理性进行判断,将不合理的名称过滤掉。对于不合理的分区名称,直接停止或暂停后续的流程。Wherein, filtering refers to judging the rationality of partition names, and filtering out unreasonable names. For unreasonable partition names, stop or suspend subsequent processes directly.

例如,当分区名称涉及黄、赌、毒等不合理的名称时,可以提醒用户选择其它的分区名称,直至分区名称满足条件再进行后续流程。For example, when the partition name involves unreasonable names such as pornography, gambling, drugs, etc., the user can be reminded to choose another partition name, and the subsequent process will not proceed until the partition name meets the conditions.

步骤703,更新分区名称。Step 703, update the partition name.

在一些实施例中,在分区名称符合要求时,对缓存模块和第一存储模块中的分区名称进行更新并存储。In some embodiments, when the partition names meet the requirements, the partition names in the cache module and the first storage module are updated and stored.

在一些实施例中,用户可以对网络社区内的分区的顺序进行调整。例如,用户通过客户端编辑新的分区顺序,将新的分区顺序发送至网络社区服务器,对缓存模块和第一存储模块中分区的顺序进行调整修改。In some embodiments, the user can adjust the order of the partitions within the online community. For example, the user edits the new partition sequence through the client, sends the new partition sequence to the network community server, and adjusts and modifies the partition sequence in the cache module and the first storage module.

图8为本申请实施例提供的一种删除分区的流程图。参阅图8,删除分区的步骤,包括:FIG. 8 is a flow chart of deleting a partition provided by the embodiment of the present application. Referring to Figure 8, the steps to delete a partition include:

步骤801,响应分区删除指令,删除缓冲模块中对应的分区。Step 801: Delete the corresponding partition in the buffer module in response to the partition deletion instruction.

在一些实施例中,收到删除指令后,依据网络社区标识、分区标识删除缓冲模块中对应的分区,并更新该网络社区中其它分区的顺序。In some embodiments, after the deletion instruction is received, the corresponding partition in the buffer module is deleted according to the network community ID and the partition ID, and the sequence of other partitions in the network community is updated.

例如,当删除网络社区中的分区4时,分区4之后的分区的序号需要修改,即分区4之后的每个分区的序号自动减1。For example, when partition 4 in the online community is deleted, the sequence numbers of the partitions after partition 4 need to be modified, that is, the sequence numbers of each partition after partition 4 are automatically decremented by 1.

步骤802,对数据库中对应的分区进行软删除。Step 802, perform soft deletion on the corresponding partition in the database.

其中,软删除是指逻辑上的删除,数据依据保留。Among them, soft deletion refers to logical deletion, and the data is retained according to the basis.

在一些实施例中,依据网络社区标识、分区标识,在数据库中将对应分区软删除,并更新该网络社区内其它分区的顺序。In some embodiments, according to the network community identifier and the partition identifier, the corresponding partition is soft deleted in the database, and the sequence of other partitions in the network community is updated.

步骤803,删除分区内的贴子。Step 803, delete the posts in the section.

依据网络社区标识和分区标识,将需要删除的分区内贴子拉链删除。According to the network community logo and partition logo, delete the post zipper in the partition that needs to be deleted.

图9为本申请实施例提供的新增或删除贴子的流程图。参考图9,新增或删除贴子的步骤,包括:FIG. 9 is a flow chart of adding or deleting a post provided by the embodiment of the present application. Referring to Figure 9, the steps to add or delete a post include:

步骤901,响应贴子操作请求,找到操作位置。Step 901, responding to the post operation request, and finding the operation location.

在贴子操作请求中包括网络社区标识、分区标识、贴子标识和操作类型,其中,操作类型可以是新增和删除贴子。The post operation request includes an online community ID, a partition ID, a post ID and an operation type, wherein the operation type may be adding or deleting a post.

在一些实施例中,按照网络社区标识找到对应的网络社区,按照分区标识在网络社找到对应的分区,再按照发贴时间在双向链表中找到对应贴子位置。In some embodiments, the corresponding network community is found according to the network community ID, the corresponding partition is found in the network community according to the partition ID, and the corresponding post location is found in the doubly linked list according to the posting time.

由于本申请实施例提供的网络社区,贴子采用双向链表方式存储,因此,在查询贴子位置时,可以正序或倒序检索贴子,缩短检索时间,提高贴子修改效率。In the online community provided by the embodiment of the present application, the posts are stored in a doubly linked list, therefore, when querying the location of the posts, the posts can be retrieved in forward or reverse order, which shortens the retrieval time and improves the efficiency of post modification.

步骤902,判断操作类型。Step 902, determine the operation type.

其中,操作类型可以是新增贴子和删除贴子。Wherein, the operation type may be adding a post or deleting a post.

步骤903,在操作类型为新增贴子的情况下,将贴子插入贴子链表中,并修改与其相邻的贴子节点中贴子指针信息。指针信息包括指向前一贴子的指针和指向下一贴子的指针,如图10a所示。Step 903, when the operation type is adding a post, insert the post into the post linked list, and modify the post pointer information in the adjacent post node. The pointer information includes a pointer to the previous post and a pointer to the next post, as shown in Figure 10a.

步骤904,在操作类型为删除贴子的情况下,将贴子从贴子链表中删除,并修改与其相邻的贴子节点中贴子指针信息,如图10b所示。Step 904, if the operation type is to delete a post, delete the post from the post linked list, and modify the post pointer information in the adjacent post node, as shown in Figure 10b.

本实施例提供的网络社区管理方法,社区内各分区采用单向链表方式存储,将每个分区内的各贴子采用双向链表方式存储,以使网络社区具有通用性,在创建或修改分区时,无需开发人员重新设计、开发产品,只需要在分区节点修改分区信息,实现了快速创建和快速应用,从而降低网络社区的管理成本。In the online community management method provided by this embodiment, each partition in the community is stored in a one-way linked list, and each post in each partition is stored in a two-way linked list, so that the online community has versatility. When creating or modifying a partition , no need for developers to redesign and develop products, only need to modify the partition information at the partition node, which realizes rapid creation and rapid application, thereby reducing the management cost of the network community.

根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。According to the embodiments of the present application, the present application also provides an electronic device and a readable storage medium.

如图11所示,是根据本申请实施例的用于网络社区的存储方法和管理方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。As shown in FIG. 11 , it is a block diagram of an electronic device used in a method for storing and managing a network community according to an embodiment of the present application. Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the applications described and/or claimed herein.

如图11所示,该电子设备包括:一个或多个处理器1101、存储器1102,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图11中以一个处理器1101为例。As shown in FIG. 11 , the electronic device includes: one ormore processors 1101 , amemory 1102 , and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be mounted on a common motherboard or otherwise as desired. The processor may process instructions executed within the electronic device, including instructions stored in or on the memory, to display graphical information of a GUI on an external input/output device such as a display device coupled to an interface. In other implementations, multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired. Likewise, multiple electronic devices may be connected, with each device providing some of the necessary operations (eg, as a server array, a set of blade servers, or a multi-processor system). In FIG. 11, aprocessor 1101 is taken as an example.

存储器1102即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的用于网络社区的存储方法和管理方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的用于网络社区的存储方法和管理方法。Thememory 1102 is a non-transitory computer-readable storage medium provided in this application. Wherein, the memory stores instructions executable by at least one processor, so that the at least one processor executes the storage method and management method for network communities provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions, and the computer instructions are used to make a computer execute the storage method and management method for network communities provided by this application.

存储器1102作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的用于网络社区的存储方法和管理方法对应的程序指令/模块。处理器1101通过运行存储在存储器1102中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的用于网络社区的存储方法和管理方法。Thememory 1102, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as the program corresponding to the storage method and management method for the network community in the embodiment of this application directive/module. Theprocessor 1101 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in thememory 1102, that is, realizes the storage method and management method for the network community in the above method embodiments .

存储器1102可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据用于网络社区的存储方法和管理电子设备的使用所创建的数据等。此外,存储器1102可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器1102可选包括相对于处理器1101远程设置的存储器,这些远程存储器可以通过网络连接至用于网络社区的存储方法和管理电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。Thememory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; created data, etc. In addition, thememory 1102 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, thestorage 1102 may optionally include storages that are remotely located relative to theprocessor 1101, and these remote storages may be connected to the storage method and management electronic equipment for the network community through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

用于网络社区的存储方法和管理方法的电子设备还可以包括:输入装置1103和输出装置1104。处理器1101、存储器1102、输入装置1103和输出装置1104可以通过总线或者其他方式连接,图11中以通过总线连接为例。The electronic equipment used for the storage method and management method of the network community may also include: aninput device 1103 and anoutput device 1104 . Theprocessor 1101, thememory 1102, theinput device 1103, and theoutput device 1104 may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 11 .

输入装置1103可接收输入的数字或字符信息,以及产生与用于网络社区的存储方法和管理电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置1104可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。Theinput device 1103 can receive input numbers or character information, and generate key signal inputs related to storage methods for network communities and management of user settings and function controls of electronic equipment, such as touch screens, small keyboards, mice, trackpads, touch Input devices such as pads, pointing sticks, one or more mouse buttons, trackballs, joysticks, etc. Theoutput device 1104 may include a display device, an auxiliary lighting device (eg, LED), a tactile feedback device (eg, a vibration motor), and the like. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.

此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor Can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.

这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computing programs (also referred to as programs, software, software applications, or codes) include machine instructions for a programmable processor and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine language calculation program. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLDs), including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide for interaction with the user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user. ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.

本公开实施例提供一种计算机可读介质,其上存储有计算机程序,程序被处理器执行时实现上述任意一种用于网络社区的存储方法。An embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, any one of the above-mentioned storage methods for a network community is implemented.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present application may be executed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in the present application can be achieved, no limitation is imposed herein.

上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above specific implementation methods are not intended to limit the protection scope of the present application. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.

Claims (13)

CN202011245811.XA2020-11-102020-11-10Storage method and device for network community, electronic equipment and readable mediumActiveCN112422668B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011245811.XACN112422668B (en)2020-11-102020-11-10Storage method and device for network community, electronic equipment and readable medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011245811.XACN112422668B (en)2020-11-102020-11-10Storage method and device for network community, electronic equipment and readable medium

Publications (2)

Publication NumberPublication Date
CN112422668A CN112422668A (en)2021-02-26
CN112422668Btrue CN112422668B (en)2023-04-07

Family

ID=74782245

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011245811.XAActiveCN112422668B (en)2020-11-102020-11-10Storage method and device for network community, electronic equipment and readable medium

Country Status (1)

CountryLink
CN (1)CN112422668B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114020790A (en)*2021-11-082022-02-08中国建设银行股份有限公司 Method and device for querying data

Citations (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
EP1209866A2 (en)*2000-11-222002-05-29Xerox CorporationSystem and method for managing messages
CN1874440A (en)*2005-06-032006-12-06联想(北京)有限公司Method for displaying relevant programs in electric program guide
CN1949220A (en)*2006-10-122007-04-18百度在线网络技术(北京)有限公司Structuring system and method of network community dynamic list
CN101000634A (en)*2007-01-052007-07-18北京握奇数据系统有限公司Method for realizing arbitrary catalog applied management to telecommunication smart card
CN101478652A (en)*2008-12-312009-07-08深圳市同洲电子股份有限公司Searching method, system and digital television receiving terminal for memory data
CN101833576A (en)*2010-04-232010-09-15广州联炬科技企业孵化器有限公司Method for adding web shortcut navigation menu
CN102117278A (en)*2009-12-312011-07-06联想(北京)有限公司Linked list create method and system and data search method and system
CN104572879A (en)*2014-12-192015-04-29乐视网信息技术(北京)股份有限公司Method and device for updating index table and method and device for searching based on index table
CN104750866A (en)*2015-04-172015-07-01上海斐讯数据通信技术有限公司Embedded WEB server based dynamic menu bar generation method and system
CN105260475A (en)*2015-10-302016-01-20努比亚技术有限公司Data searching method, data saving method and related equipment
CN106575427A (en)*2014-08-122017-04-19艾高特有限责任公司 Social network engine based on zero-knowledge environment
CN109271383A (en)*2018-09-052019-01-25广州视源电子科技股份有限公司Dynamic label processing method and device, computer equipment and storage medium
CN110673908A (en)*2019-09-032020-01-10北京量子保科技有限公司Interface generation method, device, medium and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20080005234A1 (en)*2006-06-302008-01-03International Business Machines CorporationProviding Discussion Thread Context for Posts Displayed in a Flat List
US20100217804A1 (en)*2009-02-232010-08-26Oracle International CorporationCollaborative draft forum-messages
US20150120357A1 (en)*2013-10-252015-04-30Kenneth D. TuchmanMethod and system for providing live-connected content
US9721022B2 (en)*2014-08-282017-08-01International Business Machines CorporationSearching and displaying related content to a post in an activity stream

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
EP1209866A2 (en)*2000-11-222002-05-29Xerox CorporationSystem and method for managing messages
CN1874440A (en)*2005-06-032006-12-06联想(北京)有限公司Method for displaying relevant programs in electric program guide
CN1949220A (en)*2006-10-122007-04-18百度在线网络技术(北京)有限公司Structuring system and method of network community dynamic list
CN101000634A (en)*2007-01-052007-07-18北京握奇数据系统有限公司Method for realizing arbitrary catalog applied management to telecommunication smart card
CN101478652A (en)*2008-12-312009-07-08深圳市同洲电子股份有限公司Searching method, system and digital television receiving terminal for memory data
CN102117278A (en)*2009-12-312011-07-06联想(北京)有限公司Linked list create method and system and data search method and system
CN101833576A (en)*2010-04-232010-09-15广州联炬科技企业孵化器有限公司Method for adding web shortcut navigation menu
CN106575427A (en)*2014-08-122017-04-19艾高特有限责任公司 Social network engine based on zero-knowledge environment
CN104572879A (en)*2014-12-192015-04-29乐视网信息技术(北京)股份有限公司Method and device for updating index table and method and device for searching based on index table
CN104750866A (en)*2015-04-172015-07-01上海斐讯数据通信技术有限公司Embedded WEB server based dynamic menu bar generation method and system
CN105260475A (en)*2015-10-302016-01-20努比亚技术有限公司Data searching method, data saving method and related equipment
CN109271383A (en)*2018-09-052019-01-25广州视源电子科技股份有限公司Dynamic label processing method and device, computer equipment and storage medium
CN110673908A (en)*2019-09-032020-01-10北京量子保科技有限公司Interface generation method, device, medium and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Discuz系列应用教程:[5]如何创建论坛版块;zhulinluo;《https://jingyan.baidu.com/article/7082dc1c4ca612e40a89bd08.html》;20140712;全文*
hehehe.如何在后台要动态添加tab标签页的格式以及每个页面列表格式,前端应该如何请求.《http://segmentfault.com/q/1010000008262893》.2017,*
如何在后台要动态添加tab标签页的格式以及每个页面列表格式,前端应该如何请求;hehehe;《http://segmentfault.com/q/1010000008262893》;20170206;全文*

Also Published As

Publication numberPublication date
CN112422668A (en)2021-02-26

Similar Documents

PublicationPublication DateTitle
CN112099790B (en) Methods, devices, equipment and storage media for determining page themes
CN112269789B (en)Method and device for storing data, and method and device for reading data
CN108228817B (en)Data processing method, device and system
CN111241108B (en)Key value based indexing method and device for KV system, electronic equipment and medium
CN111831752B (en) Distributed database space arrangement method, device, equipment and storage medium
CN112380184A (en)Transaction processing method and device, electronic equipment and readable storage medium
CN112115113A (en) Data storage system, method, apparatus, device, and storage medium
CN111274274A (en)Rule matching method and device, electronic equipment and storage medium
CN108108392B (en) Commodity data management method, device, computer equipment and storage medium
CN111698326A (en)Method and apparatus for determining cost attribution of cloud service resources
CN111767321A (en) Method, device, electronic device and storage medium for determining node relationship network
CN112115313A (en) Regular expression generation, data extraction method, apparatus, equipment and medium
CN112559913B (en)Data processing method, device, computing equipment and readable storage medium
CN110147350A (en)File search method, device, electronic equipment and storage medium
CN111752960B (en)Data processing method and device
CN110633281A (en) Method and device for processing multi-type data sources
CN111523000B (en)Method, apparatus, device and storage medium for importing data
CN115222176A (en) Risk control methods, devices, equipment and media
CN111291082B (en)Data aggregation processing method, device, equipment and storage medium
CN112422668B (en)Storage method and device for network community, electronic equipment and readable medium
CN112084204A (en)Browsing data processing method, device, terminal and storage medium
CN113590543A (en)Method, apparatus and computer program product for information processing
CN111290714B (en)Data reading method and device
CN111782834A (en) Image retrieval method, apparatus, device, and computer-readable storage medium
CN111459887A (en)Resource screening method and device, electronic equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp