Communication method, device and electronic device
By setting event units in the functional components, direct communication between functional components is achieved, the communication complexity problem caused by complex nested relationships is solved, and the scalability and maintainability of the system are improved.
Patent Information
- Application Number
- CN202010775473.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-04
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-08-04
AI Technical Summary
The communication process between functional components with nested relationships is complex, resulting in low scalability and maintainability of the system.
By setting event units in each functional component, direct communication between functional components is achieved, interdependence between functional components is avoided, and the communication process is simplified.
Improve the independence of functional components, simplify the communication process, and improve the scalability and maintainability of the system.
Smart Images

Figure CN111930540B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a communication method, device and electronic device. Background Art
[0002] In a system composed of multiple modules (each module can perform corresponding functions), there will be interdependence between the modules. This dependency requires each module to perform layer-by-layer callbacks through agents when communicating between modules. When there are many nested modules in a tree-structured system, the communication method between modules becomes more complicated. Summary of the invention
[0003] This disclosure section is provided to introduce concepts in a brief form, which will be described in detail in the detailed description section below. This disclosure section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] The embodiments of the present disclosure provide a communication method, an apparatus, and an electronic device. When communication is required between functional components having a nested relationship, communication can be performed through a time unit with each functional component, that is, communication between the functional components can be achieved through an event unit. This eliminates the need for mutual dependence between the functional components, thus simplifying the communication method between the functional components having a nested relationship, thereby improving the scalability and maintainability of the entire system.
[0005] In a first aspect, an embodiment of the present disclosure provides a communication method, which is applied to a first type event unit, wherein the first type event unit is an event unit corresponding to a first type functional component in at least two functional components having a nested relationship, and the at least one functional component includes: a first type functional component and a second type functional component, the first type functional component has a subordinate functional component, the functional component corresponds to the event unit one-to-one, the event unit is used to support communication between the functional components, and the event unit records parameters that the corresponding functional component can respond to and / or parameters that the subordinate functional component of the functional component can respond to; the method includes: in response to receiving a data change instruction sent by a subordinate event unit, determining the target parameter indicated by the data change instruction; determining whether the recorded parameters include the target parameter, and generating a determination result; and determining a processing method for the data change instruction based on the determination result.
[0006] In a second aspect, an embodiment of the present disclosure provides a communication device, comprising: an event unit applied to a first type, wherein the first type event unit is an event unit corresponding to a first type functional component in at least two functional components having a nested relationship, and the at least one functional component comprises: a first type functional component and a second type functional component, the first type functional component has a subordinate functional component, the functional component corresponds to the event unit one-to-one, the event unit is used to support communication of the functional components, and the event unit records parameters that the corresponding functional component can respond to and / or parameters that the subordinate functional component of the functional component can respond to; the device comprises: a first determination unit, for determining, in response to receiving a data change instruction sent by a subordinate event unit, a target parameter indicated by the data change instruction; a second determination unit, for determining whether the recorded parameters include the target parameter, and generating a determination result; a third determination unit, for determining, based on the determination result, a method for processing the data change instruction.
[0007] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the communication method as described above in the first aspect.
[0008] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the communication method described above in the first aspect.
[0009] In the communication method, device and electronic device provided by the embodiment of the present disclosure, after the first type event unit receives the data change instruction sent by the subordinate event unit, it will determine whether the target parameter indicated by the data change instruction is recorded; and according to the determination result, the processing method of the data change instruction can be determined. That is, by setting a corresponding event unit for each functional component, the functional component in which the data change occurs in at least two functional components with a nested relationship can be used as a subordinate functional component, and the subordinate event unit corresponding to the functional component can generate a data change instruction, and send the data change instruction to the corresponding superior event unit, and the processing method of the data change instruction can be determined by the superior event unit. There is no need to associate the functional component that generates the data change instruction with the functional component that processes the data change instruction as in the prior art. Therefore, compared with the existing communication method, the technical solution of the present disclosure can make each functional component relatively independent, and simplify the communication process between functional components, and because each functional component is relatively independent, the system composed of at least two functional components can have high maintainability and scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0011] Figure 1 is a flow chart of an embodiment of a communication method according to the present disclosure;
[0012] Figure 2 is a structural schematic diagram of another embodiment of the communication method according to the present disclosure;
[0013] Figure 3A is a schematic diagram of an exemplary application scenario of another embodiment of the communication method according to the present disclosure;
[0014] Figure 3B is a schematic diagram of an exemplary application scenario of another embodiment of the communication method according to the present disclosure;
[0015] Figure 4 is a schematic structural diagram of an embodiment of a communication device according to the present disclosure;
[0016] Figure 5 is an exemplary system architecture in which a communication method of an embodiment of the present disclosure may be applied;
[0017] Figure 6 It is a schematic diagram of the basic structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0019] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0020] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0021] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0022] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0024] Please refer to Figure 1 , which shows a process of an embodiment of a communication method according to the present disclosure. The communication method can be applied to a terminal device.
[0025] In some embodiments, the communication method may be applied to a first type event unit.
[0026] Here, the first type event unit is an event unit corresponding to the first type functional component in at least two functional components having a nested relationship, at least one functional component includes: a first type functional component and a second type functional component, the first type functional component has a subordinate functional component, the functional components correspond to the event units one-to-one, the event unit is used to support communication between the functional components, and the event unit records the parameters that the corresponding functional component can respond to and / or the parameters that the subordinate functional components of the functional component can respond to.
[0027] In some embodiments, the second type functional component has no corresponding subordinate functional component, while the first type functional component has a corresponding subordinate functional component. Since the event unit corresponds to the functional component one-to-one, it can be understood that the event unit is divided into a first type event unit and a second type event unit. The second type event unit can be used to record the parameters that the corresponding second type functional component can respond to, while the first type event unit can record the parameters that the corresponding first type functional component can respond to and the parameters that the subordinate functional component of the first type functional component can respond to.
[0028] In some embodiments, since at least two functional components have a nested relationship, and the event unit is used to support communication between functional components, each event unit can constitute a tree system. It can be understood that the entire tree system includes: a first type event unit and a second type event unit. In the tree system, the correspondence between the upper event unit and the lower event unit can be characterized by a parent node and a child node, that is, the upper event unit can be called the parent node of the lower event unit, and correspondingly, the lower event unit is a child node. Therefore, the first type event unit corresponds to the parent node as a child node, and the second type event unit can only be a child node (the first type event unit corresponding to the functional component does not have a corresponding lower functional component). That is, the first type event unit can be used as a lower event unit, and the second type event unit can only be used as a lower event unit. When the functional component corresponding to the lower event unit changes data, the lower event unit can generate a data change instruction.
[0029] In order to facilitate the understanding of the relationship between the first type event unit and the second type event unit, as well as the relationship between the child node and the parent node, the following is combined with Figure 2 Give a detailed description. Figure 2 A tree system diagram provided in the embodiment of the present application, Figure 2 It can be seen that: since event unit A1, event unit A2, event unit A3, event unit A4, and event unit A5 have no child nodes (lower-level event units), it can be understood that event unit A1, event unit A2, event unit A3, event unit A4, and event unit A5 are second-type event units, and it can be seen that event unit A1, event unit A2, event unit A3, event unit A4, and event unit A5 can only be child nodes. Since event unit B1, event unit B2, event unit B3, and event unit C1 all have child nodes, event unit B1, event unit B2, event unit B3, and event unit C1 can be understood as first-type event units, and when event unit B3 is the parent node, event unit B1 and event unit A3 are child nodes, that is, event unit B3 can be both a parent node and a child node. Correspondingly, when event unit C1 is a parent node, event unit B1 and event unit B2 are child nodes (at this time, event unit B1 and event unit B2 are subordinate event units of event unit C1).
[0030] In this embodiment, the functional components can be used to implement relatively complete functions. For example, the tree system is a music playing system, and the functional components in this tree system may include a functional component for implementing lyrics display, a functional component for controlling the volume, and the like.
[0031] In some embodiments, the event unit corresponds to the functional component, that is, it can be understood that each event unit can correspond to a functional component, and the functions that can be performed by the functional component can be recorded in the corresponding event unit, and the parent node records the records in the corresponding child node, that is, it can be understood that: the upper-level event unit records the records in the corresponding lower-level event unit.
[0032] In some embodiments, when data changes occur in a functional component, the event unit corresponding to the functional component may generate a data change instruction, and the event unit may send the data change instruction out (to the corresponding superior event unit).
[0033] To make it easier to understand, let's continue with the example: Figure 2 The event unit A1 in corresponds to a functional component Model_A1 (which can be a functional component responsible for receiving comments), and the parameters that the functional component Model_A1 can process are recorded in the event unit A1. When the data of the functional component Model_A1 changes (when a new comment is received), the event unit A1 can generate a data change instruction and send the data change instruction to the event unit B3. The event unit B3 records the parameters recorded in the event unit A1 and the event unit A2, which can also be understood as: when the event unit B3 is the parent node, the event unit A1 and the event unit A2 are the child nodes of the event unit B3, that is, it can be understood as: the event unit B3 is the upper event unit of the event unit A1 and the event unit A2, and accordingly, the functional component Model_A1 corresponding to the event unit A1 and the functional component Model_A2 corresponding to the event unit A2 can be the lower functional components of the functional component Model_B3 corresponding to the event unit B3 (that is, the functional component Model_A1 and the functional component Model_A2 are the lower functional components of the functional component Model_B3).
[0034] The event unit A1 records the parameters to which the functional component Model_A1 can respond, the event unit A2 records the parameters to which the functional component Model_A2 can respond, and the event unit B3 records the parameters to which the functional components Model_A1, Model_A2 and Model_B3 can respond.
[0035] In some embodiments, since the functional component Model_A1 and the functional component Model_A2 are subordinate functional components of the functional component Model_B3, such as when the functional component Model_B3 is a personal status module, the functional component Model_A1 and the functional component Model_A2 can be respectively a comment module and a like module, that is, it can be understood that: when a user publishes a piece of information (one or more types of information such as articles, videos, pictures, etc.), others can comment on and like the information, and the number of readings, comments, likes, and reposts of the information can all be understood as personal status information, that is, processed by the personal status module. If it is found that the number of comments and likes is large, two modules can be separated to process the number of comments and likes. Only when the number of comments and / or likes changes, the change can be sent to the corresponding upper-level functional module.
[0036] like Figure 1 The communication method shown comprises the following steps:
[0037] Step 101, in response to receiving a data change instruction sent by a lower-level event unit, determining a target parameter indicated by the data change instruction.
[0038] In some embodiments, since the lower-level event unit can be a second-type event unit or part of the first-type event unit. When the lower-level event unit is a second-type event unit, it can be understood that: a data change has occurred in the functional component of the second-type event unit, so that the second-type event unit can generate a data change instruction and send the data change instruction to the corresponding first-type event unit (the first-type event unit at this time can be characterized as: the upper-level event unit (parent node) of the second-type event unit, that is, Figure 2 In the figure, when the lower-level event unit is event unit A1, after the data of the functional component Model_A1 corresponding to event unit A1 is changed, event unit A1 can generate a data change instruction and send the data change instruction to event unit B3. At this time, event unit B3 serves as a first type event unit).
[0039] In some embodiments, since some first-type event units can also serve as child nodes, when the lower-level functional component corresponding to the first-type event unit serving as a child node cannot respond to the target parameter indicated by the data change instruction, the data change instruction can continue to be passed upward. Figure 2In the example, when a data change instruction is issued by event unit A1 and the parameters recorded by event unit B3 do not include the target parameters, event unit B3 can send the data change instruction to event unit B1. At this time, event unit B3 can be understood as a child node of event unit B1, that is, event unit B3 is a subordinate event unit of event unit B1).
[0040] In some embodiments, when the first type event unit receives the data change instruction, it can determine the target parameter indicated by the data change instruction and continue to execute step 102 .
[0041] Step 102, determining whether the recorded parameters include target parameters, and generating a determination result.
[0042] In some embodiments, since the event unit records the parameters to which the corresponding functional component can respond, as well as the parameters to which the subordinate functional component corresponding to the functional component can respond, it is possible to determine whether the recorded parameters include the target parameters, and thus it is possible to determine whether the corresponding functional component or the subordinate functional component of the functional component can respond to the target parameters.
[0043] Step 103: Determine a processing method for the data change instruction according to the determination result.
[0044] In some embodiments, when the determination result is that the recorded parameters include the target parameters, the data change instruction can be sent to the event unit that records the target parameters. When the determination result is that the recorded parameters do not include the target parameters, the data change instruction can be sent to the superior event unit.
[0045] For ease of understanding, continue to combine Figure 2Explanation is given. For example, event unit B1 represents the first type of event unit, and the data change instruction is issued by event unit A3. After event unit B1 receives the data change instruction sent by event unit A3, event unit B1 will determine whether the target parameter indicated by the data change instruction is recorded. Since event unit B3 records the parameters recorded in event unit A1 and event unit A3, and event unit B1 records the parameters recorded in event unit B3 and event unit A3. Therefore, it can be understood that event unit B1 records: the parameters that the function components corresponding to event unit B1, the function components corresponding to event unit B3, the function components corresponding to event unit A1, the function components corresponding to event unit A2, and the function components corresponding to event unit A3 can respond to; and when the target parameter is not recorded in event unit B1, it can be represented that the function components corresponding to event unit B1, the function components corresponding to event unit B3, the function components corresponding to event unit A1, and the function components corresponding to event unit A2 do not respond to the target parameter. At this time, the data change instruction can be sent to event unit C1. If the target parameter is recorded in the event unit B1 and it is confirmed that the target parameter is also recorded in the event unit B3, the data change instruction can be sent to the instruction event unit B3.
[0046] It can be seen that in the present embodiment, after the first type of event unit receives the data change instruction sent by the subordinate event unit, it will determine whether the target parameter indicated by the data change instruction is recorded; and according to the determination result, the processing method of the data change instruction can be determined. That is, by setting a corresponding event unit for each functional component, the functional component in which the data change occurs in at least two functional components with a nested relationship can be used as a subordinate functional component, and the subordinate event unit corresponding to the functional component can generate a data change instruction, and send the data change instruction to the corresponding superior event unit, and the processing method of the data change instruction can be determined by the superior event unit. There is no need to associate the functional component that generates the data change instruction with the functional component that processes the data change instruction as in the prior art. Therefore, compared with the existing communication method, the technical solution disclosed in the present invention can make each functional component relatively independent, and simplify the communication process between functional components, and because each functional component is relatively independent, the system composed of at least two functional components can have high maintainability and scalability.
[0047] For ease of understanding, the tree-like system is a music playback system, in which the functional component Model_A1 is responsible for receiving comments, the functional component Model_A2 is used to receive likes, and the functional component Model_A3 is used to display the lyrics of the music. If in this music playback system, when displaying the lyrics of the music, the number of likes of the user for this song and some comments may also be displayed. Therefore, in order for the lyrics functional component Model_A5 to correctly display the comments and the number of likes when performing its function (displaying the lyrics of the music), it is necessary to correctly inform the functional component Model_A5 of the data change when the functional component Model_A1 and / or the functional component Model_A2 has data changes. For example, when the functional component Model_A1 has data changes, the event unit A1 will generate a data change instruction, and send the data change instruction to the event unit A5 in the order of: event unit B3, event unit B1, event unit C1, and event unit B2. After the event unit A5 receives the data change instruction, the functional component Model_A5 can be processed. Correspondingly, the transmission method when the functional component Model_A2 has data changes can be the same as that of the functional component Model_A1, so it will not be described here in detail.
[0048] It can be seen that although the functional components Model_A1 and Model_A2 are associated with the functional component Model_A5 at the business level, this application does not associate the functional components Model_A1 and Model_A2 with the functional component Model_A5 as in the prior art; thus, when the data of the functional components Model_A1 and / or Model_A2 changes, the data change is directly sent to the functional component Model_A5. Instead, a data change instruction is generated and sent to the parent node, and finally the data is transmitted to the functional component Model_A5, thereby reducing the dependency between the functional components in the tree system, and making the tree system more maintainable and scalable.
[0049] In some embodiments, the correspondence between child nodes and parent nodes in a tree system can be determined by subscription. For example, event unit B1 can subscribe to event unit C1 as its parent node. Correspondingly, event unit B1 can also subscribe to event unit B3 and event unit A3 as its child nodes. Correspondingly, event unit A1 and event unit A2 can subscribe to event unit B3 as a parent node. The subscription method of other event units is similar to the above subscription method, and will not be repeated here for the sake of brevity of the specification. It can be seen from the above subscription method that each child node has only one parent node, and each parent node may have multiple child nodes.
[0050] In some embodiments, event unit A1 can monitor the data changes of functional component Model_A1, that is, when event unit A1 monitors the data changes of functional component Model_A1, it can generate a data change instruction, and only needs to send the data change instruction to event unit B3. In other words, all data change instructions that event unit A1 needs to send only need to be sent to event unit B3, without associating event unit A1 with other event units, thereby simplifying the difficulty of communication among event units in the tree system.
[0051] In some embodiments, in the following two situations, the first type event unit will receive the data change instruction sent by the corresponding subordinate event unit.
[0052] Case 1: When the second type event unit as a subordinate event unit monitors the data change of the corresponding functional component, the second type event unit as a subordinate event unit generates a corresponding data change instruction. Since the second type event unit has no corresponding subordinate event unit, when generating a data change instruction, it only needs to send the data change instruction to the corresponding parent node (the corresponding first type event unit, such as Figure 2 As shown, when data changes occur in the functional component Model_A1, the event unit A1 can generate a data change instruction and send the data change instruction to the event unit B3).
[0053] In case 2, when the subordinate event unit is a first type event unit and the target parameter indicated by the data change instruction is not recorded in the first type event unit, the first type event unit can send the data change instruction to the corresponding superior event unit.
[0054] It can be seen that in the embodiments of the present disclosure, the various functional components do not need to be associated with each other, and only the corresponding event unit needs to send out the data change instruction when the data changes.
[0055] For easier understanding, please refer to Figure 2To illustrate, for example: a data change instruction is generated by event unit A1, and event unit A3 can respond to the target parameter indicated by the data change instruction, then the transmission path of the data change instruction can be understood as: when event unit B3 receives the data change instruction, at this time, event unit B3 acts as a parent node, and can determine whether event unit A2, as a child node, can respond to the target parameter. If event unit A2 cannot respond, the data change instruction can be transmitted to event unit B1. When event unit B1 receives the data change instruction, event unit B1 acts as a parent node, and can determine whether event unit A3, as a child node, can respond to the target parameter. If event unit A3 can respond to the target parameter, event unit B1 can send the target parameter to event unit A3. In the above process, when event unit B3 acts as a parent node, it is case one, and when event unit B1 acts as a parent node, it is case two.
[0056] In some embodiments, since the parent node records the parameters to which the child node can respond, when an event unit receives a data change instruction sent by the parent node (upper-level event unit), it can be represented that the functional component corresponding to the event unit can respond to the data change instruction, or the subordinate functional component of the functional component can respond to the data change instruction.
[0057] Continue reading Figure 2 For example, when the event unit B2 receives a data change instruction sent by the event unit C1, it only needs to determine whether to send the data change instruction to the event unit A4 and / or the event unit A5 according to the target parameters indicated by the data change instruction.
[0058] In some embodiments, in response to any of the following, the parameters recorded by the first type event unit are updated:
[0059] Deleting the subordinate functional component of the first type functional component corresponding to the first type event unit;
[0060] A new subordinate functional component is added to the first type functional component corresponding to the first type event unit.
[0061] like Figure 3A As shown, when the functional component corresponding to the event unit B5 needs to be deleted (the functional component corresponding to the event unit B5 and the event unit A5 will be deleted), it will not affect the normal interaction of other functional components. It is only necessary to update the parameters recorded in the event unit B2, that is, delete the parameters that the functional component Model_A5 recorded in the event unit B2 can respond to.
[0062] like Figure 3BAs shown, if a new functional component Model_A6 needs to be added to the tree system, a corresponding event unit A6 can be configured for the functional component Model_A6, and the parameters that the functional component Model_A6 can respond to can be recorded in the event unit A6, and the parameters that the functional component Model_A6 can respond to can be recorded in the event unit B2. At the same time, since the functional component Model_A6 sends a data change instruction when sending a data change, the event unit A6 can send a data change instruction to the event unit B2, and when the event unit B2 receives the data change instruction, it can determine whether it is necessary to send the data change instruction to the event unit C1 according to the target parameter indicated by the data change instruction. If it is necessary to send the data change instruction to the event unit C1, after the event unit C1 receives the data change instruction, the data change instruction can be sent to the event unit B1, and the event unit B1 continues to determine whether to send the data change instruction to the event unit A3 and / or the event unit B3. That is, the newly added event unit can transfer data to any event unit in the tree structure system.
[0063] It can be seen that in the entire system, whether adding or deleting subordinate functional components, it will not affect the interaction between other functional components in the tree system. At the same time, the newly added functional components can also interact with other functional components, thereby improving the maintainability and scalability of the system composed of at least two functional components with a nested relationship.
[0064] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a communication device, and the device embodiment is Figure 1 Corresponding to the communication method embodiment shown, the device can be specifically applied to various electronic devices.
[0065] like Figure 4As shown, the communication device of this embodiment includes: an event unit applied to a first type, wherein the first type event unit is an event unit corresponding to a first type functional component in at least two functional components having a nested relationship, the at least one functional component includes: a first type functional component and a second type functional component, the first type functional component has a subordinate functional component, the functional component corresponds to the event unit one by one, the event unit is used to support communication of the functional components, and the event unit records parameters that the corresponding functional component can respond to and / or parameters that the subordinate functional component of the functional component can respond to; the device includes: a first determination unit 401, which is used to determine the target parameter indicated by the data change instruction in response to receiving a data change instruction sent by the subordinate event unit; a second determination unit 402, which is used to determine whether the recorded parameters include the target parameter, and generate a determination result; a third determination unit 403, which is used to determine the processing method for the data change instruction according to the determination result.
[0066] In some embodiments, the third determination unit 403 is further specifically used for: in response to the determination result that the recorded parameters include the target parameters, sending the data change instruction to the event unit recording the target parameters.
[0067] In some embodiments, the third determination unit 403 is further specifically used for: in response to the determination result that the recorded parameters do not include the target parameters, sending the data change instruction to the corresponding superior event unit.
[0068] In some embodiments, when the event unit monitors data changes in the corresponding functional component, it generates a corresponding data change instruction.
[0069] In some embodiments, when the second type event unit monitors that data changes occur in the corresponding functional component, the second type event unit generates a corresponding data change instruction and sends the data change instruction to the corresponding upper-level event unit, wherein the second type event unit corresponds to the second type functional component, and the second type functional component does not have a lower-level functional component.
[0070] In some embodiments, the parameters recorded by the first type event unit are updated in response to any of the following: deleting a subordinate functional component of the first type functional component corresponding to the first type event unit; adding a new subordinate functional component to the first type functional component corresponding to the first type event unit.
[0071] Please refer to Figure 5 , Figure 5 An exemplary system architecture is shown in which the communication method of one embodiment of the present disclosure can be applied.
[0072] like Figure 5 As shown, the system architecture may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 may be used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0073] The terminal devices 501, 502, and 503 can interact with the server 505 through the network 504 to receive or send messages, etc. Various client applications, such as web browser applications, search applications, and news information applications, can be installed on the terminal devices 501, 502, and 503. The client applications in the terminal devices 501, 502, and 503 can receive user instructions and perform corresponding functions according to the user instructions, such as adding corresponding information to the information according to the user instructions.
[0074] Terminal devices 501, 502, 503 can be hardware or software. When terminal devices 501, 502, 503 are hardware, they can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptop computers and desktop computers, etc. When terminal devices 501, 502, 503 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0075] The server 505 may be a server that provides various services, such as receiving information acquisition requests sent by the terminal devices 501, 502, and 503, acquiring display information corresponding to the information acquisition requests in various ways according to the information acquisition requests, and sending relevant data of the display information to the terminal devices 501, 502, and 503.
[0076] It should be noted that the information processing method provided in the embodiment of the present disclosure can be executed by a terminal device, and accordingly, the communication device can be set in the terminal devices 501, 502, and 503. In addition, the information processing method provided in the embodiment of the present disclosure can also be executed by a server 505, and accordingly, the information processing device can be set in the server 505.
[0077] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0078] Reference below Figure 6 , which shows an electronic device (eg, Figure 5 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0079] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 508 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0080] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0081] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0082] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The 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 of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0083] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0084] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0085] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: in response to receiving a data change instruction sent by a lower-level event unit, determines the target parameters indicated by the above-mentioned data change instruction; determines whether the recorded parameters include the above-mentioned target parameters, and generates a determination result; and determines the processing method of the above-mentioned data change instruction based on the above-mentioned determination result.
[0086] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0087] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0088] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first determination unit 401 may also be described as "a unit for determining the target parameter indicated by the above data change instruction".
[0089] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0090] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0091] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0092] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0093] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A communication method, characterized in that: Applied to a first type event unit, wherein the first type event unit is an event unit corresponding to a first type functional component in at least two functional components having a nested relationship, the at least two functional components comprising: a first type functional component and a second type functional component, the first type functional component having a subordinate functional component and an upper level functional component, the functional components and the event units have a one-to-one correspondence, the event unit is used to support communication of the functional components, and the event unit records parameters that the corresponding functional component can respond to and / or parameters that the subordinate functional components of the functional component can respond to; The method comprises: In response to receiving a data change instruction sent by a lower-level event unit, determining a target parameter indicated by the data change instruction; determining whether the recorded parameters include the target parameters, and generating a determination result; Determining a processing method for the data change instruction according to the determination result includes: in response to the determination result that the recorded parameters do not include the target parameter, sending the data change instruction to the upper-level event unit corresponding to the upper-level functional component; and Determining a processing method for the data change instruction according to the determination result includes: In response to the determination result that the recorded parameters include the target parameter, the data change instruction is sent to the event unit that records the target parameter.
2. The method according to claim 1, characterized in that When the event unit monitors data changes in the corresponding functional components, it generates corresponding data change instructions.
3. The method according to claim 1, characterized in that When the second type event unit monitors that data changes occur in the corresponding functional component, the second type event unit generates a corresponding data change instruction and sends the data change instruction to the corresponding upper-level event unit, wherein the second type event unit corresponds to the second type functional component, and the second type functional component does not have a lower-level functional component.
4. The method according to claim 1, characterized in that: In response to any of the following, the parameters recorded by the first type event unit are updated: Deleting the subordinate functional component of the first type functional component corresponding to the first type event unit; A new subordinate functional component is added to the first type functional component corresponding to the first type event unit.
5. A communication device, characterized in that: Applied to a first type event unit, wherein the first type event unit is an event unit corresponding to a first type functional component in at least two functional components having a nested relationship, the at least two functional components comprising: a first type functional component and a second type functional component, the first type functional component having a subordinate functional component and an upper level functional component, the functional components and the event units have a one-to-one correspondence, the event unit is used to support communication of the functional components, and the event unit records parameters that the corresponding functional component can respond to and / or parameters that the subordinate functional components of the functional component can respond to; The device comprises: a first determining unit, configured to determine, in response to receiving a data change instruction sent by a lower-level event unit, a target parameter indicated by the data change instruction; a second determination unit, configured to determine whether the recorded parameters include the target parameter, and to generate a determination result; a third determining unit, configured to determine a processing method for the data change instruction according to the determination result, comprising: in response to the determination result being that the recorded parameters do not include the target parameter, sending the data change instruction to an upper-level event unit corresponding to the upper-level functional component; and The third determination unit is further specifically configured to: in response to the determination result that the recorded parameters include the target parameter, send the data change instruction to the event unit that records the target parameter.
6. An electronic device, characterized in that: include: one or more processors; a storage device 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 method according to any one of claims 1 to 4.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Method for achieving communication in PON equipment
CN104378699A
Protection method and proxy equipment
CN109451091A
Page information processing method and device and electronic equipment
CN109597663A
Monitoring execution method and device, instruction issuing method and device, equipment and storage medium
CN110290216A
Method and device for transferring events between components
CN110865889A
