CN108920618A - A kind of store method, device, medium and the electronic equipment of object reference relationship - Google Patents
A kind of store method, device, medium and the electronic equipment of object reference relationship Download PDFInfo
- 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
- relationship
- calling
- data model
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000000547 structure data Methods 0.000 claims description 41
- 238000013507 mapping Methods 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 9
- 230000008676 import Effects 0.000 claims description 6
- 238000012423 maintenance Methods 0.000 abstract description 2
- 238000004519 manufacturing process Methods 0.000 abstract description 2
- 238000010276 construction Methods 0.000 abstract 2
- 238000013499 data model Methods 0.000 abstract 2
- 238000004321 preservation Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 240000008005 Crotalaria incana Species 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a kind of store method of object reference relationship, the store method of the object reference relationship includes:Object in acquired object reference relationship is mapped with the node in tree construction data model;The identification information for corresponding to object in object reference relationship is generated in the present node in tree construction data model, and obtains the identification information of the child node of present node and/or the identification information of father node;The identification information of identification information and acquired child node based on node and/or the identification information of father node create corresponding key assignments, and the preservation of object reference relationship is realized based on key assignments.The technical solution of the embodiment of the present invention meets the high concurrent demand of system, reduces configuration difficulty and maintenance cost, and the production system for having come into operation, realizes and easily add call relation.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a medium and electronic equipment for saving an object calling relationship.
Background
Wechat is a free application for providing instant messaging service to an intelligent terminal. The WeChat supports the cross-communication operator and the cross-operating system platform to quickly send free voice short messages, videos, pictures and characters through the network, and meanwhile, service plug-ins such as 'shake-shake', 'drift bottle', 'friend circle', 'public platform', 'voice notepad' and the like can be used through sharing data of streaming media content and position-based social plug-ins.
The WeChat provides functions of a public platform, a friend circle, message pushing and the like, the user can add friends and pay attention to the public platform in a two-dimensional code scanning mode through shaking, searching numbers and nearby people, and meanwhile the WeChat shares content to the friends and wonderful content seen by the user to the WeChat friend circle.
At present, no relevant scheme capable of storing complex calling relations among users in WeChat exists in the market.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a medium, and an electronic device for saving an object invocation relationship, so as to overcome at least some problems in the related art.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, there is provided a method for saving an object invocation relationship, including:
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.
In an embodiment of the present invention, based on the foregoing solution, the mapping the object in the obtained object invocation relation with the node in the tree structure data model includes:
establishing a tree network according to the object calling relationship, wherein the tree network is a relationship network among objects and is composed of the objects and the object calling relationship;
determining objects in the tree network as nodes in a tree structure data model;
and determining the object calling relationship in the tree network as the pointing relationship among the nodes in the tree structure data model.
In an embodiment of the present invention, based on the foregoing scheme, the building a tree network according to the object invocation relationship includes:
if the first object in the object calling relation calls the second object, generating a connecting line of the first object pointing to the second object, and representing the object calling relation through the connecting line with the pointing direction to establish a tree network of the calling relation among the objects in the object calling relation.
In an embodiment of the present invention, based on the foregoing solution, the generating, by the node in the tree structure data model, the identification information corresponding to the object in the object invocation relationship includes:
and generating identification information corresponding to the objects based on the sequence of the objects in the object calling relationship, which are mapped to the nodes in the tree structure data model.
In an embodiment of the present invention, based on the foregoing solution, the method further includes:
and replacing the names of the nodes in the tree structure data model with the names of the objects in the mapped corresponding object calling relationship. .
In an embodiment of the present invention, based on the foregoing solution, the 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 parent node, and implementing the saving of the object invocation relationship based on the key value includes:
acquiring name information of a node;
and creating a corresponding key value by the name of the node and the identification information of the node and the acquired identification information of the child node and/or the identification information of the father node.
In an embodiment of the present invention, based on the foregoing solution, the generating, by the node in the tree structure data model, the identification information corresponding to the object in the object invocation relationship, and acquiring the identification information of the node child node and/or the identification information of the parent node includes:
judging whether the current node has a father node and a child node;
if the current node only has a father node, acquiring identification information of the father node and calling relationship information of the father node, and creating a key value and storing the calling relationship of the current node based on the identification information of the current node, the identification information of the father node and the calling relationship information of the father node;
if the current node only has the child node, acquiring the identification information of the child node and the calling relation information of the child node, and creating a key value and storing the calling relation of the current node based on the identification information of the current node, the identification information of the child node and the calling relation information of the child node;
if the current node has a father node and a son node, acquiring identification information of the father node, calling relation information of the father node, identification information of the son node and calling relation information of the son node, and creating a key value to store the calling relation of the current node based on the identification information of the current node, the identification information of the father node, the calling relation information of the father node, the identification information of the son node and the calling relation information of the son node.
According to a second aspect of the embodiments of the present invention, there is provided a node manager, including: the device comprises an importing module, a generating module and a creating module; wherein,
the import module is used for mapping the object in the acquired object calling relation with the node in the tree structure data model;
the generation module is used for generating identification information corresponding to the object in the object calling relationship at the current node in the tree structure data model and acquiring the identification information of a child node and/or the identification information of a father node of the current node;
and the creating module is used for 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 realizing the storage of the object calling relation based on the key value.
According to a third aspect of embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, implementing the method for saving an object invocation relation according to the first aspect of the embodiments.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the method for saving object invocation relationships as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
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
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, as claimed.
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. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 schematically shows a flowchart of a method for saving object invocation relationships, according to one embodiment of the invention.
FIG. 2 schematically illustrates a flow diagram for saving object invocation relationships, according to one embodiment of the invention.
Fig. 3 is a schematic diagram illustrating a saving method of call relations between the micro credit users according to an embodiment of the invention.
Fig. 4 schematically shows a block diagram of a holding apparatus of an object call relation according to an embodiment of the present invention.
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 will 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 to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
FIG. 1 schematically shows a flowchart of a method for saving object invocation relationships, according to one embodiment of the invention.
Referring to fig. 1, a method for saving an object invocation relation according to an embodiment of the present invention includes the following steps:
step S110, mapping the object in the obtained object invocation relation with the node in the tree structure data model.
In one embodiment of the present invention, the object invocation relationship may be an invocation relationship between users in the WeChat, such as: WeChat user A group forwards to WeChat user B, D, through the circle of friends to C, and WeChat group user D forwards to WeChat user H through the group.
In one embodiment of the present invention, since the call or forwarding relationships between users in the WeChat are similar to the structure of a multi-way tree, the tree structure data model may be data organized hierarchically like a tree with recursive relationships, in such a structure, each instance is called a node, each node has multiple children and a parent, the node at the top level is called a root node, which has no parent, the node at the bottom level is called a leaf node, which has no children, and all intermediate nodes are called non-leaf nodes.
In an embodiment of the present invention, based on the foregoing scheme, a tree network is established according to an object invocation relationship, wherein the tree network is a relationship network between objects and is composed of the objects and the object invocation relationship; determining objects in the tree network as nodes in a tree structure data model; and determining the object calling relationship in the tree network as the pointing relationship among the nodes in the tree structure data model.
In an embodiment of the present invention, based on the foregoing solution, if a first object in the object invocation relationship invokes a second object, a connection line is generated, where the first object points to the second object, and the object invocation relationship is represented by the connection line with the point to establish a tree network of the invocation relationship between the objects in the object invocation relationship, and so on, to establish a tree network of the invocation relationship between the objects in the object invocation relationship.
In an embodiment of the present invention, based on the foregoing solution, names of nodes in the tree structure data model are replaced with names of objects in the mapped corresponding object invocation relationship
In an embodiment of the present invention, based on the foregoing scheme, a name of a node is obtained; and creating a corresponding key value by the name of the node and the identification information of the node and the acquired identification information of the child node and/or the identification information of the father node.
Step S120, generating identification information corresponding to the object in the object calling relationship at the current node in the tree structure data model, and acquiring the identification information of the child node and/or the identification information of the father node of the current node.
In one embodiment of the invention, the identification information corresponding to the object is generated based on the import order of the nodes in the object import tree structure data model in the object invocation relationship.
In an embodiment of the present invention, based on the foregoing solution, an identification information may be stored in a node, and the identification information may create a corresponding Key-Value in Redis to store a call relationship between nodes.
Step S130, a corresponding key value is established 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 the object calling relation is saved based on the key value.
In one embodiment of the invention, the name of a node may be obtained; and creating a corresponding key value for the name of the node, the identification information of the node, the acquired identification information of the child node and/or the identification information of the father node.
In an embodiment of the present invention, creating a Key Value corresponding to the identification information to implement saving of the object call relationship may be implemented by a Key-Value (Key-Value) storage database, for example: the non-relational database is a NoSQL (non-relational database) model, and data of the NoSQL model are organized, indexed and stored in a key-value pair mode. Key-value stores are well suited for business data that does not involve too many data relationships, business relationships, such as: the calling relation among users in the WeChat provided by the embodiment of the invention can effectively reduce the times of reading and writing the disk, and has better reading and writing performance compared with the SQL database storage.
In one embodiment of the present invention, as shown in FIG. 2, saving the object invocation relationship may include the following steps:
step S210: judging whether the current node has a father node and a child node; if only the parent node executes step S220; if only the child node exists, executing step S230; as with the parent node and the child nodes, step S240 is performed.
Step S230: and saving the calling relation of the current node based on the identification information and the calling relation of the father node.
In one embodiment of the invention, if the current node only has a father node, acquiring the identification information of the father node and the calling relationship information of the father node, and creating a key value to store the calling relationship of the current node based on the identification information of the current node, the identification information of the father node and the calling relationship information of the father node;
step S240: and saving the calling relation of the current node based on the identification information and the calling relation of the child node.
In one embodiment of the invention, if the current node only has the child node, the identification information of the child node and the calling relationship information of the child node are obtained, and based on the identification information of the current node, the identification information of the child node and the calling relationship information of the child node, a key value is created and the calling relationship of the current node is saved;
step S240: and saving the calling relation of the current node based on the identification information and calling relation of the father node and the identification information and calling relation of the child node. In an 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, and based on the identification information of the current 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, a key value is created to store the call relationship of the current node.
In one embodiment of the invention, the method is applied to the calling relationship in the WeChat, when the WeChat account A forwards the Taikang active link to the WeChat account B, the WeChat account B is linked through a friend circle or a WeChat friend point, an interface for saving the link is asynchronously called, and the calling link information is saved through the interface.
The following describes the method for saving object invocation relationship in this embodiment of the present invention in detail by taking the invocation relationship between users in WeChat as an example.
Fig. 3 is a schematic diagram illustrating a saving method of call relations between the micro credit users according to an embodiment of the invention.
Referring to fig. 3, a method for saving call relations between micro-credit users according to an embodiment of the invention includes: a node 310, a node B320, a node C330, a node D340, a node H350; the wechat user a corresponds to the node a 310, the wechat user B corresponds to the node B320, the wechat user C corresponds to the node C330, the wechat user D corresponds to the node D340, and the wechat user H corresponds to the node H350, specifically, the wechat user a issues links in the wechat through a circle of friends and a wechat group, and the relationship between the wechat user a and the wechat user B is as follows: the WeChat user B calls the WeChat user A through the WeChat group, and by analogy, the calling relations between the WeChat user A and the WeChat user C, the WeChat user D and the WeChat user H can be obtained, wherein the WeChat user A group is forwarded to the WeChat user B, D, the circle of friends is forwarded to C, and the WeChat user D group is forwarded to the WeChat user H, wherein the obtained calling relations are imported into the tree structure data model, the node A is a father node relative to the node B, the node C and the node D, the node B, the node C and the node D are child nodes of the node A, the node D is a father node relative to the node H, and the node H is a child node relative to the node.
In an embodiment of the present invention, based on the determined call relationship of the link between the micro credit users, identification information is generated at the node, for example: the node A is a father node for sending the link, and the identification information is as follows: a; the node B calls the link of the node A through the WeChat cluster, and the identification information is as follows: the identification information identifies the link issued by the node B through the WeChat group (WXQ) to call the node A, and so on, the identification information of the node C is as follows: a/C _ PYQ, the identification information identifying the link issued by the C node calling the a node through the circle of friends (PYQ), the D node identification information being: the identification information identifies the link issued by the D node calling the A node through the WeChat group (WXQ), and the H node identification information is as follows: the identification information identifies the link issued by the H node through the WeChat group (WXQ) calling the D node.
The identification information may create a corresponding KEY value in the Redis to store the related call information, and thus, the entire forwarding relation graph may be stored in the Zookeeper and the Redis.
In one embodiment of the present invention, at least 3 parameters are needed to be entered into the parameter when the call relationship of each node is jointly stored based on Zookeeper and Redis: identification information of a parent node; identification information of the current node; a node name.
In an embodiment of the present invention, the node identification information is stored in Redis by Zookeeper as follows:
firstly, judging whether the identification information of the current node is stored in Redis;
in practical application, the calling relationship between nodes is complex and huge, so that when node identification information is stored, whether the identification information of the current node is stored in Redis needs to be judged, so as to avoid the problem of unstable system caused by repeated node information storage operation;
if the current node identification information is judged to be stored in Redis, the current node identification information storage process is ended,
and if the identification information of the current node is not stored in the Redis, acquiring the link information of the father node of the current node stored in the Redis, and creating a corresponding key value for the identification information of the current node and the link information of the father node of the current node and storing the key value in the Redis.
Secondly, judging whether the identification information of the father node of the current node is stored in the Zookeeper;
if the father node identification information is judged not to be stored, determining that the current node has no father node, acquiring the identification information of the child node of the current node, and creating a corresponding key value for the identification information of the current node and the identification information of the child node of the current node to store in Redis;
if the father node identification information is judged to be stored, the current node is determined to have the father node and the child node, the father node identification information and the child node identification information are directly acquired, and a corresponding key value is created and stored in Redis.
Finally, judging whether the child node link information of the current node has the identification information of the current node or not;
if the sub-node link information stores the identification information of the current node, directly ending the process of storing the identification information of the current node;
and if the identification information of the current node is not stored in the link information of the child node, storing the identification information of the current node in Redis.
The following describes an embodiment of an apparatus of the present invention, which may be used to execute the above-mentioned object-call-relationship saving method of the present invention.
Fig. 4 schematically shows a block diagram of a saving means of object invocation relations according to an embodiment of the present invention.
Referring to fig. 4, an apparatus 400 for saving an object invocation relation according to an embodiment of the present invention includes: an import module 402, a generation module 404, a creation module 406; wherein,
an import module 402, configured to map an object in the obtained object invocation relationship with a node in a tree structure data model;
a generating module 404, configured to generate, at a current node in the tree structure data model, identification information corresponding to an object in the object invocation relationship, and obtain identification information of a child node and/or identification information of a parent node of the current node;
a creating module 406, 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 implement saving of the object call relationship based on the key value.
In an embodiment of the present invention, based on the foregoing solution, the importing module 402 is specifically configured to establish a tree network according to an object call relationship, where the tree network is a relationship network between objects and is formed by the objects and the object call relationship; determining objects in the tree network as nodes in a tree structure data model; and determining the object calling relationship in the tree network as the pointing relationship among the nodes in the tree structure data model.
In an embodiment of the present invention, based on the foregoing solution, the importing module 402 is further configured to, if a first object in the object invocation relationship invokes a second object, generate a connection line pointing to the second object by the first object, and characterize the object invocation relationship by the connection line with the pointing direction, so as to establish a tree network of invocation relationships between objects in the object invocation relationship.
In an embodiment of the present invention, based on the foregoing solution, the generating module 404 is specifically configured to generate the identification information corresponding to the object based on an order in which the object in the object invocation relationship is mapped to the node in the tree structure data model.
In an embodiment of the present invention, based on the foregoing solution, the importing module 402 is further configured to replace names of nodes in the tree structure data model with names of objects in the mapped corresponding object invocation relationship.
In an embodiment of the present invention, based on the foregoing scheme, the creating module 406 is specifically configured to obtain a name of a node; and creating a corresponding key value for the name of the node, the identification information of the node, the acquired identification information of the child node and/or the identification information of the father node.
In an embodiment of the present invention, based on the foregoing scheme, the creating module 406 is further specifically configured to:
judging whether the current node has a father node and a child node;
if the current node only has a father node, acquiring identification information of the father node and calling relationship information of the father node, and creating a key value and storing the calling relationship of the current node based on the identification information of the current node, the identification information of the father node and the calling relationship information of the father node;
if the current node only has the child node, acquiring the identification information of the child node and the calling relation information of the child node, and creating a key value and storing the calling relation of the current node based on the identification information of the current node, the identification information of the child node and the calling relation information of the child node;
if the current node has a father node and a son node, acquiring identification information of the father node, calling relation information of the father node, identification information of the son node and calling relation information of the son node, and creating a key value to store the calling relation of the current node based on the identification information of the current node, the identification information of the father node, the calling relation information of the father node, the identification information of the son node and the calling relation information of the son node.
For details that are not disclosed in the embodiment of the apparatus of the present invention, please refer to the embodiment of the object call relation saving method of the present invention for the details that are not disclosed in the embodiment of the apparatus of the present invention.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing an electronic device of 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 bring any limitation to the function and the scope of the use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes 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. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU501, 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 bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; 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. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
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, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection 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, wire, fiber optic 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 the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). 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 the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is enabled to implement the method for saving the object invocation relationship in the embodiment.
For example, the electronic device may implement as shown in fig. 1: step S110, mapping the object in the acquired object calling relation with the node in the tree structure data model; step S120, generating identification information corresponding to the object in the object calling relationship at the current node in the tree structure data model, and acquiring the identification information of the child node and/or the identification information of the father node of the current node; step S130, a corresponding key value is established 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 the object calling relation is saved based on the key value.
For another example, the electronic device may implement the steps shown in fig. 2.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination 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, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be 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 variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that 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. A method for saving object call relations is characterized by comprising 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 the object calling relationship at a current node in the 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 realizing the storage of the object calling relationship based on the key value.
2. The method for saving an object invocation relationship according to claim 1, wherein the mapping the object in the obtained object invocation relationship with the node in the tree structure data model includes:
establishing a tree network according to the object calling relationship, wherein the tree network is a relationship network among objects and is composed of the objects and the object calling relationship;
determining objects in the tree network as nodes in the tree structure data model;
and determining the object calling relationship in the tree network as the pointing relationship between the nodes in the tree structure data model.
3. The method for saving an object invocation relation according to claim 2, wherein the establishing a tree network according to the object invocation relation includes:
if a first object in the object calling relationship calls a second object, generating a connecting line pointing to the second object by the first object, and representing the object calling relationship through the connecting line with the point to establish a tree network of the calling relationship among the objects in the object calling relationship.
4. The method for saving an object invocation relation according to claim 1 or 2, wherein the step of generating the identification information corresponding to the object in the object invocation relation by the node in the tree structure data model comprises:
and generating identification information corresponding to the object based on the sequence of the object mapping to the nodes in the tree structure data model in the object calling relationship.
5. The method for saving an object invocation relationship according to claim 1 or 2, wherein after mapping the object in the obtained object invocation relationship with the node in the tree structure data model, the method further comprises:
and replacing the name of the node in the tree structure data model with the name of the object in the corresponding mapped object calling relationship.
6. The method for saving an object call relationship according to claim 1 or 2, wherein the method creates 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 further comprises:
acquiring the name of a node;
and creating a corresponding key value for the name of the node, the identification information of the node, the acquired identification information of the child node and/or the identification information of the father node.
7. The method for saving an object invocation relation according to claim 1 or 2, wherein the step of generating identification information corresponding to the object in the object invocation relation by the node in the tree structure data model and obtaining the identification information of the child node and/or the identification information of the parent node of the node comprises:
judging whether the current node has a father node and a child node;
if the current node only has a father node, acquiring identification information of the father node and calling relationship information of the father node, and creating a key value to store the calling relationship of the current node based on the identification information of the current node, the identification information of the father node and the calling relationship information of the father node;
if the current node only has a child node, acquiring the identification information of the child node and the calling relationship information of the child node, and creating a key value and saving the calling relationship of the current node based on the identification information of the current node, the identification information of the child node and the calling relationship information of the child node;
if the current node has a father node and a child node, acquiring identification information of the father node, calling relation information of the father node, identification information of the child node and calling relation information of the child node, and creating a key value to store the calling relation of the current node based on the identification information of the current node, the identification information of the father node, the calling relation information of the father node, the identification information of the child node and the calling relation information of the child node.
8. An apparatus for saving object invocation relationship, the apparatus comprising: the device comprises an importing module, a generating module and a creating module; wherein,
the import module is used for mapping the object in the acquired object calling relation with the node in the tree structure data model;
a generating module, configured to generate, at a current node in the tree structure data model, identification information corresponding to an object in the object invocation relationship, and acquire identification information of a child node and/or identification information of a parent node of the current node;
and the creating module is used for 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 realizing the storage of the object calling relationship based on the key value.
9. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, implements the object call relation saving method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of saving object call relationships as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810690163.5A CN108920618A (en) | 2018-06-28 | 2018-06-28 | A kind of store method, device, medium and the electronic equipment of object reference relationship |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810690163.5A CN108920618A (en) | 2018-06-28 | 2018-06-28 | A kind of store method, device, medium and the electronic equipment of object reference 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 | A kind of store method, device, medium and the electronic equipment of object reference relationship |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108920618A (en) |
Cited By (4)
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)
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 |
-
2018
- 2018-06-28 CN CN201810690163.5A patent/CN108920618A/en active Pending
Patent Citations (1)
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)
Title |
---|
WADE&LUFFY: "数据存储方案-物化路径", 《HTTPS://WWW.CNBLOGS.COM/WADE-LUFFY/P/7728879.HTML》 * |
Cited By (8)
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 |
---|---|---|
CN108920618A (en) | A kind of store method, device, medium and the electronic equipment of object reference relationship | |
US8713453B2 (en) | Progressively discovering and integrating services | |
US20150074043A1 (en) | Distributed and open schema interactions management system and method | |
CN110781180B (en) | Data screening method and data screening device | |
CN110689268A (en) | Method and device for extracting indexes | |
CN113076153A (en) | Interface calling method and device | |
CN114297278A (en) | Method, system and device for quickly writing batch data | |
CN113419789A (en) | Method and device for generating data model script | |
CN112073395A (en) | File distribution method and device | |
CN114816361A (en) | Method, device, equipment, medium and program product for generating splicing project | |
CN111176641B (en) | Flow node execution method, device, medium and electronic equipment | |
CN111062682B (en) | Work order processing method and device | |
CN113779346A (en) | Method and device for identifying one person with multiple accounts | |
CN110717123B (en) | Page response method and device, electronic equipment and storage medium | |
CN111127232B (en) | Method, device, server and medium for discovering interest circle | |
CN112100260A (en) | Interface engine-based multi-application data fusion method and system | |
CN111415262A (en) | Service processing method and device | |
CN114780361A (en) | Log generation method, device, computer system and readable storage medium | |
CN113760487B (en) | Service processing method and device | |
CN111970338A (en) | Request processing method and device based on cloud function and computer readable medium | |
CN113779945A (en) | Method and device for generating file | |
CN113760343A (en) | Method and device for processing service request | |
CN111027809B (en) | Message notification method, device, medium and electronic equipment | |
CN118170811A (en) | Data query method, device, apparatus, medium and program product | |
US20230214766A1 (en) | Product management method and related device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181130 |