CN111510499B - Communication method, device, equipment and storage medium - Google Patents
Communication method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111510499B CN111510499B CN202010311453.1A CN202010311453A CN111510499B CN 111510499 B CN111510499 B CN 111510499B CN 202010311453 A CN202010311453 A CN 202010311453A CN 111510499 B CN111510499 B CN 111510499B
- Authority
- CN
- China
- Prior art keywords
- proxy
- pointer
- proxy object
- identifier
- priority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000004891 communication Methods 0.000 title claims abstract description 69
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000037430 deletion Effects 0.000 claims description 5
- 238000012217 deletion Methods 0.000 claims description 4
- 238000012423 maintenance Methods 0.000 abstract description 7
- 230000008569 process Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 239000003795 chemical substances by application Substances 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/61—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Abstract
本发明公开了一种通讯方法、装置、设备及存储介质,该方法包括:获取待发送的通知信息,以及所述通知信息中的标识信息;基于所述标识信息,从预先建立的对象引用关系集合中确定与所述标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;所述指针标识与代理对象相对应;根据所述指针标识以及代理优先级,确定目标代理对象以及将所述通知信息依次发送至目标代理对象。本发明实施例的技术方案,解决了现有技术中基于notification一对多通讯时,不关注消息发送结果,导致存在项目代码臃肿,不便于后期维护,实现了向至少一个代理对象通讯,提高了通讯效率,降低了notification冗余的问题。
The invention discloses a communication method, device, equipment and storage medium. The method includes: obtaining notification information to be sent and identification information in the notification information; Determining at least one pointer identifier corresponding to the identification information and the proxy priority corresponding to each pointer identifier in the set; the pointer identifier corresponds to the proxy object; according to the pointer identifier and the proxy priority, determine the target The proxy object and sequentially send the notification information to the target proxy object. The technical solution of the embodiment of the present invention solves the problem of not paying attention to the message sending result in the prior art based on the notification-based one-to-many communication, resulting in bloated project codes, which is inconvenient for later maintenance, realizes communication to at least one proxy object, and improves Communication efficiency reduces the problem of notification redundancy.
Description
技术领域technical field
本发明实施例涉及计算机技术领域,尤其涉及一种通讯方法、装置、设备及存储介质。Embodiments of the present invention relate to the field of computer technologies, and in particular, to a communication method, device, equipment, and storage medium.
背景技术Background technique
目前,在objective-C中,需要将某个对象要做的事情委托至其它对象去处理,即通过delegate的作用委托其它对象帮其实现接口协议,是一对一的通讯机制,官方提供了通知中心(notification)来实现一对多的通讯。At present, in objective-C, it is necessary to entrust the things to be done by an object to other objects for processing, that is, to entrust other objects to help it implement the interface protocol through the role of the delegate, which is a one-to-one communication mechanism. The official provides a notification Center (notification) to achieve one-to-many communication.
但是,在实际应用的过程中,由于基于notification的一对多通讯方式,不关注消息接受者是否接收消息,也不关注消息发送的结果,只需要将消息发送出去即可,导致存在频繁使用notification的方式会容易使得项目代码臃肿,不便于后期维护的问题。However, in the process of practical application, due to the notification-based one-to-many communication method, it does not pay attention to whether the message receiver receives the message, nor does it pay attention to the result of the message sending, but only needs to send the message, resulting in frequent use of notification This method will easily make the project code bloated, which is not convenient for later maintenance.
发明内容Contents of the invention
本发明提供一种通讯方法、装置、设备及存储介质,以实现基于delegate实现一对多通讯,避免了通过notification通讯时存在代码冗余的问题,提高了通讯效率的技术效果。The present invention provides a communication method, device, equipment and storage medium to realize one-to-many communication based on a delegate, avoid the problem of code redundancy in communication through notification, and improve the technical effect of communication efficiency.
第一方面,本发明实施例提供了一种通讯方法,该方法包括:In a first aspect, an embodiment of the present invention provides a communication method, which includes:
获取待发送的通知信息,以及所述通知信息中的标识信息;Obtain the notification information to be sent, and the identification information in the notification information;
基于所述标识信息,从预先建立的对象引用关系集合中确定与所述标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;所述指针标识与代理对象相对应;Based on the identification information, determine at least one pointer identification corresponding to the identification information and a proxy priority corresponding to each pointer identification from a pre-established object reference relationship set; the pointer identification corresponds to a proxy object ;
根据所述指针标识以及代理优先级,确定目标代理对象以及将所述通知信息依次发送至目标代理对象。According to the pointer identifier and proxy priority, determine the target proxy object and send the notification information to the target proxy object in sequence.
第二方面,本发明实施例还提供了一种通讯装置,该装置包括:In the second aspect, the embodiment of the present invention also provides a communication device, which includes:
标识信息确定模块,用于获取待发送的通知信息,以及所述通知信息中的标识信息;An identification information determination module, configured to obtain notification information to be sent, and identification information in the notification information;
属性信息获取模块,用于基于所述标识信息,从预先建立的对象引用关系集合中确定与所述标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;所述指针标识与代理对象相对应;An attribute information acquisition module, configured to determine at least one pointer identifier corresponding to the identifier information and an agent priority corresponding to each pointer identifier from a set of pre-established object reference relationships based on the identifier information; The pointer identifier corresponds to the proxy object;
通知信息发送模块,用于根据所述指针标识以及代理优先级,确定目标代理对象以及将所述通知信息依次发送至目标代理对象。The notification information sending module is configured to determine the target proxy object and send the notification information to the target proxy object in sequence according to the pointer identifier and proxy priority.
第三方面,本发明实施例还提供了一种设备,所述设备包括:In a third aspect, an embodiment of the present invention also provides a device, the device comprising:
一个或多个处理器;one or more processors;
存储装置,用于存储一个或多个程序,storage means for storing one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本发明实施例任一所述的通讯方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the communication method according to any one of the embodiments of the present invention.
第四方面,本发明实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如本发明实施例任一所述的通讯方法。In the fourth aspect, the embodiment of the present invention also provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute the communication method as described in any one of the embodiments of the present invention when executed by a computer processor .
本发明实施例的技术方案,通过获取待发送的通知信息,以及通知信息中的标识信息;基于标识信息,从预先建立的对象引用关系集合中确定与标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;指针标识与代理对象相对应;根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象,解决了现有技术中频繁通过notification的方式实现一对多通讯时,由于不关注通知信息发送过程,导致存在代码臃肿,不便于后期维护的问题,实现了通过delegate进行一对多通讯,不仅避免了通过notification进行消息发送时存在代码臃肿的问题,还实现了消息发送效率的技术效果。In the technical solution of the embodiment of the present invention, by obtaining the notification information to be sent and the identification information in the notification information; based on the identification information, at least one pointer identification corresponding to the identification information and the identification information corresponding to the identification information are determined from the set of pre-established object reference relationships. The proxy priority corresponding to each pointer identifier; the pointer identifier corresponds to the proxy object; according to the pointer identifier and the proxy priority, the target proxy object is determined and the notification information is sent to the target proxy object in turn, which solves the problem of frequent passing through in the prior art When one-to-many communication is realized by means of notification, due to not paying attention to the sending process of notification information, there are problems of bloated code and inconvenient maintenance in the later stage. One-to-many communication through delegate is realized, which not only avoids the problem of sending messages through notification The problem of bloated code has also achieved the technical effect of message sending efficiency.
附图说明Description of drawings
为了更加清楚地说明本发明示例性实施例的技术方案,下面对描述实施例中所需要用到的附图做一简单介绍。显然,所介绍的附图只是本发明所要描述的一部分实施例的附图,而不是全部的附图,对于本领域普通技术人员,在不付出创造性劳动的前提下,还可以根据这些附图得到其他的附图。In order to illustrate the technical solutions of the exemplary embodiments of the present invention more clearly, the following briefly introduces the drawings used in describing the embodiments. Apparently, the drawings introduced are only the drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. Those of ordinary skill in the art can also obtain the Other attached drawings.
图1为本发明实施例一所提供的一种通讯方法流程示意图;FIG. 1 is a schematic flowchart of a communication method provided by Embodiment 1 of the present invention;
图2为本发明实施例二所提供的一种通讯方法流程示意图;FIG. 2 is a schematic flowchart of a communication method provided by Embodiment 2 of the present invention;
图3为本发明实施例三所提供的一种通讯方法流程示意图;FIG. 3 is a schematic flowchart of a communication method provided by Embodiment 3 of the present invention;
图4为本发明实施例四所提供的一种通讯装置结构示意图;FIG. 4 is a schematic structural diagram of a communication device provided by Embodiment 4 of the present invention;
图5为本发明实施例五所提供的一种设备结构示意图。FIG. 5 is a schematic structural diagram of a device provided by Embodiment 5 of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings but not all structures.
实施例一Embodiment one
图1为本发明实施例一所提供的一种通讯方法流程示意图,本实施例可适用于通过delegate实现一对多通讯的情况,该方法可以由通讯装置来执行,该系统可以通过软件和/或硬件的形式实现。Figure 1 is a schematic flow chart of a communication method provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation where one-to-many communication is realized through a delegate. The method can be executed by a communication device, and the system can be implemented through software and/or or in the form of hardware.
如图1所述,本实施例的方法包括:As shown in Figure 1, the method of this embodiment includes:
S110、获取待发送的通知信息,以及通知信息中的标识信息。S110. Obtain notification information to be sent and identification information in the notification information.
需要说明的是,本发明实施例所提供的delegate是IOS独有的通讯机制,可以实现对一对多的通讯的支持。It should be noted that the delegate provided by the embodiment of the present invention is a unique communication mechanism of IOS, which can support one-to-many communication.
其中,通知信息可以是委托方发送至各个被委托方的信息,也就是说,通知信息可以是委托方发送至由委托方代理的各个代理对象的通知消息,相应的,待发送的通知信息可以是委托方将要发送至各个被委托方的信息。可以将各个代理对象作为被委托方,发送通知消息的一方作为委托方。根据标识信息可以确定哪些被委托方需要接收该通知信息。Wherein, the notification information may be information sent by the entrusting party to each entrusted party, that is to say, the notification information may be a notification message sent by the entrusting party to each proxy object proxied by the entrusting party. Correspondingly, the notification information to be sent may be It is the information that the entrusting party will send to each entrusted party. Each proxy object can be used as the delegated party, and the party that sends the notification message can be used as the delegating party. Which entrusted parties need to receive the notification information can be determined according to the identification information.
具体的,可以获取待发送至各个代理对象的通知信息,并获取通知信息中的标识,以便根据标识信息确定需要向哪些代理对象发送通知信息。Specifically, the notification information to be sent to each proxy object may be obtained, and the identification in the notification information may be obtained, so as to determine which proxy objects need to send the notification information according to the identification information.
示例性的,委托方获取待发送至各个代理对象的通知信息,并获取通知信息中的标识信息,以根据该标识信息确定将要发送至哪些代理对象。Exemplarily, the entrusting party obtains notification information to be sent to each proxy object, and obtains identification information in the notification information, so as to determine which proxy objects to send to according to the identification information.
S120、基于所述标识信息,从预先建立的对象引用关系集合中确定与所述信息标识相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级。S120. Based on the identification information, determine at least one pointer identifier corresponding to the information identifier and a proxy priority corresponding to each pointer identifier from a set of pre-established object reference relationships.
其中,对象引用关系集合是预先建立的,用于存储与各个代理对象相对应的属性信息,可选的,属性信息可以是与代理对象对应的指针标识,以及与每个代理对象相对应的代理优先级。属性信息存储在引用关系集合中可以以数组的形式存储,例如,数组中的第一个位置的数字表示指针标识,第二个位置的数字表示代理优先级。在各个待处理代理对象继承接口协议后,可以得到代理对象,并将得到的代理对象存储至一个集合中,为了便于通讯时查找到代理对象,可以将与代理对象对应的指针标识存储至引用关系集合中,以便根据指针标识查找到代理对象。也就是说,指针标识是与代理对象相对应的,通过指针标识来查找代理对象。由于基于delegate发送通讯主要是一对一通讯,当代理对象的数量有多个时,为了确定向各个代理对象发送通讯的先后顺序,可以预先定义每个代理对象的优先级。即代理对象优先级用于表征向每个代理对象发送通知信息的先后顺序。Wherein, the set of object reference relationships is pre-established and is used to store attribute information corresponding to each proxy object. Optionally, the attribute information may be a pointer identifier corresponding to the proxy object, and a proxy ID corresponding to each proxy object. priority. The attribute information stored in the reference relationship set can be stored in the form of an array, for example, the number at the first position in the array indicates the pointer identifier, and the number at the second position indicates the priority of the agent. After each proxy object to be processed inherits the interface protocol, the proxy object can be obtained and stored in a collection. In order to find the proxy object during communication, the pointer identifier corresponding to the proxy object can be stored in the reference relationship collection, so as to find the proxy object according to the pointer identification. That is to say, the pointer identifier corresponds to the proxy object, and the proxy object is searched through the pointer identifier. Since sending communication based on delegate is mainly one-to-one communication, when there are multiple proxy objects, in order to determine the order of sending communication to each proxy object, the priority of each proxy object can be defined in advance. That is, the proxy object priority is used to represent the order in which notification information is sent to each proxy object.
具体的,在获取到标识信息后,可以基于标识信息从预先建立的对象引用关系集合中确定将要发送通知信息的指针标识,该指针标识是与每个代理对象相对应的,以及可以确定与每个指针标识相对应的代理优先级。根据与每个代理对象对应的代理优先级,可以确定向每个代理对象进行通讯的先后顺序,即发送通知信息的先后顺序,根据与其对应的指针标识获取代理对象,进而根据代理优先级向各个代理对象依次发送通知信息。Specifically, after the identification information is obtained, the pointer identification that will send the notification information can be determined from the pre-established object reference relationship set based on the identification information, the pointer identification is corresponding to each proxy object, and can be determined to be related to each A pointer identifies the corresponding agent priority. According to the proxy priority corresponding to each proxy object, the order of communication with each proxy object can be determined, that is, the order of sending notification information, and the proxy object can be obtained according to the corresponding pointer identifier, and then sent to each proxy object according to the proxy priority. Proxy objects send notification messages in turn.
S130、根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象。S130. According to the pointer identifier and the proxy priority, determine the target proxy object and send notification information to the target proxy object in sequence.
其中,可以将当前正在接收通知信息的代理对象作为目标代理对象。Wherein, the proxy object that is currently receiving notification information may be used as the target proxy object.
具体的,根据标识信息,可以从对象引用关系集合中将要接收通知信息的各个指针标识,进而根据指针标识可以确定各个代理对象,并将通知信息发送至各个代理对象。根据与各个指针标识相对应的代理优先级,可以确定向各个代理对象发送通知信息的先后顺序。依据先后顺序依次将通知信息发送至各个目标代理对象。Specifically, according to the identification information, each pointer identifier that will receive the notification information can be identified from the object reference relationship set, and then each proxy object can be determined according to the pointer identifier, and the notification information can be sent to each proxy object. According to the proxy priority corresponding to each pointer identifier, the order of sending notification information to each proxy object can be determined. The notification information is sent to each target proxy object in sequence.
本发明实施例的技术方案,通过获取待发送的通知信息,以及通知信息中的标识信息;基于标识信息,从预先建立的对象引用关系集合中确定与标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;指针标识与代理对象相对应;根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象,解决了现有技术中频繁通过notification的方式实现一对多通讯时,由于不关注通知信息发送过程,导致存在代码臃肿,不便于后期维护的问题,实现了通过delegate进行一对多通讯,不仅避免了通过notification进行消息发送时存在代码臃肿的问题,还实现了消息发送效率的技术效果。In the technical solution of the embodiment of the present invention, by obtaining the notification information to be sent and the identification information in the notification information; based on the identification information, at least one pointer identification corresponding to the identification information and the identification information corresponding to the identification information are determined from the set of pre-established object reference relationships. The proxy priority corresponding to each pointer identifier; the pointer identifier corresponds to the proxy object; according to the pointer identifier and the proxy priority, the target proxy object is determined and the notification information is sent to the target proxy object in turn, which solves the problem of frequent passing through in the prior art When one-to-many communication is realized by means of notification, due to not paying attention to the sending process of notification information, there are problems of bloated code and inconvenient maintenance in the later stage. One-to-many communication through delegate is realized, which not only avoids the problem of sending messages through notification The problem of bloated code has also achieved the technical effect of message sending efficiency.
实施例二Embodiment two
在上述技术方案的基础上,在获取到待发送的通知信息之前,可以先建立对象引用关系集合,即建立各个代理对象与目标代理接口的对应关系,也就是说,可以将各个代理对象委托至委托方代理。图2为本发明实施例二所提供的一种通讯方法流程示意图。如图2所示,所述方法包括:On the basis of the above technical solution, before obtaining the notification information to be sent, a set of object reference relationships can be established first, that is, the corresponding relationship between each proxy object and the target proxy interface can be established, that is, each proxy object can be entrusted to Principal agent. FIG. 2 is a schematic flowchart of a communication method provided by Embodiment 2 of the present invention. As shown in Figure 2, the method includes:
本实施例中的S240至S260的具体实施例方式,可以参见实施例一种的S110至S130,在此不再赘述。For specific implementation manners of S240 to S260 in this embodiment, reference may be made to S110 to S130 in Embodiment 1, which will not be repeated here.
S210、创建待存储引用关系集合,并拟定与目标接口对应的接口协议。S210. Create a set of reference relationships to be stored, and draw up an interface protocol corresponding to the target interface.
其中,引用关系集合为存储与各个代理对象相对应的引用关系,可选的,引用关系中存储的可以是:与代理对象B相对应的指针标识,以及与代理对象B相对应的代理优先级。目标接口可以是发送通知信息的接口,可选的,若委托方A向各个被委托方,即代理对象B、C、D发送通讯,那么与委托方A相对应的接口可以作为目标接口。每个接口均存在与其相对应的接口协议。Wherein, the reference relationship set is to store the reference relationship corresponding to each proxy object. Optionally, what is stored in the reference relationship may be: a pointer identifier corresponding to the proxy object B, and a proxy priority corresponding to the proxy object B . The target interface may be an interface for sending notification information. Optionally, if the entrusting party A sends communication to each entrusted party, that is, proxy objects B, C, and D, then the interface corresponding to entrusting party A may be used as the target interface. Each interface has an interface protocol corresponding to it.
具体的,基于预设程序代码创建待存储引用关系的集合,并确定与目标接口相对应的接口协议。Specifically, a set of reference relationships to be stored is created based on preset program codes, and an interface protocol corresponding to the target interface is determined.
S220、每一个待处理代理对象继承接口协议,得到与待处理代理对象相对应的代理对象。S220. Each proxy object to be processed inherits the interface protocol to obtain a proxy object corresponding to the proxy object to be processed.
其中,待处理代理对象可以理解为,需要继承目标接口协议,即需要经过目标接口发送通知信息的代理对象。将处理后的待处理对象作为代理对象。Wherein, the proxy object to be processed can be understood as a proxy object that needs to inherit the target interface protocol, that is, needs to send notification information through the target interface. Use the processed pending object as a proxy object.
具体的,预先写一个注册代理的函数,将待处理代理对象作为传参进行处理,得到与待处理对象对应的代理对象。Specifically, a function for registering a proxy is written in advance, and the proxy object to be processed is processed as a parameter to obtain the proxy object corresponding to the object to be processed.
也就是说,调用注册API,可以生成包含delegate(代理对象)和其对应的指针标识。That is to say, calling the registration API can generate a delegate (proxy object) and its corresponding pointer identifier.
S230、确定与代理对象相对应的指针标识,以及代理优先级,并将指针标识以及代理优先级存储至待存储引用关系集合中,得到引用关系集合。S230. Determine the pointer identifier corresponding to the proxy object and the proxy priority, and store the pointer identifier and the proxy priority in the set of reference relationships to be stored to obtain the set of reference relationships.
其中,指针标识是代理对象的唯一标识。基于指针标识可以查找到代理对象。引用关系集合中存储与每个代理对象对应的指针标识,以及代理优先级。用户可以根据实际需求设置每个代理对象的代理优先级。Wherein, the pointer identifier is the unique identifier of the proxy object. The proxy object can be found based on the pointer identifier. The pointer identifier corresponding to each proxy object and the proxy priority are stored in the reference relation set. Users can set the proxy priority of each proxy object according to actual needs.
具体的,在基于注册代理函数对待处理代理对象处理后,可以得到代理对象,以及与代理对象对应的指针标识。进一步的,可以按照预设规则,例如,每个代理对象对通知信息处理的先后顺序,可以确定每个代理对象的代理优先级,并将代理优先级存储至引用关系集合delegateArr中。Specifically, after the proxy object to be processed is processed based on the registered proxy function, the proxy object and the pointer identifier corresponding to the proxy object can be obtained. Further, the proxy priority of each proxy object can be determined according to preset rules, for example, the order in which each proxy object processes notification information, and the proxy priority can be stored in the reference relationship set delegateArr.
也就是说,只要委托方持有了被委托方的对象引用关系,就可以实现基于delegate通信机制的一对多通信。即,把委托方注册到委托方的结合数组中,通过遍历可以实现一对多通信。That is to say, as long as the delegating party holds the object reference relationship of the delegating party, one-to-many communication based on the delegate communication mechanism can be realized. That is, the client is registered in the combination array of the client, and one-to-many communication can be realized through traversal.
S240、获取待发送的通知信息,以及通知信息中的标识信息。S240. Obtain notification information to be sent and identification information in the notification information.
S250、基于标识信息,从预先建立的对象引用关系集合中确定与标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级。S250. Based on the identification information, determine at least one pointer ID corresponding to the identification information and a proxy priority corresponding to each pointer ID from a set of pre-established object reference relationships.
指针标识与代理对象相对应。The pointer identifier corresponds to the proxy object.
S260、根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象。S260. According to the pointer identifier and the proxy priority, determine the target proxy object and send notification information to the target proxy object in sequence.
本发明实施例的技术方案,通过获取待发送的通知信息,以及通知信息中的标识信息;基于标识信息,从预先建立的对象引用关系集合中确定与标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;指针标识与代理对象相对应;根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象,解决了现有技术中频繁通过notification的方式实现一对多通讯时,由于不关注通知信息发送过程,导致存在代码臃肿,不便于后期维护的问题,实现了通过delegate进行一对多通讯,不仅避免了通过notification进行消息发送时存在代码臃肿的问题,还实现了消息发送效率的技术效果。In the technical solution of the embodiment of the present invention, by obtaining the notification information to be sent and the identification information in the notification information; based on the identification information, at least one pointer identification corresponding to the identification information and the identification information corresponding to the identification information are determined from the set of pre-established object reference relationships. The proxy priority corresponding to each pointer identifier; the pointer identifier corresponds to the proxy object; according to the pointer identifier and the proxy priority, the target proxy object is determined and the notification information is sent to the target proxy object in turn, which solves the problem of frequent passing through in the prior art When one-to-many communication is realized by means of notification, due to not paying attention to the sending process of notification information, there are problems of bloated code and inconvenient maintenance in the later stage. One-to-many communication through delegate is realized, which not only avoids the problem of sending messages through notification The problem of bloated code has also achieved the technical effect of message sending efficiency.
实施例三Embodiment three
作为上述实施例的一优选实施例,图3为本发明实施例二所提供的一种一种通讯方法另一流程是示意图。如图3所示,所述方法包括:As a preferred embodiment of the above embodiment, FIG. 3 is a schematic diagram of another flow of a communication method provided in Embodiment 2 of the present invention. As shown in Figure 3, the method includes:
S310、拟定协议接口、创建集合对象。S310. Draw up a protocol interface and create a collection object.
其中,拟定协议接口可以是与通讯发送方相对应的接口协议。集合可以理解为一个数组,主要用于存储各个代理对象。创建集合对象可以理解为创建存储通讯接收方对象引用关系集合。Wherein, the proposed protocol interface may be an interface protocol corresponding to the communication sender. A collection can be understood as an array, which is mainly used to store each proxy object. Creating a collection object can be understood as creating a collection storing communication receiver object reference relationships.
具体的,确定与通讯发送方相对应的接口协议,并创建集合对象。为了存储各个代理对象,可以在拟定协议接口,创建集合对象之后,初始化通讯接收方的集合对象delegateArr。Specifically, determine the interface protocol corresponding to the communication sender, and create a collection object. In order to store each proxy object, after drawing up the protocol interface and creating the collection object, initialize the collection object delegateArr of the communication receiver.
S320、注册添加被委托方。S320. Register to add the entrusted party.
其中,可以将通讯接收对象作为被委托方。Among them, the recipient of the communication can be used as the entrusted party.
具体的,在拟定接口协议,创建集合对象后,可以确定各个被委托方,调用注册API,生成与各个被委托方相对应的代理对象,并确定与各个代理对象相对应的指针标识,可以将该指针标识存储至预先创建的集合对象delegateArr中。进一步的,在确定与各个代理对象对应的指针标识后可以根据代理对象的属性信息,确定与每个代理对象的代理优先级,并将该代理优先级存储至集合对象delegateArr中。Specifically, after drawing up the interface protocol and creating the collection object, you can determine each delegated party, call the registration API, generate proxy objects corresponding to each delegated party, and determine the pointer identifier corresponding to each proxy object. The pointer identifier is stored in the pre-created collection object delegateArr. Further, after determining the pointer identifier corresponding to each proxy object, the proxy priority of each proxy object can be determined according to the attribute information of the proxy object, and the proxy priority can be stored in the collection object delegateArr.
需要说明的是,集合对象中包括与每个代理对象对应的指针标识以及优先级,这样设置的好处在于,在委托方发出通信时,可以基于对象集合中的代理优先级,控制一对多通讯的先后顺序。It should be noted that the collection object includes the pointer identifier and priority corresponding to each proxy object. The advantage of this setting is that when the entrusting party sends a communication, it can control one-to-many communication based on the priority of the proxy in the object collection in the order of precedence.
S330、协议委托方发出委托。S330. The protocol entrusting party issues an entrustment.
示例性的,可以将协议委托方标记为A,注册了delegate协议的被委托包括至少三个,可选的,被委托方的数量为三个,分别标记为B、C、D。也就是说,当委托方A需要向被委托方发送消息时,可以由委托方A可以发出委托。Exemplarily, the protocol entrusting party may be marked as A, and there are at least three entrusted parties registered with the delegate protocol. Optionally, the number of entrusted parties is three, marked as B, C, and D respectively. That is to say, when the entrusting party A needs to send a message to the entrusted party, the entrusting party A can issue the entrustment.
S340、接收委托方发送的委托。S340. Receive the entrustment sent by the entrusting party.
具体的,当委托方发送委托时,可以从集合对象delegateArr中获取与该委托方相对应的指针标识,以及与各个指针标识相对应的代理优先级。根据代理优先级,可以确定向与各个指针标识相对应的代理对象发送委托的先后顺序,并基于该顺序依次将通讯发送至各个被委托方。Specifically, when the delegator sends a delegation, the pointer ID corresponding to the delegator and the proxy priority corresponding to each pointer ID can be obtained from the collection object delegateArr. According to the proxy priority, the order of sending entrustment to the proxy objects corresponding to each pointer identifier can be determined, and the communication is sent to each entrusted party sequentially based on the order.
示例性的,委托方标记为A,将被委托方分别标记为B、C、D,且B的优先级高于C的优先级,C的优先级高于D的优先级,相应的,与被委托方相对应的指针标识分别为B’、C’、D’,将指针标识,以及代理优先级存储至对象集合delegateArr中。在委托方发出委托时,可以确定与委托方对应的被委托方,并从对象集合中确定与被委托方相对应的指针标识以及代理优先级。B的优先级最高,可以根据与被委托方B对应的指针标识,查找到B代理对象,并将通知信息发送至B代理对象。根据代理优先级,以及指针标识依次查找被委托对象,并将通知信息发送至各个代理对象B、C、D。Exemplarily, the entrusting party is marked as A, and the entrusted parties are respectively marked as B, C, and D, and the priority of B is higher than that of C, and the priority of C is higher than that of D. Correspondingly, with The pointer IDs corresponding to the delegated parties are B', C', and D' respectively, and the pointer IDs and proxy priority are stored in the object collection delegateArr. When the entrusting party issues a delegation, it can determine the entrusted party corresponding to the entrusting party, and determine the pointer ID and proxy priority corresponding to the entrusted party from the object collection. B has the highest priority, and the proxy object of B can be found according to the pointer identifier corresponding to the entrusted party B, and the notification information is sent to the proxy object of B. According to the proxy priority and the pointer identifier, the delegated objects are searched in turn, and the notification information is sent to each proxy object B, C, and D.
本发明实施例采用此种方式的好处在于,可以更好的管理各个信息接收者,即委托方或代理对象,这是因为:Delegate协议有@optional和required两个声明,可以要求委托方必须实现哪些方法,在发送委托时,也会检测委托者是否实现了delegate协议;委托方添加多个被委托方,在项目代码的结构比较清晰,可以通过集合数组看到对应的代理方信息。The advantage of using this method in the embodiment of the present invention is that it can better manage each information receiver, that is, the entrusting party or the proxy object. This is because: the Delegate protocol has two declarations @optional and required, which can require the entrusting party to implement Which methods will also detect whether the delegator has implemented the delegate protocol when sending the delegation; the delegator adds multiple delegators, the structure of the project code is relatively clear, and the corresponding agent information can be seen through the collection array.
需要说明的是,本发明实施例的技术方案,并不是完全取代了notification,而是与notification相辅相成的。这是因为notificaiton的全局性比较强,而且发送者只管发送不管结果,适合做全局通知,轻耦合性;而delegate以委托的方式,更适合一些小场景,比如我在网路请求库要实现一个对外的处理response的协议接口,就可以用delegate这种一对多的代理通讯方式,针对性更强。It should be noted that the technical solution in the embodiment of the present invention does not completely replace the notification, but complements the notification. This is because the notificaiton is more global, and the sender just sends regardless of the result, which is suitable for global notification and light coupling; while the delegate method is more suitable for some small scenarios. For example, I want to implement a network request library. The protocol interface for externally processing the response can use the one-to-many proxy communication method of delegate, which is more targeted.
S350、实现协议内容。S350. Realize the protocol content.
可以理解为,实现通讯。It can be understood as realizing communication.
S360、注销、完成delegate一对多通讯。S360, logout, and complete the delegate one-to-many communication.
在上述技术方案的基础上,需要说明的是,在委托方不需要与上述对象集合中的至少一个委托对象实现通讯时,可以将委托方的指针特征从对象集合中移出,以便在委托方发送委托时,可以避免从对象集合中查找到该委托对象。On the basis of the above technical solution, it should be noted that when the entrusting party does not need to communicate with at least one entrusting object in the above object set, the entrusting party’s pointer feature can be removed from the object set so that the entrusting party can send When delegating, you can avoid finding the delegate object from the object collection.
具体的,当委托方不需要与对象集合中的至少一个对象通讯时,可以调用注销API,将指针标识从对象集合中删除,相应的,与其指针标识对应的代理对象也可以从其他集合中移除。当然,若需要重新实现委托方与被委托方之间的通讯,可以重复执行S310至S340。Specifically, when the client does not need to communicate with at least one object in the object collection, it can call the logout API to delete the pointer ID from the object collection. Correspondingly, the proxy object corresponding to the pointer ID can also be removed from other collections. remove. Of course, if it is necessary to re-implement the communication between the entrusting party and the entrusted party, S310 to S340 can be executed repeatedly.
本发明实施例的技术方案,通过获取待发送的通知信息,以及通知信息中的标识信息;基于标识信息,从预先建立的对象引用关系集合中确定与标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;指针标识与代理对象相对应;根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象,解决了现有技术中频繁通过notification的方式实现一对多通讯时,由于不关注通知信息发送过程,导致存在代码臃肿,不便于后期维护的问题,实现了通过delegate进行一对多通讯,不仅避免了通过notification进行消息发送时存在代码臃肿的问题,还实现了消息发送效率的技术效果。In the technical solution of the embodiment of the present invention, by obtaining the notification information to be sent and the identification information in the notification information; based on the identification information, at least one pointer identification corresponding to the identification information and the identification information corresponding to the identification information are determined from the set of pre-established object reference relationships. The proxy priority corresponding to each pointer identifier; the pointer identifier corresponds to the proxy object; according to the pointer identifier and the proxy priority, the target proxy object is determined and the notification information is sent to the target proxy object in turn, which solves the problem of frequent passing through in the prior art When one-to-many communication is realized by means of notification, due to not paying attention to the sending process of notification information, there are problems of bloated code and inconvenient maintenance in the later stage. One-to-many communication through delegate is realized, which not only avoids the problem of sending messages through notification The problem of bloated code has also achieved the technical effect of message sending efficiency.
实施例四Embodiment four
图4为本发明实施例四所提供的一种通讯装置结构示意图,该装置包括:标识信息确定模块410、属性信息获取模块420和通知信息发送模块430。FIG. 4 is a schematic structural diagram of a communication device provided by Embodiment 4 of the present invention. The device includes: an identification
其中,标识信息确定模块410,用于获取待发送的通知信息,以及所述通知信息中的标识信息;属性信息获取模块420,用于基于所述标识信息,从预先建立的对象引用关系集合中确定与所述标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;所述指针标识与代理对象相对应;通知信息发送模块430,用于根据所述指针标识以及代理优先级,确定目标代理对象以及将所述通知信息依次发送至目标代理对象。Among them, the identification
本发明实施例的技术方案,通过获取待发送的通知信息,以及通知信息中的标识信息;基于标识信息,从预先建立的对象引用关系集合中确定与标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;指针标识与代理对象相对应;根据指针标识以及代理优先级,确定目标代理对象以及将通知信息依次发送至目标代理对象,解决了现有技术中频繁通过notification的方式实现一对多通讯时,由于不关注通知信息发送过程,导致存在代码臃肿,不便于后期维护的问题,实现了通过delegate进行一对多通讯,不仅避免了通过notification进行消息发送时存在代码臃肿的问题,还实现了消息发送效率的技术效果。In the technical solution of the embodiment of the present invention, by obtaining the notification information to be sent and the identification information in the notification information; based on the identification information, at least one pointer identification corresponding to the identification information and the identification information corresponding to the identification information are determined from the set of pre-established object reference relationships. The proxy priority corresponding to each pointer identifier; the pointer identifier corresponds to the proxy object; according to the pointer identifier and the proxy priority, the target proxy object is determined and the notification information is sent to the target proxy object in turn, which solves the problem of frequent passing through in the prior art When one-to-many communication is realized by means of notification, due to not paying attention to the sending process of notification information, there are problems of bloated code and inconvenient maintenance in the later stage. One-to-many communication through delegate is realized, which not only avoids the problem of sending messages through notification The problem of bloated code has also achieved the technical effect of message sending efficiency.
在上述技术方案的基础上,所述装置还包括:引用关系集合建立模块,用于:建立对象引用关系集合;On the basis of the above technical solution, the device further includes: a reference relationship set establishment module, configured to: establish an object reference relationship set;
所述引用关系结合建立模块,包括:The reference relationship is combined with building modules, including:
集合创建单元,用于创建待存储引用关系集合,并拟定与目标接口对应的接口协议;代理对象确定模块,用于每一个待处理代理对象继承所述接口协议,得到与所述待处理代理对象相对应的代理对象;引用集合确定单元,用于确定与所述代理对象相对应的指针标识,以及代理优先级,并将所述指针标识以及所述代理优先级存储至所述待存储引用关系集合中,得到引用关系集合。A set creation unit is used to create a collection of reference relationships to be stored, and to draw up an interface protocol corresponding to the target interface; a proxy object determination module is used for each proxy object to be processed to inherit the interface protocol, and obtain the proxy object corresponding to the target interface Corresponding proxy object; a reference set determination unit, configured to determine a pointer identifier corresponding to the proxy object, and a proxy priority, and store the pointer identifier and the proxy priority in the reference relationship to be stored In the collection, the collection of reference relations is obtained.
在上述各技术方案的基础上,所述属性信息获取模块,还用于:根据所述标识信息,可以从对象引用关系集合中确定继承所述接口协议的至少一个指针标识,以及与每个指针标识对应的代理优先级。On the basis of the above technical solutions, the attribute information acquisition module is further configured to: according to the identification information, determine at least one pointer identifier that inherits the interface protocol from the object reference relationship set, and each pointer Identifies the corresponding proxy priority.
在上述各技术方案的基础上,所述通知信息发送模块,还用于:根据所述代理优先级,确定优先级最高时所对应的指针标识;基于所述指针标识,获取与所述指针标识相对应的目标代理对象,并将所述通知信息发送至所述目标代理对象,以使所述目标代理对象与所述目标接口实现协议内容。On the basis of the above technical solutions, the notification information sending module is further configured to: according to the agent priority, determine the pointer identifier corresponding to the highest priority; based on the pointer identifier, obtain the pointer identifier corresponding target proxy object, and send the notification information to the target proxy object, so that the target proxy object and the target interface realize the agreement content.
在上述各技术方案的基础上,所述装置还包括:指针对象删除模块,用于:当接收到注销代理对象的注销命令时,基于所述注销命令将指针标识从对象引用关系集合中移出。On the basis of the above technical solutions, the device further includes: a pointer object deletion module, configured to: when receiving a logout command to logout the proxy object, remove the pointer identifier from the object reference relationship set based on the logout command.
在上述各技术方案的基础上,所述指针对象删除模块还包括:待删除指针标识确定单元,用于当接收到注销代理对象的注销命令时,获取与所述注销命令相对应的待删除指针标识;删除单元,用于调用删除程序,将所述待删除指针标识从所述引用关系集合中移除。On the basis of the above technical solutions, the pointer object deletion module further includes: a pointer to be deleted identification determination unit, which is used to obtain the pointer to be deleted corresponding to the logout command when receiving a logout command for the logout proxy object An identifier; a deletion unit, configured to invoke a deletion program to remove the identifier of the pointer to be deleted from the set of reference relationships.
本发明实施例所提供的通讯装置可执行本发明任意实施例所提供的通讯方法,具备执行方法相应的功能模块和有益效果。The communication device provided by the embodiment of the present invention can execute the communication method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
值得注意的是,上述装置所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明实施例的保护范围。It is worth noting that the units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only In order to facilitate mutual distinction, it is not used to limit the protection scope of the embodiments of the present invention.
实施例五Embodiment five
图5为本发明实施例四提供的一种设备的结构示意图。图5示出了适于用来实现本发明实施例实施方式的示例性设备50的框图。图5显示的设备50仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 5 is a schematic structural diagram of a device provided by Embodiment 4 of the present invention. Figure 5 shows a block diagram of an
如图5所示,设备50以通用计算设备的形式表现。设备50的组件可以包括但不限于:一个或者多个处理器或者处理单元501,系统存储器502,连接不同系统组件(包括系统存储器502和处理单元501)的总线503。As shown in FIG. 5,
总线503表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。
设备50典型地包括多种计算机系统可读介质。这些介质可以是任何能够被设备50访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。
系统存储器502可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)504和/或高速缓存存储器505。设备50可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统506可以用于读写不可移动的、非易失性磁介质(图5未显示,通常称为“硬盘驱动器”)。尽管图5中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线503相连。存储器502可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。
具有一组(至少一个)程序模块507的程序/实用工具508,可以存储在例如存储器502中,这样的程序模块507包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块507通常执行本发明所描述的实施例中的功能和/或方法。A program/
设备50也可以与一个或多个外部设备509(例如键盘、指向设备、显示器510等)通信,还可与一个或者多个使得用户能与该设备50交互的设备通信,和/或与使得该设备50能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口411进行。并且,设备50还可以通过网络适配器512与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器512通过总线503与设备50的其它模块通信。应当明白,尽管图5中未示出,可以结合设备50使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
处理单元501通过运行存储在系统存储器502中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的通讯方法。The
实施例六Embodiment six
本发明实施例六还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行通讯方法。Embodiment 6 of the present invention also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute a communication method when executed by a computer processor.
该方法包括:The method includes:
获取待发送的通知信息,以及所述通知信息中的标识信息;Obtain the notification information to be sent, and the identification information in the notification information;
基于所述标识信息,从预先建立的对象引用关系集合中确定与所述标识信息相对应的至少一个指针标识以及与每个指针标识相对应的代理优先级;所述指针标识与代理对象相对应;Based on the identification information, determine at least one pointer identification corresponding to the identification information and a proxy priority corresponding to each pointer identification from a pre-established object reference relationship set; the pointer identification corresponds to a proxy object ;
根据所述指针标识以及代理优先级,确定目标代理对象以及将所述通知信息依次发送至目标代理对象。According to the pointer identifier and proxy priority, determine the target proxy object and send the notification information to the target proxy object in sequence.
本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium in the embodiments of the present invention may use any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. 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 (non-exhaustive list) of computer readable storage media include: electrical connections with one or more leads, portable computer disks, 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 this document, 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.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave. 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. .
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。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.
可以以一种或多种程序设计语言或其组合来编写用于执行本发明实施例操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of embodiments of the present invention may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, including A conventional procedural programming language - such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, rearrangements and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010311453.1A CN111510499B (en) | 2020-04-20 | 2020-04-20 | Communication method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010311453.1A CN111510499B (en) | 2020-04-20 | 2020-04-20 | Communication method, device, equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111510499A CN111510499A (en) | 2020-08-07 |
| CN111510499B true CN111510499B (en) | 2023-06-13 |
Family
ID=71864846
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010311453.1A Active CN111510499B (en) | 2020-04-20 | 2020-04-20 | Communication method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111510499B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113630465B (en) * | 2021-08-10 | 2024-03-12 | 北京百度网讯科技有限公司 | Message processing method, device, equipment and storage medium |
| CN114979260B (en) * | 2022-05-12 | 2023-09-15 | 深圳市绿联科技股份有限公司 | Protocol-based communication method and device, electronic equipment and storage medium |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105208118A (en) * | 2009-06-03 | 2015-12-30 | 高通股份有限公司 | Systems And Methods For Creating Virtual Universal Plug-And-Play Systems |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6951022B1 (en) * | 2001-03-14 | 2005-09-27 | Microsoft Corporation | Delegate-based event handling |
| JP4546040B2 (en) * | 2003-05-12 | 2010-09-15 | キヤノン株式会社 | Network service system, service agent processing method, computer-readable storage medium storing program, and program |
| US8832676B2 (en) * | 2009-09-30 | 2014-09-09 | Zynga Inc. | Apparatuses, methods and systems for a social networking application updater |
| CN110490747A (en) * | 2019-08-26 | 2019-11-22 | 深圳市盟天科技有限公司 | A kind of trust interconnection method, device, server and storage medium |
-
2020
- 2020-04-20 CN CN202010311453.1A patent/CN111510499B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105208118A (en) * | 2009-06-03 | 2015-12-30 | 高通股份有限公司 | Systems And Methods For Creating Virtual Universal Plug-And-Play Systems |
Non-Patent Citations (1)
| Title |
|---|
| 王雪涛 ; 樊银亭 ; .Observer模式在.net架构中的应用研究.华北水利水电学院学报.2008,(第04期),全文. * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111510499A (en) | 2020-08-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110032459B (en) | Message queue configuration method and device, computer equipment and storage medium | |
| CN109194736B (en) | Message duplicate removal method and device, electronic equipment, medium and unmanned vehicle | |
| US20180329860A1 (en) | Remote direct memory access (rdma) high performance producer-consumer message processing | |
| WO2019218718A1 (en) | Blockchain network transaction processing method, apparatus, device, and storage medium | |
| CN104866290B (en) | A kind of method and apparatus for data transmission | |
| CN111510499B (en) | Communication method, device, equipment and storage medium | |
| CN112689020B (en) | A message transmission method, message middleware, electronic equipment and storage medium | |
| CN117453582A (en) | Data transmission methods, equipment and storage media | |
| CN114528044A (en) | Interface calling method, device, equipment and medium | |
| CN114116184B (en) | Data processing method and device in virtual scene, equipment and medium | |
| CN116668564A (en) | Multi-mode network message processing method, device, equipment and readable storage medium | |
| CN110807161A (en) | Page framework rendering method, device, equipment and medium | |
| CN111385255B (en) | Asynchronous call implementation method, device, server and server cluster | |
| CN109151033A (en) | Communication means, device, electronic equipment and storage medium based on distributed system | |
| CN103795764B (en) | A cloud service trigger method, cloud server and thin client | |
| WO2023217187A1 (en) | Service response method and apparatus, device, and storage medium | |
| CN112131013A (en) | Method, device, device and storage medium for monitoring call chain in distributed system | |
| CN112769876B (en) | Method, device, equipment and medium for acquiring equipment channel information | |
| CN109686415B (en) | Data transmission method, management platform, electronic device and storage medium | |
| US20160197849A1 (en) | Method and Apparatus for Implementing a Messaging Interface | |
| CN113986995A (en) | Request distribution method, device, storage medium and electronic device | |
| CN109068170B (en) | Storage method, device, terminal and storage medium for barrage message | |
| US10949095B2 (en) | Method, network adapters and computer program product using network adapter memory to service data requests | |
| US20170063966A1 (en) | Real time data streaming from a mainframe computer to off platform destinations | |
| CN117194068A (en) | Cross-process data transmission method, system, equipment and storage 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| OL01 | Intention to license declared | ||
| OL01 | Intention to license declared |