CN110753070A - Data communication method, client, server and data communication system - Google Patents
Data communication method, client, server and data communication system Download PDFInfo
- Publication number
- CN110753070A CN110753070A CN201810812176.5A CN201810812176A CN110753070A CN 110753070 A CN110753070 A CN 110753070A CN 201810812176 A CN201810812176 A CN 201810812176A CN 110753070 A CN110753070 A CN 110753070A
- Authority
- CN
- China
- Prior art keywords
- target
- client
- broadcast message
- server
- event
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 238000004891 communication Methods 0.000 title claims abstract description 62
- 239000000284 extract Substances 0.000 claims description 17
- 238000000605 extraction Methods 0.000 claims description 4
- 238000012544 monitoring process Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 13
- 238000004590 computer program Methods 0.000 description 11
- 238000012545 processing Methods 0.000 description 6
- 230000008901 benefit Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a data communication method, a client, a server and a data communication system. Therefore, the client and the server do not need to show own characteristics when establishing communication connection, and the operation burden of the server is greatly reduced.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data communication method, a client, a server, and a data communication system.
Background
At this stage, after the server establishes a connection with the client, the client often provides features related to its own characteristics to the server, so that the server can push related data for the client.
If the characteristic sending of the client is changed, the client needs to inform the server again, otherwise, the server pushes data to the client according to the original characteristic, and therefore the problem of pushing errors is initially selected. However, since a server is often connected with many clients, more than one client may request to change features at a time, which requires frequent server interaction, thereby placing a large operational burden on the server.
Disclosure of Invention
In view of the above problems, the present invention is proposed to provide a data communication method, a client, a server and a data communication system, which overcome or at least partially solve the above problems, and the technical solutions are as follows:
a data communication method is applied to a server, wherein the server is in communication connection with at least one client, and the method comprises the following steps:
acquiring target data to be sent, wherein the target data needs to be sent to the client with target characteristics;
generating a broadcast message according to the target data and the target characteristics, wherein the broadcast message comprises the target data and the target characteristics;
broadcasting the broadcast message so that the client with the target characteristics extracts the target data according to the target characteristics of the broadcast message.
Preferably, the generating a broadcast message according to the target data and the target feature includes:
generating a broadcast event with the target feature as an event name and the target data as event content;
correspondingly, the broadcasting the broadcast message includes:
and broadcasting the broadcast event.
A server, comprising:
the first acquisition module is used for acquiring target data to be sent, and the target data needs to be sent to the client with target characteristics;
a generating module, configured to generate a broadcast message according to the target data and the target feature, where the broadcast message includes the target data and the target feature;
and the broadcasting module is used for broadcasting the broadcast message so that the client with the target characteristics extracts the target data according to the target characteristics of the broadcast message.
A data communication method is applied to a client, wherein the client is in communication connection with at least one server, and the method comprises the following steps:
acquiring a broadcast message broadcasted by the server, wherein the broadcast message is generated by the server according to target data and target characteristics of a client to which the target data needs to be sent, and the broadcast message comprises the target data and the target characteristics;
judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client side;
and if so, extracting the target data from the broadcast message.
Preferably, when the broadcast message is a broadcast event that takes the target feature as an event name and takes the target data as an event content, the acquiring the broadcast message broadcasted by the server includes:
monitoring the broadcast event broadcasted by the server through a monitor, wherein the monitor is used for capturing an event to be captured with the characteristic of the client as an event name, and the monitor is bound with a callback function in advance;
correspondingly, the determining whether the target feature in the broadcast message is consistent with the feature of the client includes:
judging whether the event name of the broadcast event is consistent with the event name of the event to be captured;
correspondingly, the extracting the target data from the broadcast message includes:
and extracting the event content of the broadcast event through the callback function.
Preferably, the method further comprises:
and updating the characteristics of the client in real time.
A client, comprising:
a second obtaining module, configured to obtain a broadcast message broadcasted by the server, where the broadcast message is generated by the server according to target data and target features of a client to which the target data needs to be sent, and the broadcast message includes the target data and the target features;
the judging module is used for judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client; if yes, triggering an extraction module;
the extracting module is used for extracting the target data from the broadcast message.
A data communication system, comprising: the client comprises at least one server and at least one client, wherein the server is in communication connection with the client.
A storage medium comprising a stored program, wherein the program performs the data communication method of any one of the above claims and/or the program performs the data communication method of any one of the above claims.
A processor for executing a program, wherein the program executes to perform the data communication method according to any one of the above claims, and/or the program performs the data communication method according to any one of the above claims.
By means of the technical scheme, when the server needs to push the target message to the client with the target characteristics, the target characteristics and the target data are packaged into the broadcast message for broadcasting, and the client selectively extracts the target data by combining the characteristics of the client. Therefore, the client and the server do not need to show own characteristics when establishing communication connection, and the operation burden of the server is greatly reduced.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a method flow diagram of a data communication method;
FIG. 2 illustrates another method flow diagram of a data communication method;
FIG. 3 shows a schematic of the architecture of a server;
FIG. 4 illustrates yet another method flow diagram of a data communication method;
FIG. 5 illustrates yet another method flow diagram of a data communication method;
FIG. 6 shows a schematic of the structure of a client;
fig. 7 shows an example of a system architecture of a data communication system.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a data communication method, which is applied to a server, wherein the server is in communication connection with at least one client, and a flow chart of the method is shown in figure 1, and the method comprises the following steps:
and S10, acquiring target data to be sent, wherein the target data needs to be sent to a client with target characteristics.
In this embodiment, the server may obtain data to be pushed from the background server, and classify the data to be pushed according to target characteristics of the client to be pushed, so as to obtain multiple groups of target data, where each group of target data corresponds to one target characteristic.
In addition, the target feature may be an account level of the client, an account attribution, an account authority, and the like, which is not limited in this embodiment and may be set according to actual needs.
And S20, generating a broadcast message according to the target data and the target characteristics, wherein the broadcast message comprises the target data and the target characteristics.
In the process of executing step S20, a target feature corresponds to a set of target data, and a target feature and its corresponding set of target data are packaged into a broadcast message.
And S30, broadcasting the broadcast message so that the client with the target characteristics can extract the target data according to the target characteristics of the broadcast message.
In the process of executing step S30, the server broadcasts the generated at least one broadcast message, and the client may extract target data corresponding to its own characteristics from the broadcast message based on its own characteristics. Specifically, after acquiring the broadcast message broadcast by the server, the client may determine whether the target feature in the broadcast message is consistent with the feature of the client, and if so, extract the target data from the broadcast message.
In some other embodiments, the process of the server executing "generating the broadcast message according to the target message and the target feature" in step S20 may specifically adopt the following steps, and a method flowchart of the data communication method is shown in fig. 2:
s201, a broadcast event is generated with the target feature as an event name and the target data as an event content.
In the process of executing step S201, the broadcast message may be sent in the form of a broadcast event, specifically, the target characteristics are an event name of the broadcast event, and the target data is an event content of the broadcast event.
Accordingly, the process of "broadcasting the broadcast message" in step S30 may specifically adopt the following steps:
s301, broadcasting the broadcast event.
In this embodiment, the client may register a listener in advance, where the listener is configured to capture an event to be captured with a feature of the client as an event name, and the listener is bound to the callback function in advance. When the monitor monitors the broadcast event broadcasted by the server, the monitor judges whether the event name of the broadcast event is consistent with the event name of the event to be captured, if so, the monitor extracts the event content of the broadcast event by utilizing the pre-bound callback function.
The following description takes an application scenario as an example:
clients A, B, C and D are each communicatively coupled to the server and each has characteristics a, b, c, and D, respectively. Listeners for capturing an event to be captured having the respective characteristic as an event name are registered for the clients A, B, C and D in advance, and a callback function is bound to the respective listeners.
Assuming that the server needs to send data [1, 2, 3] to the client with any one of the features a, b, and c, the data { "name": "john" is sent to the client with the feature d. At this time, the server generates four broadcast events, namely a first broadcast event with an event name a and an event content of [1, 2, 3], a second broadcast event with an event name b and an event content of [1, 2, 3], a third broadcast event with an event name c and an event content of [1, 2, 3], an event name d and an event content of { "name": a fourth broadcast event of "john" and broadcast.
At this point, clients A, B, C and D will listen to the four broadcast events simultaneously or non-simultaneously using their respective registered listeners. Each client determines the broadcast event that needs to be captured by judging whether the event name of the broadcast event is consistent with the event name of the event to be captured, for example, the client a needs to capture a first broadcast event, the client B needs to capture a second broadcast event, and the like. Finally, each client extracts the event content from the broadcast event to be captured by using the callback function bound by the registered listener.
According to the data communication method provided by the embodiment of the invention, when the server needs to push the target message to the client with the target characteristics, the target characteristics and the target data are packaged into the broadcast message for broadcasting, and the client selectively extracts the target data by combining the characteristics of the client. Therefore, the client and the server do not need to show own characteristics when establishing communication connection, and the operation burden of the server is greatly reduced.
Based on the data communication method provided by the above embodiment, the embodiment of the present invention correspondingly provides a server for executing the data communication method, and a schematic structural diagram of the server is shown in fig. 3, and the server includes the following modules:
the first obtaining module 10 is configured to obtain target data to be sent, where the target data needs to be sent to a client with target characteristics;
a generating module 20, configured to generate a broadcast message according to the target data and the target feature, where the broadcast message includes the target data and the target feature;
the broadcasting module 30 is configured to broadcast the broadcast message, so that the client having the target feature extracts the target data according to the target feature of the broadcast message.
According to the server provided by the embodiment of the invention, when the target message needs to be pushed to the client with the target characteristics, the target characteristics and the target data are packaged into the broadcast message for broadcasting, and the client selectively extracts the target data by combining the characteristics of the client. Therefore, the communication connection with the client can be established without the client indicating the characteristics of the client, and the operation burden is greatly reduced.
Based on the data communication method provided by the foregoing embodiment, an embodiment of the present invention provides another data communication method, where the method is applied to a client, and the client is in communication connection with at least one server, and a flowchart of the method is shown in fig. 4, and includes the following steps:
and S40, acquiring the broadcast message broadcasted by the server, wherein the broadcast message is generated by the server according to the target data and the target characteristics of the client to which the target data needs to be sent, and the broadcast message comprises the target data and the target characteristics.
In the process of executing step S40, the server may obtain data to be pushed from the background server, and classify the data to be pushed according to the target features of the client to be pushed, so as to obtain multiple sets of target data, where each set of target data corresponds to one target feature. Therefore, a piece of broadcast data broadcast by the server is composed of a target feature and a set of target data corresponding to the target feature.
In addition, the target feature may be an account level of the client, an account attribution, an account authority, and the like, which is not limited in this embodiment and may be set according to actual needs.
S50, judging whether the target feature in the broadcast message is consistent with the feature of the client; if yes, go to step S60.
The characteristics of the client can be updated in real time, and can be updated according to a certain time interval, so that the timeliness of the synchronization characteristics of the client is ensured.
S60, extracting the target data from the broadcast message.
In some other embodiments, if the broadcast message broadcast by the server is a broadcast event with the target feature as an event name and the target data as an event content, the process of the client performing the step S40 to "acquire the broadcast message broadcast by the server" may specifically adopt the following steps, and a method flowchart of the data communication method is shown in fig. 5:
s401, a monitor monitors a broadcast event broadcasted by a server, wherein the monitor is used for capturing an event to be captured with the characteristics of a client as an event name, and the monitor is bound with a callback function in advance.
Accordingly, the process of "determining whether the target feature in the broadcast message is consistent with the feature possessed by the client" in the step S50 may specifically include the following steps:
s501, judging whether the event name of the broadcast event is consistent with the event name of the event to be captured.
Accordingly, the process of "extracting the target data from the broadcast message" in step S60 may specifically adopt the following steps:
s601, extracting the event content of the broadcast event through a callback function.
According to the data communication method provided by the embodiment of the invention, when the server needs to push the target message to the client with the target characteristics, the target characteristics and the target data are packaged into the broadcast message for broadcasting, and the client selectively extracts the target data by combining the characteristics of the client. Therefore, the client and the server do not need to show own characteristics when establishing communication connection, and the operation burden of the server is greatly reduced.
Based on the data communication method provided by the above embodiment, the embodiment of the present invention correspondingly provides a client for executing the data communication method, and a schematic structural diagram of the client is shown in fig. 6, and the client includes the following modules:
a second obtaining module 40, configured to obtain a broadcast message broadcasted by the server, where the broadcast message is generated by the server according to target data and target features of the client to which the target data needs to be sent, and the broadcast message includes the target data and the target features;
a judging module 50, configured to judge whether a target feature in the broadcast message is consistent with a feature of the client; if yes, triggering the extraction module 60;
an extracting module 60 is configured to extract the target data from the broadcast message.
According to the client provided by the embodiment of the invention, the client can selectively extract the target data by combining the characteristics of the client without indicating the characteristics of the client to the server when establishing communication connection with the server, so that the interaction frequency with the server can be reduced, and the operation burden of the server can be reduced.
Based on the server and the client provided in the foregoing embodiments, this embodiment provides a data communication system, which is composed of a server and a client, where the client may be in communication connection with at least one server, and the server may also establish communication connection with at least one client. Fig. 7 shows an example of a system architecture of a data communication system.
The server comprises a processor and a memory, the first acquiring module, the generating module and the broadcasting module are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the operation burden of the server is reduced by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, which when executed by a processor implements the data communication method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the data communication method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
acquiring target data to be sent, wherein the target data needs to be sent to a client with target characteristics;
generating a broadcast message according to the target data and the target characteristics, wherein the broadcast message comprises the target data and the target characteristics;
and broadcasting the broadcast message so that the client with the target characteristics extracts the target data according to the target characteristics of the broadcast message.
Wherein, generating the broadcast message according to the target data and the target characteristics comprises:
generating a broadcast event with the target characteristics as event names and the target data as event content;
correspondingly, the broadcasting message is broadcasted, and the method comprises the following steps:
the broadcast event is broadcast.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring target data to be sent, wherein the target data needs to be sent to a client with target characteristics;
generating a broadcast message according to the target data and the target characteristics, wherein the broadcast message comprises the target data and the target characteristics;
and broadcasting the broadcast message so that the client with the target characteristics extracts the target data according to the target characteristics of the broadcast message.
Wherein, generating the broadcast message according to the target data and the target characteristics comprises:
generating a broadcast event with the target characteristics as event names and the target data as event content;
correspondingly, the broadcasting message is broadcasted, and the method comprises the following steps:
the broadcast event is broadcast.
The client comprises a processor and a memory, the second acquisition module, the judgment module and the extraction module are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the operation burden of the server is reduced by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, which when executed by a processor implements the data communication method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the data communication method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
acquiring a broadcast message broadcasted by a server, wherein the broadcast message is generated by the server according to target data and target characteristics of a client to which the target data needs to be sent, and the broadcast message comprises the target data and the target characteristics;
judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client;
if yes, extracting the target data from the broadcast message.
The acquiring the broadcast message broadcasted by the server under the condition that the broadcast message is a broadcast event which takes the target feature as an event name and takes the target data as event content comprises the following steps:
monitoring a broadcast event broadcasted by a server through a monitor, wherein the monitor is used for capturing an event to be captured which takes the characteristics of a client as an event name, and the monitor is bound with a callback function in advance;
correspondingly, the step of judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client side comprises the following steps:
judging whether the event name of the broadcast event is consistent with the event name of the event to be captured;
accordingly, extracting target data from the broadcast message includes:
and extracting the event content of the broadcast event through a callback function.
Wherein, the method further comprises:
and updating the characteristics of the client in real time.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring a broadcast message broadcasted by a server, wherein the broadcast message is generated by the server according to target data and target characteristics of a client to which the target data needs to be sent, and the broadcast message comprises the target data and the target characteristics;
judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client;
if yes, extracting the target data from the broadcast message.
The acquiring the broadcast message broadcasted by the server under the condition that the broadcast message is a broadcast event which takes the target feature as an event name and takes the target data as event content comprises the following steps:
monitoring a broadcast event broadcasted by a server through a monitor, wherein the monitor is used for capturing an event to be captured which takes the characteristics of a client as an event name, and the monitor is bound with a callback function in advance;
correspondingly, the step of judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client side comprises the following steps:
judging whether the event name of the broadcast event is consistent with the event name of the event to be captured;
accordingly, extracting target data from the broadcast message includes:
and extracting the event content of the broadcast event through a callback function.
Wherein, the method further comprises:
and updating the characteristics of the client in real time.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A data communication method applied to a server, wherein the server is in communication connection with at least one client, the method comprising:
acquiring target data to be sent, wherein the target data needs to be sent to the client with target characteristics;
generating a broadcast message according to the target data and the target characteristics, wherein the broadcast message comprises the target data and the target characteristics;
broadcasting the broadcast message so that the client with the target characteristics extracts the target data according to the target characteristics of the broadcast message.
2. The method of claim 1, wherein generating a broadcast message based on the target data and the target characteristics comprises:
generating a broadcast event with the target feature as an event name and the target data as event content;
correspondingly, the broadcasting the broadcast message includes:
and broadcasting the broadcast event.
3. A server, comprising:
the first acquisition module is used for acquiring target data to be sent, and the target data needs to be sent to the client with target characteristics;
a generating module, configured to generate a broadcast message according to the target data and the target feature, where the broadcast message includes the target data and the target feature;
and the broadcasting module is used for broadcasting the broadcast message so that the client with the target characteristics extracts the target data according to the target characteristics of the broadcast message.
4. A data communication method applied to a client, wherein the client is in communication connection with at least one server, and the method comprises:
acquiring a broadcast message broadcasted by the server, wherein the broadcast message is generated by the server according to target data and target characteristics of a client to which the target data needs to be sent, and the broadcast message comprises the target data and the target characteristics;
judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client side;
and if so, extracting the target data from the broadcast message.
5. The method according to claim 4, wherein in the case that the broadcast message is a broadcast event with the target feature as an event name and the target data as an event content, the acquiring the broadcast message broadcasted by the server comprises:
monitoring the broadcast event broadcasted by the server through a monitor, wherein the monitor is used for capturing an event to be captured with the characteristic of the client as an event name, and the monitor is bound with a callback function in advance;
correspondingly, the determining whether the target feature in the broadcast message is consistent with the feature of the client includes:
judging whether the event name of the broadcast event is consistent with the event name of the event to be captured;
correspondingly, the extracting the target data from the broadcast message includes:
and extracting the event content of the broadcast event through the callback function.
6. The method of claim 4, further comprising:
and updating the characteristics of the client in real time.
7. A client, comprising:
a second obtaining module, configured to obtain a broadcast message broadcasted by the server, where the broadcast message is generated by the server according to target data and target features of a client to which the target data needs to be sent, and the broadcast message includes the target data and the target features;
the judging module is used for judging whether the target characteristics in the broadcast message are consistent with the characteristics of the client; if yes, triggering an extraction module;
the extracting module is used for extracting the target data from the broadcast message.
8. A data communication system, comprising: at least one server according to claim 3 and at least one client according to claim 7 communicatively connected to said server.
9. A storage medium characterized in that it comprises a stored program, wherein the program performs the data communication method of any one of claims 1 to 2 and/or the program performs the data communication method of any one of claims 4 to 5.
10. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to perform the data communication method according to any one of claims 1 to 2 when running, and/or wherein the program is configured to perform the data communication method according to any one of claims 4 to 5 when running.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810812176.5A CN110753070A (en) | 2018-07-23 | 2018-07-23 | Data communication method, client, server and data communication system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810812176.5A CN110753070A (en) | 2018-07-23 | 2018-07-23 | Data communication method, client, server and data communication system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110753070A true CN110753070A (en) | 2020-02-04 |
Family
ID=69274987
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810812176.5A Pending CN110753070A (en) | 2018-07-23 | 2018-07-23 | Data communication method, client, server and data communication system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110753070A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115379013A (en) * | 2022-06-29 | 2022-11-22 | 广州博冠信息科技有限公司 | Data processing method and device and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101465818A (en) * | 2007-12-19 | 2009-06-24 | 百度在线网络技术(北京)有限公司 | Method, server and system for transmitting broadcast message |
CN102131148A (en) * | 2011-03-22 | 2011-07-20 | 中广传播集团有限公司 | Method for transmitting broadcast message and device for transmitting and receiving broadcast message |
CN103684808A (en) * | 2013-12-30 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Method for sending broadcast messages and server |
US20170171634A1 (en) * | 2015-12-15 | 2017-06-15 | Le Holdings (Beijing) Co., Ltd. | Method and electronic device for pushing reservation message |
CN106982420A (en) * | 2017-05-22 | 2017-07-25 | 张胜利 | A kind of information issue, propagation, method for pushing and system based on WIFI |
CN107395767A (en) * | 2017-08-31 | 2017-11-24 | 北京奇虎科技有限公司 | Message push system and method based on long connection |
-
2018
- 2018-07-23 CN CN201810812176.5A patent/CN110753070A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101465818A (en) * | 2007-12-19 | 2009-06-24 | 百度在线网络技术(北京)有限公司 | Method, server and system for transmitting broadcast message |
CN102131148A (en) * | 2011-03-22 | 2011-07-20 | 中广传播集团有限公司 | Method for transmitting broadcast message and device for transmitting and receiving broadcast message |
CN103684808A (en) * | 2013-12-30 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Method for sending broadcast messages and server |
US20170171634A1 (en) * | 2015-12-15 | 2017-06-15 | Le Holdings (Beijing) Co., Ltd. | Method and electronic device for pushing reservation message |
CN106982420A (en) * | 2017-05-22 | 2017-07-25 | 张胜利 | A kind of information issue, propagation, method for pushing and system based on WIFI |
CN107395767A (en) * | 2017-08-31 | 2017-11-24 | 北京奇虎科技有限公司 | Message push system and method based on long connection |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115379013A (en) * | 2022-06-29 | 2022-11-22 | 广州博冠信息科技有限公司 | Data processing method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109542865B (en) | Method, device, system and medium for synchronizing configuration files of distributed cluster system | |
CN106202235B (en) | Data processing method and device | |
CN110413634B (en) | Data query method, system, device and computer readable storage medium | |
CN111752799A (en) | Service link tracking method, device, equipment and storage medium | |
CN105120299A (en) | Video pushing method and video pushing device | |
CN107343018B (en) | Application service arranging method and system of PaaS cloud platform | |
CN107040576B (en) | Information pushing method and device and communication system | |
CN110764930B (en) | Request or response processing method and device based on message mode | |
CN112380229A (en) | Service data synchronization method and device, nonvolatile storage medium and processor | |
CN114676205A (en) | Event information processing method and device | |
CN108647102B (en) | Service request processing method and device of heterogeneous system and electronic equipment | |
CN110753070A (en) | Data communication method, client, server and data communication system | |
CN110958278B (en) | API gateway-based data processing method and system and API gateway | |
CN108228613B (en) | Data reading method and device | |
CN104407846B (en) | Information processing method and device | |
CN115914358A (en) | Message pushing method and device, electronic equipment and computer storage medium | |
CN108319536B (en) | Log setting method, device and equipment and computer readable storage medium | |
CN108279939B (en) | Method, device and equipment for supporting newly-added broadcast receiver by Android plug-in framework | |
CN109428915B (en) | Data acquisition method and device | |
CN108427625B (en) | Method, client, server and system for sending and recording logs | |
CN116436836B (en) | Domain name data synchronous detection method, device and equipment | |
CN117998061B (en) | Video remote screen-throwing device and video remote screen-throwing method | |
CN110865857A (en) | Screenshot method and device | |
CN111314303B (en) | Live broadcast system, and data processing method and device of live broadcast system | |
CN112579118B (en) | Method, device, system, medium and equipment for updating configuration information of micro-service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200204 |
|
RJ01 | Rejection of invention patent application after publication |