CN111930540A - Communication method and device and electronic equipment - Google Patents

Communication method and device and electronic equipment Download PDF

Info

Publication number
CN111930540A
CN111930540A CN202010775473.4A CN202010775473A CN111930540A CN 111930540 A CN111930540 A CN 111930540A CN 202010775473 A CN202010775473 A CN 202010775473A CN 111930540 A CN111930540 A CN 111930540A
Authority
CN
China
Prior art keywords
event unit
data change
event
change instruction
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010775473.4A
Other languages
Chinese (zh)
Inventor
张政桢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010775473.4A priority Critical patent/CN111930540A/en
Publication of CN111930540A publication Critical patent/CN111930540A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware

Abstract

According to the communication method, the communication device and the electronic equipment disclosed by the embodiment of the disclosure, after the first type event unit receives the data change instruction sent by the lower level event unit, whether the target parameter indicated by the data change instruction is recorded or not is determined; and determining a processing mode of the data change instruction according to the determination result. Therefore, compared with the existing communication mode, the technical scheme of the disclosure can enable each functional component to be relatively independent, simplify the communication process among the functional components, and enable a system formed by at least two functional components to have higher maintainability and expandability due to the fact that each functional component is relatively independent.

Description

Communication method and device and electronic equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a communication method and apparatus, and an electronic device.
Background
In a system composed of a plurality of modules (each module can execute corresponding functions), the modules have a mutual dependency relationship, and the dependency relationship enables the modules between the systems to need agents and other modes to call back layer by layer when the modules between the systems communicate, and when the nesting in a tree structure system is more, the communication mode between the modules is more complicated.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a communication method, a communication device and an electronic device, when communication is required between functional components with a nested relationship, communication can be performed by a time unit of each functional component, that is, communication of each functional component can be realized through an event unit, so that interdependence between the functional components is not required, a communication mode between the functional components with the nested relationship is simplified, and expandability and maintainability of the whole system are improved.
In a first aspect, an embodiment of the present disclosure provides a communication method, which is applied to a first type event unit, where 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: the first type functional assembly is provided with lower-level functional assemblies, the functional assemblies correspond to event units one by one, the event units are used for supporting communication of the functional assemblies, and the event units record parameters which can be responded by the corresponding functional assemblies and/or parameters which can be responded by the lower-level functional assemblies of the functional assemblies; the method comprises the following steps: 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 or not, and generating a determination result; and determining a processing mode of the data change instruction according to the determination result.
In a second aspect, an embodiment of the present disclosure provides a communication apparatus, including: the event unit 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 with a nested relationship, and the at least one functional component comprises: the first type functional assembly is provided with lower-level functional assemblies, the functional assemblies correspond to event units one by one, the event units are used for supporting communication of the functional assemblies, and the event units record parameters which can be responded by the corresponding functional assemblies and/or parameters which can be responded by the lower-level functional assemblies of the functional assemblies; the above-mentioned device includes: a first determining unit, configured to determine, in response to receiving a data change instruction sent by a lower event unit, a target parameter indicated by the data change instruction; a second determining unit configured to determine whether the recorded parameters include the target parameter, and generate a determination result; and a third determining unit configured to determine a processing method of the data change instruction according to the determination result.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the communication method according to the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the communication method as described above in the first aspect.
According to the communication method, the communication device and the electronic equipment provided by the embodiment of the disclosure, after the first type event unit receives the data change instruction sent by the lower level event unit, whether the target parameter indicated by the data change instruction is recorded or not is determined; and determining a processing mode of the data change instruction according to the determination result. That is, each functional component is provided with a corresponding event unit, so that a functional component with data change in at least two functional components in a nested relationship can be used as a lower-level functional component, the lower-level event unit corresponding to the functional component can generate a data change instruction, the data change instruction is sent to a corresponding upper-level event unit, and the upper-level event unit can determine a processing mode of the data change instruction. Without associating the functional component that needs to generate 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 mode, the technical scheme of the disclosure can enable each functional component to be relatively independent, simplify the communication process among the functional components, and enable a system consisting of at least two functional components to have higher maintainability and expandability due to the fact that each functional component is relatively independent.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a flow chart of one embodiment of a communication method according to the present disclosure;
fig. 2 is a schematic structural diagram of another embodiment of a communication method according to the present disclosure;
fig. 3A is an exemplary application scenario diagram of yet another embodiment of a communication method according to the present disclosure;
fig. 3B is an exemplary application scenario diagram of yet another embodiment of a communication method according to the present disclosure;
FIG. 4 is a schematic block diagram of one embodiment of a communications device according to the present disclosure;
FIG. 5 is an exemplary system architecture to which the communication method of one embodiment of the present disclosure may be applied;
fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Referring to fig. 1, a flow diagram of one embodiment of a communication method according to the present disclosure is shown. The communication method can be applied to a terminal device.
In some embodiments, the communication method may be applied to a first type of event unit.
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, and at least one functional component includes: the first type functional component is provided with lower-level functional components, the functional components correspond to event units one by one, the event units are used for supporting communication of the functional components, and the event units record parameters which can be responded by the corresponding functional components and/or parameters which can be responded by the lower-level functional components of the functional components.
In some embodiments, the second type of functional component has no corresponding lower level functional component, and the first type of functional component has a corresponding lower level functional component. Since the event units correspond to the functional components one to one, it can be understood that the event units are divided into a first type event unit and a second type event unit. The second-type event unit may be configured to record a parameter that the corresponding second-type functional component can respond to, and the first-type event unit may record a parameter that the corresponding first-type functional component can respond to and a parameter that a lower-level functional component of the first-type functional component can respond to.
In some embodiments, since at least two functional components have a nested relationship and the event units are used to support communication between the functional components, the event units may form a tree system. It can be understood that the whole tree system includes: a first type event unit and a second type event unit. In the tree system, the correspondence between the upper level event unit and the lower level event unit can be represented by a parent node and a child node, that is, the upper level event unit can be called as the parent node of the lower level event unit, and correspondingly, the lower level event unit is the child node. Thus, a first-type event unit corresponds as a parent node to a child node, whereas a second-type event unit can only serve as a child node (there is no corresponding subordinate functional component to the first-type event unit corresponding functional component). That is, the first type event unit may serve as a lower level event unit, and the second type event unit may serve only as a lower level event unit. And when the data change occurs to the functional component corresponding to the lower-level event unit, the lower-level event unit can generate a data change instruction.
To facilitate understanding of the relationship between the first type event units and the second type event units, and the relationship between the child nodes and the parent nodes, the following description is provided in detail with reference to fig. 2. Fig. 2 is a schematic diagram of a tree system provided in the embodiment of the present application, and it can be seen in fig. 2 that: since the event cell a1, the event cell a2, the event cell A3, the event cell a4, and the event cell a5 have no child node (lower level event cell), it can be understood that: the event cell a1, the event cell a2, the event cell A3, the event cell a4, and the event cell a5 are second-type event cells, and it can be seen that the event cell a1, the event cell a2, the event cell A3, the event cell a4, and the event cell a5 can only be child nodes. Since the event unit B1, the event unit B2, the event unit B3 and the event unit C1 all have child nodes, the event unit B1, the event unit B2, the event unit B3 and the event unit C1 can be understood as first type event units, and when the event unit B3 is a parent node, the event unit B1 and the event unit A3 are child nodes, that is, the event unit B3 can be used as both a parent node and a child node. Accordingly, when the event unit C1 serves as a parent node, the event unit B1 and the event unit B2 are child nodes (in this case, the event unit B1 and the event unit B2 are lower-level event units of the event unit C1).
In this embodiment, the functional components may be used to implement relatively complete functionality. For example, the tree system is a music playing system, and the functional components in the tree system may include a functional component for implementing lyric display, a functional component for controlling volume, and the like.
In some embodiments, the event units correspond to the functional components, that is, it can be understood that each event unit may correspond to one functional component, and the functions that the functional components can perform are recorded in the corresponding event unit, and the parent node records the record in the corresponding child node, that is, it can be understood that: the upper level event unit records the record in the corresponding lower level event unit.
In some embodiments, when data of a functional component changes, the event unit corresponding to the functional component may generate a data change instruction, and the event unit may send the data change instruction (to the corresponding upper event unit).
For ease of understanding, the illustration continues: as the event unit a1 in fig. 2 corresponds to a function component Model _ a1 (which may be a function component responsible for receiving comments), parameters that can be processed by the function component Model _ a1 are recorded in the event unit a 1. And when the data of the function component Model _ a1 changes (when a new comment is received), the event unit a1 may generate a data change instruction and may send the data change instruction to the event unit B3. The parameters recorded in the event unit a1 and the event unit a2 are recorded in the event unit B3, and can be understood as follows: when event cell B3 is the parent node, event cell A1 and event cell A2 are the child nodes of event cell B3, i.e., it can be understood that: the event unit B3 is an upper-level event unit of both the event unit a1 and the event unit a2, and accordingly, the function component Model _ a1 corresponding to the event unit a1, and the function component Model _ a2 corresponding to the event unit a2 may be lower-level function components of the function component Model _ B3 corresponding to the event unit B3 (i.e., the function component Model _ a1 and the function component Model _ a2 are lower-level function components of the function component Model _ B3).
The event unit a1 records parameters to which the function module Model _ a1 can respond, the event unit a2 records parameters to which the function module Model _ a2 can respond, and the event unit B3 records parameters to which the function module Model _ a1, the function module Model _ a2, and the function module Model _ B3 can respond.
In some embodiments, since the function component Model _ a1 and the function component Model _ a2 are lower-level function components of the function component Model _ B3, such as: when the function module Model _ B3 is a personal status module, the function module Model _ a1 and the function module Model _ a2 can be respectively: the comment module and the like module, that is, can be understood as: if the review amount and the endorsement amount are found to be more, two modules can be distinguished to be used for processing the review amount and the endorsement amount, and only when the review amount and/or the endorsement amount change, the change is sent to the corresponding upper function module.
The communication method as shown in fig. 1 includes the steps of:
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.
In some embodiments, the lower level event unit may be a second type event unit or a part of a first type event unit. When the lower level event unit is a second type event unit, then it can be understood that: the data change occurs in the functional component in the second type event unit, so that the second type event unit can generate a data change instruction and can send the data change instruction to the corresponding first type event unit (in this case, the first type event unit may be characterized as a higher-level event unit (parent node) of the second type event unit, that is, as shown in fig. 2, when a lower-level event unit is an event unit a1, after the data of the functional component Model _ a1 corresponding to the event unit a1 is changed, the event unit a1 may generate a data change instruction and send the data change instruction to the event unit B3, and in this case, the event unit B3 serves as the first type event unit).
In some embodiments, since part of the first-type event units may also serve as the child node, when the lower-level functional component of the functional component corresponding to the first-type event unit serving as the child node cannot respond to the target parameter indicated by the data change instruction, the data change instruction may be continuously passed upward. (in FIG. 2, when a data change command is issued by the event unit A1 and the target parameter is not included in the parameters recorded by the event unit B3, the event unit B3 may send the data change command to the event unit B1, and at this time, the event unit B3 may be understood as a child node of the event unit B1, that is, the event unit B3 is a lower-level event unit of the event unit B1).
In some embodiments, when the first type event unit receives the data change instruction, the target parameter indicated by the data change instruction may be determined, and the step 102 may be continued.
Step 102, determining whether the recorded parameters include target parameters, and generating a determination result.
In some embodiments, the event unit records parameters that can be responded by the corresponding functional component and parameters that can be responded by the lower functional component corresponding to the functional component; therefore, it is possible to determine whether the target parameter is included in the recorded parameters, and thus it is also possible to determine whether the corresponding functional component or a functional component lower than the functional component can respond to the target parameter.
And 103, determining a processing mode of the data change instruction according to the determination result.
In some embodiments, when the determination result is that the target parameter is included in the recorded parameters, the data change instruction may be sent to the event unit in which the target parameter is recorded. When the target parameter is not included in the recorded parameters as a result of the determination, the data change instruction may be transmitted to the upper event unit.
For ease of understanding, the explanation is continued with reference to fig. 2. Such as: the event unit B1 represents the first type event unit, and the data change instruction is issued by the event unit A3, after the event unit B1 receives the data change instruction sent by the event unit A3, the event unit B1 determines whether the target parameters indicated by the data change instruction are recorded, since the parameters recorded in the event unit a1 and the event unit A3 are recorded in the event unit B3, and the parameters recorded in the event unit B3 and the event unit A3 are recorded in the event unit B1. Thus, it can be understood that: the event cell B1 records: the functional component corresponding to the event cell B1, the functional component corresponding to the event cell B3, the functional component corresponding to the event cell a1, the functional component corresponding to the event cell a2, and the functional component corresponding to the event cell A3; when the event unit B1 does not record the target parameter, it may be characterized that the functional component corresponding to the event unit B1, the functional component corresponding to the event unit B3, the functional component corresponding to the event unit a1, and the functional component corresponding to the event unit a2 do not respond to the target parameter, and at this time, the data change instruction may be sent to the event unit C1. If the target parameter is recorded in event cell B1 and it is also determined that the target parameter is recorded in event cell B3, the data change command may be sent to command event cell B3.
It can be seen that, in the present embodiment, after the first type event unit receives the data change instruction sent by the lower level event unit, it is determined whether the target parameter indicated by the data change instruction is recorded; and determining a processing mode of the data change instruction according to the determination result. That is, each functional component is provided with a corresponding event unit, so that a functional component with data change in at least two functional components in a nested relationship can be used as a lower-level functional component, the lower-level event unit corresponding to the functional component can generate a data change instruction, the data change instruction is sent to a corresponding upper-level event unit, and the upper-level event unit can determine a processing mode of the data change instruction. Without associating the functional component that needs to generate 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 mode, the technical scheme of the disclosure can enable each functional component to be relatively independent, simplify the communication process among the functional components, and enable a system consisting of at least two functional components to have higher maintainability and expandability due to the fact that each functional component is relatively independent.
For the sake of understanding, the tree system is used as a music playing system, the function module Model _ a1 is used for receiving comments, the function module Model _ a2 is used for receiving praise, and the function module Model _ A3 is used for showing music lyrics. If in the music playing system, when the lyrics of the music are shown, the amount of praise of the user for the song and part of the comments may also be shown. Therefore, in order to enable the lyric function module Model _ a5 to correctly show comments and praise when executing its function (showing music lyrics), it is necessary to correctly inform the function module Model _ a5 of data change when the data change occurs in the function module Model _ a1 and/or the function module Model _ a 2. For example, when the function module Model _ a1 has data change, the event unit a1 generates a data change command according to the following sequence: the sequence of event cell B3, event cell B1, event cell C1, and event cell B2 sends a data change command to event cell A5. After the event unit A5 receives the data change command, the functional component Model _ A5 can be processed. Accordingly, the data transmission mode of the function module Model _ a2 when the data change occurs can be the same as that of the function module Model _ a1, and therefore, the description thereof is omitted.
It can be seen that although the function component Model _ a1 and the function component Model _ a2 are related to the function component Model _ a5 in the service level, the present application does not relate the function component Model _ a1 and the function component Model _ a2 to the function component Model _ a5 as in the prior art; further, when a data change occurs, the function module Model _ a1 and/or the function module Model _ a2 directly sends the data change to the function module Model _ a 5. But the data change instruction is generated and transmitted out in a mode of sending to a father node, and finally the data is transmitted to the functional component Model _ A5, so that the dependency among the functional components in the tree system can be reduced, and the maintainability and the expandability of the tree system are higher.
In some embodiments, the correspondence between child nodes and parent nodes in the tree system may be determined in a subscription manner, for example, the event unit B1 may subscribe the event unit C1 as its parent node, and correspondingly, the event unit B1 may also subscribe the event unit B3 and the event unit A3 as its child nodes. Accordingly, event cell A1 and event cell A2 may subscribe event cell B3 as the parent nodes. The subscription mode of other event units is similar to the above subscription mode, and is not described herein again for brevity of the description. However, as can be seen from the above subscription manner, each child node has only one parent node, and each parent node may have multiple child nodes.
In some embodiments, the event unit a1 may monitor the data change of the function module Model _ a1, that is, when the event unit a1 monitors that the data change of the function module Model _ a1 occurs, a data change instruction may be generated and only the data change instruction needs to be sent to the event unit B3. That is, all data change commands that need to be sent by the event unit a1 need only be sent to the event unit B3, and the event unit a1 does not need to be associated with other event units, thereby simplifying the difficulty of communicating among the event units in the tree system.
In some embodiments, the first type event unit receives the data change instruction sent by the corresponding lower level event unit in the following two cases.
The first condition is as follows: the second type event unit, which is a lower event unit, monitors that the second type event unit, which is a lower event unit, generates a corresponding data change command when a data change occurs in a corresponding function element, but since the second type event unit does not have a corresponding lower event unit, when a data change command is generated, it is only necessary to transmit the data change command to a corresponding parent node (a corresponding first type event unit, as shown in fig. 2, when a data change occurs in the function element Model _ a1, the event unit a1 may generate a data change command and may transmit the data change command to the event unit B3).
In the second case, when the lower-level event unit is the 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 may send the data change instruction to the corresponding upper-level event unit.
It can be seen that, in the embodiment of the present disclosure, the functional components do not need to be correlated with each other, and only when data change occurs, the corresponding event unit sends out the data change instruction.
For ease of understanding, the description continues with reference to fig. 2, for example: the data change instruction is generated by the event unit a1, and the event unit A3 may respond to the target parameter indicated by the data change instruction, then the transmission path of the data change instruction may be understood as: when the event unit B3 receives the data change instruction, and the event unit B3 serves as a parent node, it may determine whether the event unit a2 serving as a child node can respond to the target parameter, and if the event unit a2 cannot respond, it may transmit the data change instruction to the event unit B1, and when the event unit B1 receives the data change instruction, the event unit B1 serves as a parent node, it may determine whether the event unit A3 serving as a child node can respond to the target parameter, and if the event unit A3 can respond to the target parameter, the event unit B1 may transmit the target parameter to the event unit A3. In the above process, case one is when the event unit B3 is the parent node, and case two is when the event unit B1 is the parent node.
In some embodiments, since the parent node records parameters that the child node can respond to, when a certain event unit receives a data change instruction sent by the parent node (upper event unit), it may be characterized that the functional component corresponding to the event unit may respond to the data change instruction, or a lower functional component of the functional component may respond to the data change instruction.
Continuing with the example of FIG. 2: when the event unit B2 receives the data modification command issued by the event unit C1, it is only necessary to determine to issue the data modification command to the event unit a4 and/or the event unit a5 according to the target parameter indicated by the data modification command.
In some embodiments, the parameters recorded by the first type event unit are updated in response to any one of:
deleting the lower-level functional components of the first-type functional components corresponding to the first-type event units;
and adding a new lower-level functional component for the first-type functional component corresponding to the first-type event unit.
As shown in fig. 3A, 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 are deleted), but normal interaction of other functional components is not affected, only the parameters recorded in the event unit B2 need to be updated, that is, the parameters that can be responded by the functional component Model _ a5 recorded in the event unit B2 are deleted.
As shown in fig. 3B, if a new function module Model _ a6 needs to be added to the tree system, at this time, a corresponding event unit a6 can be configured for the function module Model _ a6, the event unit a6 can record parameters that the function module Model _ a6 can respond to, and the event unit B2 can record parameters that the function module Model _ a6 can respond to. Meanwhile, when the function module Model _ a6 sends a data change, the event unit a6 may send a data change instruction to the event unit B2, and when receiving the data change instruction, the event unit B2 may determine whether the data change instruction needs to be sent to the event unit C1 according to the target parameter indicated by the data change instruction, and if the data change instruction needs to be sent to the event unit C1, after receiving the data change instruction, the event unit C1 may send the data change instruction to the event unit B1, and the event unit B1 continues to determine that the data change instruction is sent 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.
It can be seen that, in the whole system, no matter the lower functional components are added or deleted, the interaction between other functional components in the tree system is not affected, and meanwhile, the newly added functional components can also interact with other functional components, so that the maintainability and the expandability of the system formed by at least two functional components with a nested relation are improved.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a communication apparatus, which corresponds to the embodiment of the communication method shown in fig. 1, and which is particularly applicable to various electronic devices.
As shown in fig. 4, the communication apparatus of the present embodiment includes: the event unit 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 with a nested relationship, and the at least one functional component comprises: the first type functional assembly is provided with lower-level functional assemblies, the functional assemblies correspond to event units one by one, the event units are used for supporting communication of the functional assemblies, and the event units record parameters which can be responded by the corresponding functional assemblies and/or parameters which can be responded by the lower-level functional assemblies of the functional assemblies; the above-mentioned device includes: a first determining unit 401, configured to determine, in response to receiving a data change instruction sent by a lower event unit, a target parameter indicated by the data change instruction; a second determining unit 402, configured to determine whether the recorded parameters include the target parameter, and generate a determination result; a third determining unit 403, configured to determine a processing mode of the data change instruction according to the determination result.
In some embodiments, the third determining unit 403 is further specifically configured to: and sending the data change instruction to an event unit recorded with the target parameter in response to the determination result that the recorded parameter comprises the target parameter.
In some embodiments, the third determining unit 403 is further specifically configured to: and in response to the determination result that the recorded parameters do not include the target parameters, sending the data change instruction to a corresponding upper-level event unit.
In some embodiments, the event unit generates a corresponding data change instruction when it is monitored that a data change occurs to the corresponding functional component.
In some embodiments, the second-type event unit monitors that when data change occurs 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.
In some embodiments, the parameters recorded by the first type event unit are updated in response to any one of: deleting the lower-level functional components of the first-type functional components corresponding to the first-type event units; and adding a new lower-level functional component for the first-type functional component corresponding to the first-type event unit.
Referring to fig. 5, fig. 5 illustrates an exemplary system architecture to which the communication method of one embodiment of the present disclosure may be applied.
As shown in fig. 5, the system architecture may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 may be the medium used to provide communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 501, 502, 503 may interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various client applications installed thereon, such as a web browser application, a search-type application, and a news-information-type application. The client application in the terminal device 501, 502, 503 may receive the instruction of the user, and complete the corresponding function according to the instruction of the user, for example, add the corresponding information in the information according to the instruction of the user.
The terminal devices 501, 502, 503 may be hardware or software. When the terminal devices 501, 502, 503 are hardware, they may be various electronic devices having a display screen 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, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal devices 501, 502, and 503 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 505 may be a server providing various services, for example, receiving an information acquisition request sent by the terminal device 501, 502, 503, and acquiring the presentation information corresponding to the information acquisition request in various ways according to the information acquisition request. And the relevant data of the presentation information is sent to the terminal equipment 501, 502, 503.
It should be noted that the information processing method provided by the embodiment of the present disclosure may be executed by a terminal device, and accordingly, the communication device may be provided in the terminal device 501, 502, 503. In addition, the information processing method provided by the embodiment of the present disclosure may also be executed by the server 505, and accordingly, an information processing apparatus may be provided in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 6, shown is a schematic diagram of an electronic device (e.g., a terminal device or a server of fig. 5) suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may 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 means 508 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: 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 or not, and generating a determination result; and determining a processing mode of the data change instruction according to the determination result.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. 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 the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Here, the name of the unit does not constitute a limitation to the unit itself in some cases, and for example, the first determination unit 401 may also be described as "a unit that determines the target parameter indicated by the above-described data change instruction".
The functions described herein above 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 a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A communication method 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 with a nested relation, and the at least one functional component comprises: the first type functional component is provided with lower-level functional components, the functional components correspond to event units one by one, the event units are used for supporting communication of the functional components, and the event units record parameters which can be responded by the corresponding functional components and/or parameters which can be responded by the lower-level functional components of the functional components;
the method comprises the following steps:
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 target parameter is included in the recorded parameters, and generating a determination result;
and determining a processing mode of the data change instruction according to the determination result.
2. The method according to claim 1, wherein the determining a processing manner of the data change instruction according to the determination result includes:
and responding to the determination result that the recorded parameters comprise the target parameters, and sending the data change instruction to an event unit recorded with the target parameters.
3. The method according to claim 1, wherein the determining a processing manner of the data change instruction according to the determination result includes:
and in response to the determination result that the recorded parameters do not include the target parameters, sending the data change instruction to a corresponding upper-level event unit.
4. The method of claim 1, wherein the event unit generates a corresponding data change instruction when it is monitored that the data change occurs in the corresponding functional component.
5. The method according to claim 1, wherein the second type event unit monitors that when the data change occurs in the corresponding functional component, the second type event unit generates a corresponding data change instruction and transmits the data change instruction to a 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.
6. The method of claim 1, wherein the parameters recorded by the first type event unit are updated in response to any one of:
deleting the lower-level functional components of the first-type functional components corresponding to the first-type event units;
and adding a new lower-level functional component for the first-type functional component corresponding to the first-type event unit.
7. The communication device 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 comprises: the event unit is used for supporting communication of the functional components, and the event unit records parameters which can be responded by the corresponding functional components and/or parameters which can be responded by the subordinate functional components of the functional components;
the device comprises:
a first determining unit, configured to determine, in response to receiving a data change instruction sent by a lower event unit, a target parameter indicated by the data change instruction;
a second determination unit configured to determine whether the target parameter is included in the recorded parameters, and generate a determination result;
and the third determining unit is used for determining the processing mode of the data change instruction according to the determination result.
8. The apparatus according to claim 7, wherein the third determining unit is further specifically configured to: and responding to the determination result that the recorded parameters comprise the target parameters, and sending the data change instruction to an event unit recorded with the target parameters.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202010775473.4A 2020-08-04 2020-08-04 Communication method and device and electronic equipment Pending CN111930540A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010775473.4A CN111930540A (en) 2020-08-04 2020-08-04 Communication method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010775473.4A CN111930540A (en) 2020-08-04 2020-08-04 Communication method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111930540A true CN111930540A (en) 2020-11-13

Family

ID=73306719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010775473.4A Pending CN111930540A (en) 2020-08-04 2020-08-04 Communication method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111930540A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170140315A1 (en) * 2015-11-17 2017-05-18 International Business Machines Corporation Managing incident tickets in a cloud managed service environment
CN109597663A (en) * 2018-09-06 2019-04-09 北京微播视界科技有限公司 Page info processing method, device and electronic equipment
CN110290216A (en) * 2019-06-28 2019-09-27 百度在线网络技术(北京)有限公司 Monitor execution method, instruction delivery method, device, equipment and storage medium
CN110865889A (en) * 2018-08-27 2020-03-06 北京高绎信息技术有限公司 Method and apparatus for transferring events between components

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170140315A1 (en) * 2015-11-17 2017-05-18 International Business Machines Corporation Managing incident tickets in a cloud managed service environment
CN110865889A (en) * 2018-08-27 2020-03-06 北京高绎信息技术有限公司 Method and apparatus for transferring events between components
CN109597663A (en) * 2018-09-06 2019-04-09 北京微播视界科技有限公司 Page info processing method, device and electronic equipment
CN110290216A (en) * 2019-06-28 2019-09-27 百度在线网络技术(北京)有限公司 Monitor execution method, instruction delivery method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109582310B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN111930534A (en) Data calling method and device and electronic equipment
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN110618768B (en) Information presentation method and device
CN110619101B (en) Method and apparatus for processing information
CN112307393A (en) Information issuing method and device and electronic equipment
CN111596992A (en) Navigation bar display method and device and electronic equipment
CN111209432A (en) Information acquisition method and device, electronic equipment and computer readable medium
CN115630197A (en) Media content processing method and device and electronic equipment
CN111930540A (en) Communication method and device and electronic equipment
CN111367592B (en) Information processing method and device
CN110619079B (en) Method and device for pushing information
CN112311842A (en) Method and device for information interaction
CN111399872A (en) Page updating method and device and electronic equipment
CN111460211A (en) Audio information playing method and device and electronic equipment
CN111240657A (en) Method and device for generating SDK and electronic equipment
CN111797160A (en) Method, system and electronic equipment for sharing intelligent contract
CN116820354B (en) Data storage method, data storage device and data storage system
CN111291254A (en) Information processing method and device
CN111857879B (en) Data processing method, device, electronic equipment and computer readable medium
CN110099122B (en) Method and apparatus for sending network request

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