CN108920618A - Method, device, medium and electronic equipment for storing object calling relationship - Google Patents

Method, device, medium and electronic equipment for storing object calling relationship Download PDF

Info

Publication number
CN108920618A
CN108920618A CN201810690163.5A CN201810690163A CN108920618A CN 108920618 A CN108920618 A CN 108920618A CN 201810690163 A CN201810690163 A CN 201810690163A CN 108920618 A CN108920618 A CN 108920618A
Authority
CN
China
Prior art keywords
node
identification information
call relationship
relationship
child
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810690163.5A
Other languages
Chinese (zh)
Inventor
张�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201810690163.5A priority Critical patent/CN108920618A/en
Publication of CN108920618A publication Critical patent/CN108920618A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method for storing an object call relation, which comprises the following steps: mapping the object in the acquired object calling relation with the node in the tree structure data model; generating identification information corresponding to an object in an object calling relation at a current node in a tree structure data model, and acquiring identification information of a child node and/or identification information of a father node of the current node; and creating a corresponding key value based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the father node, and saving the object calling relationship based on the key value. The technical scheme of the embodiment of the invention meets the high concurrency requirement of the system, reduces the configuration difficulty and the maintenance cost, and realizes the convenient addition of the call relation to the production system which is put into use.

Description

一种对象调用关系的保存方法、装置、介质及电子设备Method, device, medium and electronic equipment for storing object calling relationship

技术领域technical field

本发明涉及计算机技术领域,具体而言,涉及一种对象调用关系的保存方法、装置、介质及电子设备。The present invention relates to the field of computer technology, in particular to a method, device, medium and electronic equipment for storing object calling relationships.

背景技术Background technique

微信是智能终端提供即时通讯服务的免费应用程序。微信支持跨通信运营商、跨操作系统平台通过网络快速发送免费语音短信、视频、图片和文字,同时,也可以使用通过共享流媒体内容的资料和基于位置的社交插件“摇一摇”、“漂流瓶”、“朋友圈”、”公众平台“、”语音记事本“等服务插件。WeChat is a free application for smart terminals to provide instant messaging services. WeChat supports cross-communication operators and cross-operating system platforms to quickly send free voice messages, videos, pictures and texts through the network. "Drifting Bottle", "Moments", "Public Platform", "Voice Notepad" and other service plug-ins.

微信提供公众平台、朋友圈、消息推送等功能,用户可以通过“摇一摇”、“搜索号码”、“附近的人”、扫二维码方式添加好友和关注公众平台,同时微信将内容分享给好友以及将用户看到的精彩内容分享到微信朋友圈。WeChat provides public platform, circle of friends, message push and other functions. Users can add friends and follow the public platform through "shake", "search number", "nearby people" and scan the QR code. At the same time, WeChat will share the content To friends and share the exciting content that users see to WeChat circle of friends.

目前,市场上还没有相关方案可以存储微信中用户之间复杂的调用关系。At present, there is no relevant solution on the market that can store complex calling relationships between users in WeChat.

需要说明的是,在上述背景技术部分公开的信息仅用于加强对本发明的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those of ordinary skill in the art.

发明内容Contents of the invention

本发明实施例的目的在于提供一种对象调用关系的保存方法、装置、介质及电子设备,进而至少在一定程度上克服相关技术中的问题。The purpose of the embodiments of the present invention is to provide a method, device, medium and electronic device for storing object call relations, and then overcome the problems in the related art at least to a certain extent.

本发明的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本发明的实践而习得。Other features and advantages of the invention will become apparent from the following detailed description, or in part, be learned by practice of the invention.

根据本发明实施例的第一方面,提供了一种对象调用关系的保存方法,其特征在于,包括:According to the first aspect of the embodiments of the present invention, there is provided a method for saving an object call relationship, which is characterized in that it includes:

将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;Map the objects in the obtained object call relationship with the nodes in the tree structure data model;

在树结构数据模型中的当前节点生成对应于对象调用关系中对象的识别信息,并获取当前节点的子节点的识别信息和/或父节点的识别信息;The current node in the tree structure data model generates identification information corresponding to the object in the object call relationship, and obtains the identification information of the child node and/or the identification information of the parent node of the current node;

基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存。A corresponding key value is created based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the parent node, and the object call relationship is saved based on the key value.

在本发明的一个实施例中,基于前述方案,上述将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射,包括:In one embodiment of the present invention, based on the aforementioned solution, the above-mentioned mapping of the objects in the obtained object call relationship with the nodes in the tree structure data model includes:

根据对象调用关系建立树状网络,其中,树状网络是对象之间的关系网络,由对象和对象调用关系构成;Establish a tree-like network according to the object calling relationship, wherein the tree-like network is a relationship network between objects, which is composed of objects and object calling relationships;

将树状网络中的对象确定为树结构数据模型中的节点;Determining the objects in the tree network as nodes in the tree structure data model;

将树状网络中的对象调用关系确定为树结构数据模型中节点之间的指向关系。The object calling relationship in the tree network is determined as the pointing relationship between nodes in the tree structure data model.

在本发明的一个实施例中,基于前述方案,上述根据对象调用关系建立树状网络,包括:In one embodiment of the present invention, based on the foregoing solution, the above-mentioned establishment of a tree network according to the object call relationship includes:

如果对象调用关系中的第一对象调用了第二对象,生成第一对象指向第二对象的连接线,通过带有指向的连接线表征对象调用关系,以建立对象调用关系中各对象之间调用关系的树状网络。If the first object in the object call relationship calls the second object, generate a connection line from the first object pointing to the second object, and use the pointed connection line to represent the object call relationship, so as to establish the call between objects in the object call relationship A tree-like network of relationships.

在本发明的一个实施例中,基于前述方案,上述在树结构数据模型中的节点生成对应于对象调用关系中对象的识别信息,包括:In one embodiment of the present invention, based on the foregoing solution, the above-mentioned nodes in the tree-structured data model generate identification information corresponding to the object in the object call relationship, including:

基于对象调用关系中对象映射于树结构数据模型中节点的顺序,生成对应于对象的识别信息。Identification information corresponding to the object is generated based on the order in which the object in the object call relationship is mapped to the node in the tree structure data model.

在本发明的一个实施例中,基于前述方案,上述方法还包括:In one embodiment of the present invention, based on the foregoing solution, the above method further includes:

将树结构数据模型中节点的名称替换为映射后对应的对象调用关系中对象的名称。。Replace the name of the node in the tree structure data model with the name of the object in the corresponding object call relationship after mapping. .

在本发明的一个实施例中,基于前述方案,上述基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存,包括:In one embodiment of the present invention, based on the foregoing solution, the above-mentioned identification information based on the node and the obtained identification information of the child node and/or the identification information of the parent node create a corresponding key value, and the object call relationship is realized based on the key value. Save, including:

获取节点的名称信息;Obtain the name information of the node;

将节点的名称与节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值。A key value corresponding to the name of the node, the identification information of the node, and the acquired identification information of the child node and/or the identification information of the parent node is created.

在本发明的一个实施例中,基于前述方案,上述在树结构数据模型中的节点生成对应于对象调用关系中对象的识别信息,并获取节点子节点的识别信息和/或父节点的识别信息,包括:In one embodiment of the present invention, based on the foregoing solution, the above-mentioned nodes in the tree structure data model generate identification information corresponding to the object in the object call relationship, and obtain the identification information of the node's child nodes and/or the identification information of the parent node ,include:

判断当前节点是否有父节点和子节点;Determine whether the current node has a parent node and a child node;

如当前节点只有父节点,则获取父节点的识别信息以及父节点的调用关系信息,基于当前节点的识别信息、父节点的识别信息以及父节点的调用关系信息,创建键值保存当前节点的调用关系;If the current node has only a parent node, then obtain the identification information of the parent node and the call relationship information of the parent node, and create a key value to save the call of the current node based on the identification information of the current node, the identification information of the parent node, and the call relationship information of the parent node relation;

如当前节点只有子节点,则获取子节点的识别信息以及子节点的调用关系信息,基于当前节点的识别信息、子节点的识别信息以及子节点的调用关系信息,创建键值保存当前节点的调用关系;If the current node has only child nodes, then obtain the identification information of the child node and the call relationship information of the child node, based on the identification information of the current node, the identification information of the child node and the call relationship information of the child node, create a key value to save the call of the current node relation;

如当前节点有父节点和子节点,则获取父节点的识别信息、父节点的调用关系信息、子节点的识别信息、子节点的调用关系信息,基于当前节点的识别信息、父节点的识别信息、父节点的调用关系信息、子节点的识别信息、子节点的调用关系信息,创建键值保存当前节点的调用关系。If the current node has a parent node and a child node, the identification information of the parent node, the call relationship information of the parent node, the identification information of the child node, and the call relationship information of the child node are obtained, based on the identification information of the current node, the identification information of the parent node, The calling relationship information of the parent node, the identification information of the child node, the calling relationship information of the child node, and create a key value to save the calling relationship of the current node.

根据本发明实施例的第二方面,提供了一种节点管理器,包括:导入模块、生成模块、创建模块;其中,According to the second aspect of the embodiments of the present invention, a node manager is provided, including: an import module, a generation module, and a creation module; wherein,

导入模块,将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;Import the module, and map the objects in the obtained object call relationship with the nodes in the tree structure data model;

生成模块,用于在树结构数据模型中的当前节点生成对应于对象调用关系中对象的识别信息,并获取当前节点的子节点的识别信息和/或父节点的识别信息;A generation module, used to generate identification information corresponding to the object in the object call relationship at the current node in the tree structure data model, and obtain the identification information of the child node and/or the identification information of the parent node of the current node;

创建模块,用于基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存。The creation module is configured to create a corresponding key value based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the parent node, and realize the preservation of the object call relationship based on the key value.

根据本发明实施例的第三方面,提供了一种计算机可读介质,其上存储有计算机程序,程序被处理器执行时实现如上述实施例中第一方面的对象调用关系的保存方法。According to a third aspect of the embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method for saving object call relationships as in the first aspect of the above-mentioned embodiments is implemented.

根据本发明实施例的第四方面,提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现如上述实施例中第一方面的对象调用关系的保存方法。According to a fourth aspect of the embodiments of the present invention, there is provided an electronic device, including: one or more processors; a storage device for storing one or more programs, when one or more programs are processed by one or more When the processor is executed, one or more processors are made to implement the method for saving the object call relationship as described in the first aspect of the above-mentioned embodiment.

本发明实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

本发明实施例提供了一种对象调用关系的保存方法,该对象调用关系的保存方法包括:将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;在树结构数据模型中的当前节点生成对应于对象调用关系中对象的识别信息,并获取当前节点的子节点的识别信息和/或父节点的识别信息;基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存。本发明实施例的技术方案满足了系统的高并发需求,降低了配置难度和维护成本,并且对于已投入使用的生产系统,实现了便捷地添加调用关系An embodiment of the present invention provides a method for saving an object call relationship, and the method for saving the object call relationship includes: mapping the obtained object in the object call relationship with the node in the tree structure data model; The current node in generates the identification information corresponding to the object in the object call relationship, and obtains the identification information of the child node and/or the identification information of the parent node of the current node; based on the identification information of the node and the identification information of the obtained child node and /or the identification information of the parent node creates a corresponding key value, and realizes the preservation of the object call relationship based on the key value. The technical solution of the embodiment of the present invention satisfies the high concurrency requirements of the system, reduces configuration difficulty and maintenance cost, and realizes the convenient addition of call relations for the production system that has been put into use

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention. Apparently, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings according to these drawings without creative efforts. In the attached picture:

图1示意性示出了根据本发明的一个实施例的对象调用关系的保存方法的流程图。Fig. 1 schematically shows a flowchart of a method for saving an object call relationship according to an embodiment of the present invention.

图2示意性示出了根据本发明的一个实施例的保存对象调用关系的流程图。Fig. 2 schematically shows a flow chart of saving object call relationships according to an embodiment of the present invention.

图3示意性示出了根据本发明的一个实施例微信用户之间调用关系的保存方法的示意图。Fig. 3 schematically shows a schematic diagram of a method for saving calling relationships between WeChat users according to an embodiment of the present invention.

图4示意性示出了根据本发明的一个实施例的对象调用关系的保存装置的框图。Fig. 4 schematically shows a block diagram of an apparatus for storing object call relationships according to an embodiment of the present invention.

图5示出了适于用来实现本发明实施例的电子设备的计算机系统的结构示意图。FIG. 5 shows a schematic structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present invention.

具体实施方式Detailed ways

现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本发明将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and fully convey the concept of example embodiments to those skilled in the art.

此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本发明的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本发明的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本发明的各方面。Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of embodiments of the invention. However, those skilled in the art will appreciate that the technical solutions of the present invention may be practiced without one or more of the specific details, or other methods, components, means, steps, etc. may be employed. In other instances, well-known methods, apparatus, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the invention.

附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices entity.

附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flow charts shown in the drawings are only exemplary illustrations, and do not necessarily include all contents and operations/steps, nor must they be performed in the order described. For example, some operations/steps can be decomposed, and some operations/steps can be combined or partly combined, so the actual order of execution may be changed according to the actual situation.

图1示意性示出了根据本发明的一个实施例的对象调用关系的保存方法的流程图。Fig. 1 schematically shows a flowchart of a method for saving an object call relationship according to an embodiment of the present invention.

参照图1所示,根据本发明的一个实施例的对象调用关系的保存方法,包括如下步骤:With reference to shown in Figure 1, according to an embodiment of the present invention, the preservation method of object call relationship comprises the following steps:

步骤S110,将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射。Step S110, mapping the acquired objects in the object call relationship with the nodes in the tree structure data model.

在本发明的一个实施例中,对象调用关系可以是微信中用户之间的调用关系,例如:微信用户A群转发给微信用户B、D,通过朋友圈转发给C,微信群用户D通过群转发给微信用户H。In one embodiment of the present invention, the object call relationship can be the call relationship between users in WeChat, for example: WeChat user A group forwards to WeChat users B and D, and forwards to C through Moments, and WeChat group user D passes group Forward to WeChat user H.

在本发明的一个实施例中,由于微信中用户之间的调用关系或转发关系与多叉树的结构类似,因此,树结构数据模型可以是像树一样层级组织的、存在递归关系的数据,在这样的结构中,每一个实例称为节点,每个节点有多个子节点和一个父节点,最上层的节点称为根节点,它没有父节点,最底层的节点称为叶节点,它没有子节点,所有的中间节点称为非叶节点。In one embodiment of the present invention, since the calling relationship or forwarding relationship between users in WeChat is similar to the structure of a multi-fork tree, the tree-structured data model can be hierarchically organized like a tree, and there is a recursive relationship. In such a structure, each instance is called a node, each node has multiple child nodes and a parent node, the top node is called the root node, it has no parent node, and the bottom node is called a leaf node, it has no Child nodes, all intermediate nodes are called non-leaf nodes.

在本发明的一个实施例中,基于前述方案,根据对象调用关系建立树状网络,其中,树状网络是对象之间的关系网络,由对象和对象调用关系构成;将树状网络中的对象确定为树结构数据模型中的节点;将树状网络中的对象调用关系确定为树结构数据模型中节点之间的指向关系。In one embodiment of the present invention, based on the aforementioned solution, a tree network is established according to the object call relationship, wherein the tree network is a relationship network between objects, which is composed of objects and object call relationships; the objects in the tree network It is determined as a node in the tree structure data model; the object call relationship in the tree structure network is determined as a pointing relationship between nodes in the tree structure data model.

在本发明的一个实施例中,基于前述方案,如果对象调用关系中的第一对象调用了第二对象,生成第一对象指向第二对象的连接线,通过带有指向的连接线表征对象调用关系,以建立对象调用关系中各对象之间调用关系的树状网络,以此类推,建立出对象调用关系中各对象之间调用关系的树状网络。In one embodiment of the present invention, based on the aforementioned solution, if the first object in the object call relationship calls the second object, a connection line from the first object to the second object is generated, and the object call is represented by the connection line with the point relationship, to establish a tree-like network of the calling relationship between objects in the object calling relationship, and so on, to establish a tree-like network of calling relationships between objects in the object calling relationship.

在本发明的一个实施例中,基于前述方案,将树结构数据模型中节点的名称替换为映射后对应的对象调用关系中对象的名称In one embodiment of the present invention, based on the aforementioned solution, the name of the node in the tree structure data model is replaced with the name of the object in the corresponding object call relationship after mapping

在本发明的一个实施例中,基于前述方案,获取节点的名称;将节点的名称与节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值。In one embodiment of the present invention, based on the foregoing solution, the name of the node is obtained; and a key value is created corresponding to the name of the node, the identification information of the node, and the obtained identification information of the child node and/or the identification information of the parent node.

步骤S120,在树结构数据模型中的当前节点生成对应于对象调用关系中对象的识别信息,并获取当前节点的子节点的识别信息和/或父节点的识别信息。Step S120, the current node in the tree structure data model generates identification information corresponding to the object in the object call relationship, and obtains the identification information of the child node and/or the identification information of the parent node of the current node.

在本发明的一个实施例中,基于对象调用关系中对象导入树结构数据模型中节点的导入顺序,生成对应于对象的识别信息。In one embodiment of the present invention, identification information corresponding to the object is generated based on the import sequence of the nodes in the object import tree structure data model in the object call relationship.

在本发明的一个实施例中,基于前述方案,在节点可以保存一个识别信息,该识别信息可以在Redis中创建对应的键值(Key-Value)保存节点之间的调用关系。In an embodiment of the present invention, based on the foregoing solution, an identification information can be stored in the node, and the identification information can create a corresponding key-value (Key-Value) in Redis to store the calling relationship between the nodes.

步骤S130,基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存。In step S130, a corresponding key value is created based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the parent node, and the storage of the object call relationship is realized based on the key value.

在本发明的一个实施例中,可以获取节点的名称;将所述节点的名称与所述节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值。In one embodiment of the present invention, the name of the node can be obtained; the name of the node and the identification information of the node and the obtained identification information of the child node and/or the identification information of the parent node can be used to create a corresponding key value .

在本发明的一个实施例中,创建对应于识别信息的键值实现对象调用关系的保存可以通过键值(Key-Value)存储数据库实现,例如:Aerospike、LevelDB、Scalaris、ProjectVoldemort、HyperDex、Berkeley DB、Apache Accumulo、Redis、Apache Cassandra等非关系型数据库,该数据库是一种NoSQL(非关系型数据库)模型,其数据按照键值对的形式进行组织、索引和存储。键值存储非常适合不涉及过多数据关系、业务关系的业务数据,例如:本发明的实施例中所提出的微信中用户之间的调用关系,同时能有效减少读写磁盘的次数,比SQL数据库存储拥有更好的读写性能。In one embodiment of the present invention, creating the key value corresponding to the identification information to realize the preservation of the object call relationship can be realized by a key-value (Key-Value) storage database, for example: Aerospike, LevelDB, Scalaris, ProjectVoldemort, HyperDex, Berkeley DB , Apache Accumulo, Redis, Apache Cassandra and other non-relational databases. This database is a NoSQL (non-relational database) model, and its data is organized, indexed and stored in the form of key-value pairs. Key-value storage is very suitable for business data that does not involve too many data relationships and business relationships, such as: the call relationship between users in WeChat proposed in the embodiment of the present invention, and can effectively reduce the number of times to read and write disks, compared with SQL Database storage has better read and write performance.

在本发明的一个实施例中,如图2所示,保存对象调用关系可以包括以下步骤:In one embodiment of the present invention, as shown in Figure 2, saving the object call relationship may include the following steps:

步骤S210:判断当前节点是否有父节点和子节点;如只有父节点执行步骤S220;如只有子节点,执行步骤S230;如同时有父节点和子节点,执行步骤S240。Step S210: Determine whether the current node has a parent node and a child node; if there is only a parent node, perform step S220; if there is only a child node, perform step S230; if there are both parent nodes and child nodes, perform step S240.

步骤S230:基于父节点的识别信息和调用关系,保存当前节点的调用关系。Step S230: Based on the identification information of the parent node and the calling relationship, save the calling relationship of the current node.

在本发明的一个实施例中,如当前节点只有父节点,则获取父节点的识别信息以及父节点的调用关系信息,基于当前节点的识别信息、父节点的识别信息以及父节点的调用关系信息,创建键值保存当前节点的调用关系;In one embodiment of the present invention, if the current node only has a parent node, the identification information of the parent node and the call relationship information of the parent node are obtained, based on the identification information of the current node, the identification information of the parent node and the call relationship information of the parent node , create a key value to save the calling relationship of the current node;

步骤S240:基于子节点的识别信息和调用关系,保存当前节点的调用关系。Step S240: Based on the identification information of the child node and the calling relationship, save the calling relationship of the current node.

在本发明的一个实施例中,如当前节点只有子节点,则获取子节点的识别信息以及子节点的调用关系信息,基于当前节点的识别信息、子节点的识别信息以及子节点的调用关系信息,创建键值保存当前节点的调用关系;In one embodiment of the present invention, if the current node has only child nodes, the identification information of the child node and the call relationship information of the child node are obtained, based on the identification information of the current node, the identification information of the child node and the call relationship information of the child node , create a key value to save the calling relationship of the current node;

步骤S240:基于父节点的识别信息和调用关系和子节点的识别信息和调用关系,保存当前节点的调用关系。在本发明的一个实施例中,如当前节点有父节点和子节点,则获取父节点的识别信息、父节点的调用关系信息、子节点的识别信息、子节点的调用关系信息,基于当前节点的识别信息、父节点的识别信息、父节点的调用关系信息、子节点的识别信息、子节点的调用关系信息,创建键值保存当前节点的调用关系。Step S240: Based on the identification information and calling relationship of the parent node and the identification information and calling relationship of the child node, save the calling relationship of the current node. In one embodiment of the present invention, if the current node has a parent node and a child node, the identification information of the parent node, the call relationship information of the parent node, the identification information of the child node, and the call relationship information of the child node are obtained, based on the current node Identification information, identification information of the parent node, call relationship information of the parent node, identification information of the child node, call relationship information of the child node, create a key value to save the call relationship of the current node.

在本发明的一个实施例中,应用于微信内的调用关系,当微信账号A把泰康活动链接转发给微信账号B后,微信账号B通过朋友圈或者微信好友点开链接,异步调用保存链接的接口,通过该接口保存调用链路信息。In one embodiment of the present invention, it is applied to the call relationship in WeChat. When WeChat account A forwards the Taikang activity link to WeChat account B, WeChat account B clicks on the link through the circle of friends or WeChat friends, and asynchronously calls the method of saving the link. Interface, through which the calling link information is saved.

下面以微信中用户之间的调用关系为例,对本发明本实施例的对象调用关系的保存方法进行详细说明。Taking the calling relationship between users in WeChat as an example, the method for saving the object calling relationship in this embodiment of the present invention will be described in detail below.

图3示意性示出了根据本发明的一个实施例微信用户之间调用关系的保存方法的示意图。Fig. 3 schematically shows a schematic diagram of a method for saving calling relationships between WeChat users according to an embodiment of the present invention.

参照图3所示,根据本发明的一个实施例微信用户之间调用关系的保存方法,包括:A节点310、B节点320、C节点330、D节点340、H节点350;其中,微信用户A对应于A节点310,微信用户B对应于B节点320,微信用户C对应于C节点330,微信用户D对应于D节点340,微信用户H对应于节点H350,具体的,微信用户A在微信内分别通过朋友圈、微信群发布了链接,微信用户A与微信用户B之间的关系为:微信用户B通过微信群调用微信用户A,以此类推,可以获得微信用户A与微信用户C、微信用户D、微信用户H之间的调用关系:微信用户A群转发给微信用户B、D,朋友圈转发给C,微信用户D群转发给微信用户H,其中,将所获取的调用关系向树结构数据模型导入,A节点相对于B节点、C节点、D节点为父节点,B节点、C节点、D节点为A节点的子节点,D节点相对于H节点为父节点,H节点相对于D节点是子节点。With reference to shown in Figure 3, according to an embodiment of the present invention, the preservation method of call relationship between WeChat users includes: A node 310, B node 320, C node 330, D node 340, H node 350; wherein, WeChat user A Corresponding to node A 310, WeChat user B corresponds to node B 320, WeChat user C corresponds to node C 330, WeChat user D corresponds to node D 340, WeChat user H corresponds to node H350, specifically, WeChat user A is in WeChat Links are published through Moments of Friends and WeChat groups respectively. The relationship between WeChat user A and WeChat user B is as follows: WeChat user B calls WeChat user A through the WeChat group, and so on. We can get WeChat user A and WeChat user C, WeChat The calling relationship between user D and WeChat user H: WeChat user A group forwards to WeChat users B and D, Moments forwards to C, WeChat user D group forwards to WeChat user H, wherein the obtained calling relationship is forwarded to the tree Structural data model import, node A is the parent node relative to node B, node C, and node D, node B, node C, and node D are child nodes of node A, node D is the parent node relative to node H, and node H is relative to D nodes are child nodes.

在本发明的一个实施例中,基于上述所确定出的微信用户之间链接的调用关系,分别在节点生成识别信息,例如:A节点是发送链接的父节点,识别信息为:/A;B节点通过微信群调用了A节点的链接,识别信息为:/A/B_WXQ,该识别信息标识出了B节点通过微信群(WXQ)调用A节点发布的链接,以此类推,C节点识别信息为:/A/C_PYQ,该识别信息标识出了C节点通过朋友圈(PYQ)调用A节点发布的链接,D节点识别信息为:/A/D_WXQ,该识别信息标识出了D节点通过微信群(WXQ)调用A节点发布的链接,H节点识别信息为:/A/D_WXQ/H_WXQ,该识别信息标识出了H节点通过微信群(WXQ)调用D节点发布的链接。In one embodiment of the present invention, based on the invocation relationship of links between WeChat users determined above, identification information is generated at the nodes respectively, for example: node A is the parent node that sends the link, and the identification information is: /A; B The node calls the link of node A through the WeChat group, and the identification information is: /A/B_WXQ, which identifies the link published by node B through the WeChat group (WXQ) calling node A, and so on, and the identification information of node C is :/A/C_PYQ, the identification information identifies the link published by node C through Moments (PYQ), and the identification information of node D is: /A/D_WXQ, the identification information identifies node D through the WeChat group ( WXQ) calls the link issued by node A, and the identification information of node H is: /A/D_WXQ/H_WXQ, which identifies the link issued by node H through the WeChat group (WXQ) calling node D.

上述识别信息可以在Redis中创建相应的KEY值保存相关的调用信息,如此,可以在Zookeeper和Redis中保存整个转发关系图。The above identification information can create corresponding KEY values in Redis to save related call information, so that the entire forwarding relationship graph can be saved in Zookeeper and Redis.

在本发明的一个实施例中,基于Zookeeper和Redis联合保存各节点的调用关系时至少需要3个参数入参:父节点的识别信息;当前节点的识别信息;节点名称。In one embodiment of the present invention, at least three parameters are required to enter the calling relationship of each node based on Zookeeper and Redis: the identification information of the parent node; the identification information of the current node; and the node name.

在本发明的一个实施例中,通过Zookeeper在Redis中保存各节点识别信息如下:In one embodiment of the present invention, save each node identification information in Redis by Zookeeper as follows:

首先,判断在Redis中是否已保存有当前节点的识别信息;First, determine whether the identification information of the current node has been saved in Redis;

在实际应用中,节点之间的调用关系复杂且庞大,因此,在保存节点识别信息时需要判断在Redis中是否已保存有当前节点的识别信息,以避免重复保存节点信息操作造成的系统不稳定的问题;In practical applications, the call relationship between nodes is complex and huge. Therefore, when saving node identification information, it is necessary to judge whether the current node identification information has been saved in Redis, so as to avoid system instability caused by repeated operations of saving node information. The problem;

如判断Redis中已保存有当前节点识别信息时,结束当前节点识别信息保存流程,If it is judged that the current node identification information has been saved in Redis, the process of saving the current node identification information is ended.

如判断Redis中没有保存有当前节点识别信息时,则获取当前节点的父节点在Redis中保存的链路信息,将当前节点的识别信息以及其父节点的链路信息创建对应的键值在Redis中保存。If it is judged that the current node identification information is not stored in Redis, then obtain the link information stored in Redis by the parent node of the current node, and create a corresponding key value for the identification information of the current node and the link information of its parent node in Redis save in .

其次,判断在Zookeeper中是否保存有当前节点的父节点的识别信息;Secondly, it is judged whether the identification information of the parent node of the current node is stored in Zookeeper;

如判断没有保存父节点识别信息,确定当前节点没有父节点,则获取当前节点的子节点的识别信息,将当前节点的识别信息以及其子节点的识别信息创建对应的键值在Redis中保存;If it is judged that the identification information of the parent node is not saved, and it is determined that the current node does not have a parent node, then the identification information of the child nodes of the current node is obtained, and the identification information of the current node and the identification information of its child nodes are created to correspond to key values and saved in Redis;

如判断保存有父节点识别信息,确定当前节点有父节点和子节点,直接获取父节点识别信息和子节点识别信息创建对应的键值在Redis中保存。If it is judged that the parent node identification information is saved, it is determined that the current node has a parent node and a child node, and the parent node identification information and child node identification information are directly obtained to create the corresponding key value and save it in Redis.

最后,判断当前节点的子节点链路信息有没有保存当前节点的识别信息;Finally, it is judged whether the child node link information of the current node has saved the identification information of the current node;

如子节点链路信息中保存有当前节点的识别信息,则直接结束保存当前节点识别信息流程;If the identification information of the current node is saved in the link information of the child node, the process of saving the identification information of the current node is directly ended;

如子节点链路信息中没有保存当前节点的识别信息,则在Redis中保存当前节点的识别信息。If the identification information of the current node is not saved in the link information of the child node, the identification information of the current node is saved in Redis.

以下介绍本发明的装置实施例,可以用于执行本发明上述的对象调用关系的保存方法。The device embodiments of the present invention are introduced below, which can be used to implement the method for saving the object call relationship mentioned above in the present invention.

图4示意性示出了根据本发明的一个实施例对象调用关系的保存装置的框图。Fig. 4 schematically shows a block diagram of an apparatus for storing object call relationships according to an embodiment of the present invention.

参照图4所示,根据本发明的一个实施例的对象调用关系的保存装置400,包括:导入模块402、生成模块404、创建模块406;其中,Referring to FIG. 4 , according to an embodiment of the present invention, an apparatus 400 for storing object call relations includes: an import module 402, a generation module 404, and a creation module 406; wherein,

导入模块402,用于将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;The import module 402 is used to map the objects in the obtained object call relationship with the nodes in the tree structure data model;

生成模块404,用于在树结构数据模型中的当前节点生成对应于对象调用关系中对象的识别信息,并获取当前节点的子节点的识别信息和/或父节点的识别信息;The generation module 404 is used to generate the identification information corresponding to the object in the object call relationship at the current node in the tree structure data model, and obtain the identification information of the child node and/or the identification information of the parent node of the current node;

创建模块406,用于基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存。The creation module 406 is configured to create a corresponding key value based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the parent node, and realize the preservation of the object call relationship based on the key value.

在本发明的一个实施例中,基于前述方案,导入模块402具体用于,根据对象调用关系建立树状网络,其中,树状网络是对象之间的关系网络,由对象和对象调用关系构成;将树状网络中的对象确定为树结构数据模型中的节点;将树状网络中的对象调用关系确定为树结构数据模型中节点之间的指向关系。In one embodiment of the present invention, based on the foregoing solution, the import module 402 is specifically configured to establish a tree network according to the object calling relationship, wherein the tree network is a relationship network between objects, and is composed of objects and object calling relationships; Determine the objects in the tree-like network as nodes in the tree-structure data model; determine the object calling relationship in the tree-like network as the pointing relationship between nodes in the tree-structure data model.

在本发明的一个实施例中,基于前述方案,导入模块402还用于,如果对象调用关系中的第一对象调用了第二对象,生成第一对象指向第二对象的连接线,通过带有指向的连接线表征对象调用关系,以建立对象调用关系中各对象之间调用关系的树状网络。In one embodiment of the present invention, based on the foregoing solution, the import module 402 is also used to generate a connection line from the first object to the second object if the first object in the object call relationship calls the second object, and the connection line with The connecting lines pointing to represent object call relationships, so as to establish a tree network of call relationships among objects in the object call relationships.

在本发明的一个实施例中,基于前述方案,生成模块404具体用于,基于所述对象调用关系中对象映射于所述树结构数据模型中节点的顺序,生成对应于对象的识别信息。In one embodiment of the present invention, based on the foregoing solution, the generation module 404 is specifically configured to generate identification information corresponding to the object based on the order in which the objects in the object call relationship are mapped to the nodes in the tree structure data model.

在本发明的一个实施例中,基于前述方案,导入模块402还用于,将所述树结构数据模型中节点的名称替换为所述映射后对应的所述对象调用关系中对象的名称。In an embodiment of the present invention, based on the foregoing solution, the import module 402 is further configured to replace the name of the node in the tree structure data model with the name of the object in the corresponding object call relationship after the mapping.

在本发明的一个实施例中,基于前述方案,创建模块406具体用于,获取节点的名称;将所述节点的名称与所述节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值。In one embodiment of the present invention, based on the foregoing solution, the creating module 406 is specifically configured to obtain the name of the node; combine the name of the node with the identification information of the node and the obtained identification information of the child nodes and/or The identification information of the parent node creates a corresponding key value.

在本发明的一个实施例中,基于前述方案,创建模块406还具体用于:In one embodiment of the present invention, based on the foregoing solution, the creating module 406 is further specifically used for:

判断当前节点是否有父节点和子节点;Determine whether the current node has a parent node and a child node;

如当前节点只有父节点,则获取父节点的识别信息以及父节点的调用关系信息,基于当前节点的识别信息、父节点的识别信息以及父节点的调用关系信息,创建键值保存当前节点的调用关系;If the current node has only a parent node, then obtain the identification information of the parent node and the call relationship information of the parent node, and create a key value to save the call of the current node based on the identification information of the current node, the identification information of the parent node, and the call relationship information of the parent node relation;

如当前节点只有子节点,则获取子节点的识别信息以及子节点的调用关系信息,基于当前节点的识别信息、子节点的识别信息以及子节点的调用关系信息,创建键值保存当前节点的调用关系;If the current node has only child nodes, then obtain the identification information of the child node and the call relationship information of the child node, based on the identification information of the current node, the identification information of the child node and the call relationship information of the child node, create a key value to save the call of the current node relation;

如当前节点有父节点和子节点,则获取父节点的识别信息、父节点的调用关系信息、子节点的识别信息、子节点的调用关系信息,基于当前节点的识别信息、父节点的识别信息、父节点的调用关系信息、子节点的识别信息、子节点的调用关系信息,创建键值保存当前节点的调用关系。If the current node has a parent node and a child node, the identification information of the parent node, the call relationship information of the parent node, the identification information of the child node, and the call relationship information of the child node are obtained, based on the identification information of the current node, the identification information of the parent node, The calling relationship information of the parent node, the identification information of the child node, the calling relationship information of the child node, and create a key value to save the calling relationship of the current node.

由于本发明的示例实施例的对象调用关系的保存装置的各个功能模块与上述对象调用关系的保存方法的示例实施例的步骤对应,因此对于本发明装置实施例中未披露的细节,请参照本发明上述的对象调用关系的保存方法的实施例。Since each functional module of the device for storing object call relations in the example embodiment of the present invention corresponds to the steps of the above example embodiment of the method for storing object call relations, for details not disclosed in the device embodiments of the present invention, please refer to this An embodiment of the method for saving the above-mentioned object call relationship is invented.

下面参考图5,其示出了适于用来实现本发明实施例的电子设备的计算机系统500的结构示意图。图5示出的电子设备的计算机系统500仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。Referring now to FIG. 5 , it shows a schematic structural diagram of a computer system 500 suitable for implementing an electronic device according to an embodiment of the present invention. The computer system 500 of the electronic device shown in FIG. 5 is only an example, and should not impose any limitation on the functions and application scope of the embodiments of the present invention.

如图5所示,计算机系统500包括中央处理单元(CPU)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储部分508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有系统操作所需的各种程序和数据。CPU501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 5 , a computer system 500 includes a central processing unit (CPU) 501 that can be programmed according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage section 508 into a random-access memory (RAM) 503 Instead, various appropriate actions and processes are performed. In RAM 503, various programs and data necessary for system operation are also stored. The CPU 501 , ROM 502 , and RAM 503 are connected to each other via a bus 504 . An input/output (I/O) interface 505 is also connected to the bus 504 .

以下部件连接至I/O接口505:包括键盘、鼠标等的输入部分506;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分507;包括硬盘等的存储部分508;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分509。通信部分509经由诸如因特网的网络执行通信处理。驱动器510也根据需要连接至I/O接口505。可拆卸介质511,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器510上,以便于从其上读出的计算机程序根据需要被安装入存储部分508。The following components are connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc. and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 510 as necessary so that a computer program read therefrom is installed into the storage section 508 as necessary.

特别地,根据本发明的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分509从网络上被下载和安装,和/或从可拆卸介质511被安装。在该计算机程序被中央处理单元(CPU)501执行时,执行本申请的系统中限定的上述功能。In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 509 and/or installed from removable media 511 . When this computer program is executed by a central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are performed.

需要说明的是,本发明所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.

描述于本发明实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units described in the embodiments of the present invention may be implemented by software or by hardware, and the described units may also be set in a processor. Wherein, the names of these units do not constitute a limitation of the unit itself under certain circumstances.

作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现如上述实施例中的对象调用关系的保存方法。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the electronic device described in the above-mentioned embodiments; or it may exist independently without being assembled into the electronic device. middle. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to implement the method for saving the object call relationship as in the above-mentioned embodiment.

例如,的电子设备可以实现如图1中所示的:步骤S110,将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;步骤S120在树结构数据模型中的当前节点生成对应于对象调用关系中对象的识别信息,并获取当前节点的子节点的识别信息和/或父节点的识别信息;步骤S130,基于节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于键值实现对象调用关系的保存。For example, the electronic device can be implemented as shown in Figure 1: step S110, the object in the obtained object call relationship is mapped to the node in the tree structure data model; step S120 is the current node in the tree structure data model Generate identification information corresponding to the object in the object call relationship, and obtain the identification information of the child node and/or the identification information of the parent node of the current node; step S130, based on the identification information of the node and the obtained identification information of the child node and/or Or the identification information of the parent node to create the corresponding key value, and realize the preservation of the object call relationship based on the key value.

又如,的电子设备可以实现如图2所示的各个步骤。As another example, the electronic device of , can implement the various steps shown in FIG. 2 .

应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本发明的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. Actually, according to the embodiment of the present invention, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided to be embodied by a plurality of modules or units.

通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本发明实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本发明实施方式的方法。Through the description of the above implementations, those skilled in the art can easily understand that the example implementations described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, and the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on a network , including several instructions to make a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) execute the method according to the embodiment of the present invention.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本发明未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Other embodiments of the invention will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present invention, these modifications, uses or adaptations follow the general principles of the present invention and include common knowledge or conventional technical means in the technical field not disclosed in the present invention . The specification and examples are to be considered exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。It should be understood that the present invention is not limited to the precise constructions which have been described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1.一种对象调用关系的保存方法,其特征在于,包括:1. A preservation method of an object calling relationship, characterized in that, comprising: 将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;Map the objects in the obtained object call relationship with the nodes in the tree structure data model; 在所述树结构数据模型中的当前节点生成对应于所述对象调用关系中对象的识别信息,并获取所述当前节点的子节点的识别信息和/或父节点的识别信息;The current node in the tree structure data model generates identification information corresponding to the object in the object call relationship, and obtains the identification information of the child node and/or the identification information of the parent node of the current node; 基于所述节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于所述键值实现所述对象调用关系的保存。A corresponding key value is created based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the parent node, and the storage of the object call relationship is realized based on the key value. 2.根据权利要求1所述的对象调用关系的保存方法,其特征在于,所述将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射,包括:2. The preservation method of the object call relationship according to claim 1, wherein said mapping the object in the acquired object call relationship with the node in the tree structure data model comprises: 根据所述对象调用关系建立树状网络,其中,所述树状网络是对象之间的关系网络,由对象和对象调用关系构成;Establishing a tree-like network according to the object calling relationship, wherein the tree-like network is a relationship network between objects, consisting of objects and object calling relationships; 将所述树状网络中的对象确定为所述树结构数据模型中的节点;determining objects in the tree-like network as nodes in the tree-structured data model; 将所述树状网络中的对象调用关系确定为所述树结构数据模型中节点之间的指向关系。The object calling relationship in the tree network is determined as the pointing relationship between nodes in the tree structure data model. 3.根据权利要求2所述的对象调用关系的保存方法,其特征在于,所述根据所述对象调用关系建立树状网络,包括:3. The preservation method of the object calling relationship according to claim 2, wherein said establishing a tree network according to said object calling relationship comprises: 如果所述对象调用关系中的第一对象调用了第二对象,生成所述第一对象指向所述第二对象的连接线,通过所述带有指向的连接线表征所述对象调用关系,以建立所述对象调用关系中各对象之间调用关系的树状网络。If the first object in the object call relationship calls the second object, generate a connection line pointing to the second object from the first object, and represent the object call relationship through the pointing connection line, to Establishing a tree network of invocation relationships among objects in the object invocation relationship. 4.根据权利要求1或2所述的对象调用关系的保存方法,其特征在于,所述在所述树结构数据模型中的节点生成对应于所述对象调用关系中对象的识别信息,包括:4. The preservation method of the object call relationship according to claim 1 or 2, wherein the node in the tree structure data model generates identification information corresponding to the object in the object call relationship, comprising: 基于所述对象调用关系中对象映射于所述树结构数据模型中节点的顺序,生成对应于所述对象的识别信息。Based on the order in which objects in the object call relationship are mapped to nodes in the tree structure data model, identification information corresponding to the object is generated. 5.根据权利要求1或2所述的对象调用关系的保存方法,其特征在于,将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射之后,所述方法还包括:5. The preservation method of the object call relationship according to claim 1 or 2, characterized in that, after mapping the object in the obtained object call relationship with the node in the tree structure data model, the method further comprises: 将所述树结构数据模型中节点的名称替换为所述映射后对应的所述对象调用关系中对象的名称。The name of the node in the tree structure data model is replaced with the name of the object in the corresponding object call relationship after the mapping. 6.根据权利要求1或2所述的对象调用关系的保存方法,其特征在于,所述基于所述节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,所述方法还包括:6. The method for storing object call relations according to claim 1 or 2, wherein the creation of a corresponding key value, the method also includes: 获取节点的名称;Get the name of the node; 将所述节点的名称与所述节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值。A key value corresponding to the name of the node, the identification information of the node and the obtained identification information of the child node and/or the identification information of the parent node is created. 7.根据权利要求1或2所述的对象调用关系的保存方法,其特征在于,所述在所述树结构数据模型中的节点生成对应于所述对象调用关系中对象的识别信息,并获取所述节点子节点的识别信息和/或父节点的识别信息,包括:7. The preservation method of the object call relationship according to claim 1 or 2, wherein the node in the tree structure data model generates identification information corresponding to the object in the object call relationship, and obtains The identification information of the child node of the node and/or the identification information of the parent node include: 判断所述当前节点是否有父节点和子节点;judging whether the current node has a parent node and a child node; 如所述当前节点只有父节点,则获取所述父节点的识别信息以及所述父节点的调用关系信息,基于所述当前节点的识别信息、所述父节点的识别信息以及所述父节点的调用关系信息,创建键值保存所述当前节点的调用关系;If the current node has only a parent node, then obtain the identification information of the parent node and the call relationship information of the parent node, based on the identification information of the current node, the identification information of the parent node and the call relationship information, create a key value to save the call relationship of the current node; 如所述当前节点只有子节点,则获取所述子节点的识别信息以及所述子节点的调用关系信息,基于所述当前节点的识别信息、所述子节点的识别信息以及所述子节点的调用关系信息,创建键值保存所述当前节点的调用关系;If the current node has only child nodes, then obtain the identification information of the child node and the call relationship information of the child node, based on the identification information of the current node, the identification information of the child node and the call relationship information of the child node call relationship information, create a key value to save the call relationship of the current node; 如所述当前节点有父节点和子节点,则获取所述父节点的识别信息、父节点的调用关系信息、所述子节点的识别信息、所述子节点的调用关系信息,基于所述当前节点的识别信息、所述父节点的识别信息、父节点的调用关系信息、所述子节点的识别信息、所述子节点的调用关系信息,创建键值保存所述当前节点的调用关系。If the current node has a parent node and a child node, then obtain the identification information of the parent node, the call relationship information of the parent node, the identification information of the child node, and the call relationship information of the child node, based on the current node The identification information of the parent node, the identification information of the parent node, the call relationship information of the parent node, the identification information of the child node, the call relationship information of the child node, and create a key value to save the call relationship of the current node. 8.一种对象调用关系的保存装置,其特征在于,所述装置包括:导入模块、生成模块、创建模块;其中,8. A storage device for an object call relationship, characterized in that the device includes: an import module, a generation module, and a creation module; wherein, 导入模块,将所获取的对象调用关系中的对象与树结构数据模型中的节点进行映射;Import the module, and map the objects in the obtained object call relationship with the nodes in the tree structure data model; 生成模块,用于在所述树结构数据模型中的当前节点生成对应于所述对象调用关系中对象的识别信息,并获取所述当前节点的子节点的识别信息和/或父节点的识别信息;A generation module, configured to generate identification information corresponding to the object in the object call relationship at the current node in the tree structure data model, and obtain identification information of the child node and/or identification information of the parent node of the current node ; 创建模块,用于基于所述节点的识别信息以及所获取的子节点的识别信息和/或父节点的识别信息创建对应的键值,基于所述键值实现所述对象调用关系的保存。The creation module is configured to create a corresponding key value based on the identification information of the node and the acquired identification information of the child node and/or the identification information of the parent node, and realize the storage of the object call relationship based on the key value. 9.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1至7中任一项所述的对象调用关系的保存方法。9. A computer-readable medium, on which a computer program is stored, characterized in that, when the program is executed by a processor, the method for saving the object call relationship according to any one of claims 1 to 7 is implemented. 10.一种电子设备,其特征在于,包括:10. An electronic device, characterized in that it comprises: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如权利要求1至7中任一项所述的对象调用关系的保存方法。A storage device, used to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors can implement any one of claims 1 to 7 A save method for the object call relationship.
CN201810690163.5A 2018-06-28 2018-06-28 Method, device, medium and electronic equipment for storing object calling relationship Pending CN108920618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810690163.5A CN108920618A (en) 2018-06-28 2018-06-28 Method, device, medium and electronic equipment for storing object calling relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810690163.5A CN108920618A (en) 2018-06-28 2018-06-28 Method, device, medium and electronic equipment for storing object calling relationship

Publications (1)

Publication Number Publication Date
CN108920618A true CN108920618A (en) 2018-11-30

Family

ID=64422126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810690163.5A Pending CN108920618A (en) 2018-06-28 2018-06-28 Method, device, medium and electronic equipment for storing object calling relationship

Country Status (1)

Country Link
CN (1) CN108920618A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191225A (en) * 2020-01-03 2020-05-22 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for switching isolated objects
CN111581839A (en) * 2020-05-15 2020-08-25 北京世冠金洋科技发展有限公司 Model nesting relation processing method and device and electronic equipment
CN113419795A (en) * 2021-07-21 2021-09-21 网易(杭州)网络有限公司 Call relation display method and device, computer equipment and storage medium
CN113760488A (en) * 2020-08-28 2021-12-07 北京沃东天骏信息技术有限公司 Method, device, equipment and computer readable medium for scheduling task

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733767A (en) * 2016-08-08 2018-02-23 腾讯科技(深圳)有限公司 A kind of method for building up of social networks net, device and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733767A (en) * 2016-08-08 2018-02-23 腾讯科技(深圳)有限公司 A kind of method for building up of social networks net, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WADE&LUFFY: "数据存储方案-物化路径", 《HTTPS://WWW.CNBLOGS.COM/WADE-LUFFY/P/7728879.HTML》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191225A (en) * 2020-01-03 2020-05-22 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for switching isolated objects
CN111191225B (en) * 2020-01-03 2022-05-27 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for switching isolated objects
CN111581839A (en) * 2020-05-15 2020-08-25 北京世冠金洋科技发展有限公司 Model nesting relation processing method and device and electronic equipment
CN111581839B (en) * 2020-05-15 2023-06-23 北京世冠金洋科技发展有限公司 Method and device for processing nesting relationship of model and electronic equipment
CN113760488A (en) * 2020-08-28 2021-12-07 北京沃东天骏信息技术有限公司 Method, device, equipment and computer readable medium for scheduling task
CN113760488B (en) * 2020-08-28 2024-05-17 北京沃东天骏信息技术有限公司 Method, apparatus, device and computer readable medium for scheduling tasks
CN113419795A (en) * 2021-07-21 2021-09-21 网易(杭州)网络有限公司 Call relation display method and device, computer equipment and storage medium
CN113419795B (en) * 2021-07-21 2022-05-03 网易(杭州)网络有限公司 Call relation display method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113760948A (en) Method and device for querying data
CN108920618A (en) Method, device, medium and electronic equipment for storing object calling relationship
CN111062682B (en) Work order processing method and device
CN113282489B (en) Interface testing method and device
CN110795315A (en) Method and apparatus for monitoring services
CN113419789A (en) Method and device for generating data model script
CN109992496A (en) A data processing method and device for automated testing
CN114297278A (en) Batch data fast writing method, system and device
CN112052152A (en) A method and device for simulating testing
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN110795135A (en) A method and apparatus for realizing annotated configuration
CN110851343A (en) A test method and device based on decision tree
CN113190558A (en) A data processing method and system
CN113779346A (en) Method and device for identifying one person with multiple accounts
CN112035581A (en) Model-based task processing method, device, equipment and medium
CN114661289B (en) A knowledge- and data-driven micro-application development system and method
CN110555732A (en) Marketing strategy pushing method and device and marketing strategy operation platform
CN111026629A (en) Method and device for automatic generation of test script
CN111625524B (en) Data processing method, device, equipment and storage medium
CN113779018B (en) A data processing method and device
US11573808B2 (en) Methods of providing an integrated interface that includes a virtual mobile device
CN114547106A (en) Data query method and device, storage medium, and computer system
CN112311833B (en) Data updating method and device
CN114328435A (en) Stream processing method and system of unstructured file based on distributed architecture
CN114527972A (en) Page generation method and device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20181130

RJ01 Rejection of invention patent application after publication