CN108763534B - Method and apparatus for handling information - Google Patents
Method and apparatus for handling information Download PDFInfo
- Publication number
- CN108763534B CN108763534B CN201810550651.6A CN201810550651A CN108763534B CN 108763534 B CN108763534 B CN 108763534B CN 201810550651 A CN201810550651 A CN 201810550651A CN 108763534 B CN108763534 B CN 108763534B
- Authority
- CN
- China
- Prior art keywords
- message
- data
- processing
- push
- format
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The embodiment of the present application discloses the method and apparatus for handling information.One specific embodiment of this method includes: message that receive the message forwarding end transmission of communication connection, that format is the first preset format, wherein message includes the message subject for characterizing the type of message;Based on message subject, the Message Processing sentence for handling message is determined;Based on Message Processing sentence, message is handled, is obtained to PUSH message;The PUSH message that format is the first preset format will be converted to PUSH message, and PUSH message is pushed into message forwarding end.This embodiment improves the flexibilities of Message Processing, help to improve the compatibility of the equipment of processing information.
Description
Technical field
The invention relates to field of computer technology, and in particular to the method and apparatus for handling information.
Background technique
In current Internet of things system, the message that equipment generates needs to upload to cloud, by the processing journey for triggering cloud
Sequence carries out the processing of message, and the program of cloud operation usually supports the programming languages such as Python, NodeJS, Java, Golang, C#
Speech.Some Internet of things system include edge calculations equipment, and the message that can generate equipment is in local processing message in real time, edge meter
It calculates equipment and usually supports the programming languages such as Python, NodeJS, Java, Golang, C#.
Summary of the invention
The embodiment of the present application proposes the method and apparatus for handling information.
In a first aspect, the embodiment of the present application provides a kind of method for handling information, this method comprises: receiving communication
The message of connection forwards message that end is sent, that format is the first preset format, wherein message includes the class for characterizing message
The message subject of type;Based on message subject, the Message Processing sentence for handling message is determined;It is right based on Message Processing sentence
Message is handled, and is obtained to PUSH message;The PUSH message that format is the first preset format will be converted to PUSH message, with
And PUSH message is pushed into message forwarding end.
In some embodiments, message further includes load data;And it is based on Message Processing sentence, at message
Reason, obtains to PUSH message, comprising: is based on Message Processing sentence, pre-processes to load data, generates the second preset format
Pending data, and pending data is handled, data after being handled;It generates to PUSH message, wherein wait push away
Send message include processing after data and characterization processing after data type message subject.
In some embodiments, Message Processing sentence is structured query language SQL statement.
In some embodiments, pending data is handled, data after being handled, comprising: to Message Processing language
Sentence parsed, generate the expression formula for handling pending data, using the expression formula of generation to pending data at
Reason, data after being handled.
In some embodiments, the second preset format is key-value pair data format.
In some embodiments, the first preset format is the format for meeting default communication protocol, and default communication protocol includes
Following one: MQTT agreement, limited applications agreement COAP are transmitted in message queue telemetering.
Second aspect, the embodiment of the present application provide it is a kind of for handling the device of information, the device include: receive it is single
Member, message that be configured to receive the message forwarding end transmission of communication connection, that format is the first preset format, wherein message
Message subject including the type for characterizing message;Determination unit is configured to be determined and disappeared for handling based on message subject
The Message Processing sentence of breath;Processing unit is configured to handle message based on Message Processing sentence, obtained wait push
Message;Push unit is configured to that the PUSH message that format is the first preset format will be converted to PUSH message, and will push away
Message is sent to push to message forwarding end.
In some embodiments, message further includes load data;And processing unit includes: processing module, is configured to
Based on Message Processing sentence, load data is pre-processed, generates the pending data of the second preset format, and treats place
Reason data are handled, data after being handled;Generation module is configured to generate to PUSH message, wherein to PUSH message
Message subject including the type of data after data after processing and characterization processing.
In some embodiments, Message Processing sentence is structured query language SQL statement.
In some embodiments, processing module is further configured to: being parsed to Message Processing sentence, generation is used for
The expression formula for handling pending data, is handled pending data using the expression formula of generation, data after being handled.
In some embodiments, the second preset format is key-value pair data format.
In some embodiments, the first preset format is the format for meeting default communication protocol, and default communication protocol includes
Following one: MQTT agreement, limited applications agreement COAP are transmitted in message queue telemetering.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, which includes: one or more processing
Device;Storage device is stored thereon with one or more programs;When one or more programs are executed by one or more processors,
So that one or more processors realize the method as described in implementation any in first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, should
The method as described in implementation any in first aspect is realized when computer program is executed by processor.
Method and apparatus provided by the embodiments of the present application for handling information forward disappearing for end transmission by receiving message
Breath is handled using the corresponding Message Processing sentence of the message subject for including with received message, is obtained to PUSH message,
Generation PUSH message will be formatted to PUSH message again, and PUSH message is sent to message forwarding end, will be improved
The flexibility of Message Processing helps to improve the compatibility of the equipment of processing information.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for handling information of the application;
Fig. 3 is the schematic diagram according to an application scenarios of the method for handling information of the application;
Fig. 4 is the flow chart according to another embodiment of the method for handling information of the application;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for handling information of the application;
Fig. 6 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for handling information using the embodiment of the present application or the device for handling information
Exemplary system architecture 100.
As shown in Figure 1, system architecture 100 may include at least one news release end 101, message forwarding end 102 and disappear
Cease subscription end 103.Wherein, message forwarding end 102 is communicated with news release end 101 and message subscribing end 103 respectively by network
Connection.Above-mentioned network may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
News release end 101 can be used for acquiring various types of information, such as temperature, voltage, speed etc..Message forwarding
End 102 can be forwarded received message according to preset message pathway.Message subscribing end 103 can be forwarded by message
End 102 receives the message from news release end 101, and handles message.
News release end 101 can be hardware, be also possible to software.When news release end 101 is hardware, tool can be
There are the various electronic equipments of information collection and information transmit-receive function, including but not limited to mobile phone, intelligent appliance etc..When message is sent out
When cloth end 101 is software, it may be mounted in above-mentioned cited electronic equipment.Multiple softwares or software mould may be implemented into it
Block (such as providing the software of Distributed Services or software module), also may be implemented into single software or software module.?
This is not specifically limited.
Message subscribing end 103 can be hardware, be also possible to software.When message subscribing end 103 is hardware, tool can be
There are a various electronic equipments of Message Processing and information receiving and transmitting function, including but not limited to the network switch, micro-chip processor, above-knee
Type portable computer and desktop computer etc..When message subscribing end 103 is software, above-mentioned cited electricity may be mounted at
In sub- equipment.Multiple softwares or software module may be implemented into (such as providing the software of Distributed Services or software mould in it
Block), single software or software module also may be implemented into.It is not specifically limited herein.In general, message subscribing end can be edge
The network equipment, wherein edge network equipment refers mainly to be mounted on the equipment on edge network, and edge network includes convergence layer network
With access layer network part or all.Edge network is the final stage network of accessing user, is responsible for access device and core
The data packet of heart LA Management Room transmits.
Message forwarding end 102 can be forwarded received message according to preset message pathway.Message forwards end 102
It can be hardware, be also possible to software.When message forwarding end 102 is hardware, can be with the various of message forwarding capability
Electronic equipment, the including but not limited to network switch, router etc..When message forwarding end 102 is software, may be mounted at
In above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as providing Distributed Services in it
Software or software module), single software or software module also may be implemented into.It is not specifically limited herein.
It should be noted that above-mentioned news release end 101, message forwarding end 102 and message subscribing end 103 can be set respectively
It sets in unused electronic equipment, can also be arranged in any combination in same electronic equipment.It should be understood that the message in Fig. 1
The number of publishing side, message forwarding end and message subscribing end is only schematical.According to needs are realized, arbitrary number can have
Purpose news release end, message forwarding end and message subscribing end.In addition, message subscribing end can also have simultaneously message subscribing and
The function of news release, when the message that message subscribing end generates needs to be received by other electronic equipments, message subscribing end at this time
It can be used as news release end.
It should be noted that for handling the method for information generally by message subscribing end provided by the embodiment of the present application
103 execute, and correspondingly, the device for handling information is generally positioned in message subscribing end 103.
With continued reference to Fig. 2, the process of one embodiment of the method for handling information according to the application is shown
200.The method for being used to handle information, comprising the following steps:
Step 201, message that receive the message forwarding end transmission of communication connection, that format is the first preset format.
It in the present embodiment, can for handling the executing subject (such as message subscribing end shown in FIG. 1) of the method for information
To forward end to receive the message that format is the first preset format from message by wired connection mode or radio connection.Its
In, above-mentioned message includes the message subject for characterizing the type of message.It is preset that above-mentioned message subject can be technical staff
For the equipment of the equipment and processing message that generate message to be established to the information of corresponding relationship, which can be the classification of message
Title (such as " temperature ", " voltage " etc.) is also possible to generate the title (such as " A equipment ") of the equipment of message.As an example,
The message subject for the message that equipment A is generated is " A ", and the message that equipment A is generated can be sent to message as shown in Figure 1 first and turn
Originator, message forward end according to the mapping table of the corresponding relationship for characterizing message subject and message processing device, determine
Equipment for the processing equipment A message generated is above-mentioned executing subject, then the equipment A message generated is sent to above-mentioned execution
Main body.Above-mentioned first preset format, which can be, meets default communication protocol (such as Transmission Control Protocol (Transmission Control
Protocol, transmission control protocol) etc.) format.
In some optional implementations of the present embodiment, above-mentioned default communication protocol can include but is not limited to following
One of: MQTT (Message Queuing Telemetry Transport, message queue telemetering transmission) agreement, COAP
(Constrained Application Protocol, limited applications agreement) etc..Wherein, above-mentioned MQTT agreement and COAP agreement
It is common agreement in Internet technology, has the characteristics that lightweight, low overhead, low bandwidth occupy.Information receiving and transmitting can be improved
Efficiency.
Step 202, it is based on message subject, determines the Message Processing sentence for handling message.
In the present embodiment, based on received message in step 201, above-mentioned executing subject can be based on message subject, really
Determine the Message Processing sentence for handling message.Specifically, message subject and Message Processing sentence, which can have, pre-establishes
Corresponding relationship, the corresponding relationship can be characterized by including the mapping table of message subject and Message Processing sentence;Alternatively,
The corresponding relationship can be characterized by the mapping table including message subject and the mark of Message Processing sentence.Above-mentioned execution
Main body can determine the corresponding Message Processing sentence of the message subject of received message by above-mentioned corresponding relationship.Wherein, message
Processing sentence can be the program statement write based on various computer languages, including but not limited to following at least one:
Python, Java, Golang etc..
Step 203, it is based on Message Processing sentence, message is handled, is obtained to PUSH message.
In the present embodiment, above-mentioned executing subject can be based on Message Processing sentence, handle received message, obtain
To PUSH message.Specifically, above-mentioned executing subject can use above-mentioned Message Processing sentence and directly handle message,
Data can be extracted from message, regeneration includes treated data to PUSH message after handling data.Practice
In, generation may include message subject to PUSH message, which can be (such as alarms to the type of PUSH message
Message) or above-mentioned executing subject mark (such as " B device ").
Step 204, the PUSH message that format is the first preset format will be converted to PUSH message, and by PUSH message
Push to message forwarding end.
In the present embodiment, above-mentioned executing subject can be first the first preset format by format is converted to PUSH message
PUSH message, then by PUSH message push to message forwarding end.In general, PUSH message includes message subject, if other
Message subscribing end has subscribed the message subject, then end can be forwarded to obtain the PUSH message from message.
With continued reference to the signal that Fig. 3, Fig. 3 are according to the application scenarios of the method for handling information of the present embodiment
Figure.In the application scenarios of Fig. 3, message 303 is sent to message subscribing end 302 first by message forwarding end 301, wherein message
303 be " A:61 DEG C ", and A is the message subject of message, which characterizes the message and generated by equipment A, and equipment A monitoring
Temperature is 61 DEG C.Then, from preset each Message Processing sentence, determination is corresponding with the message subject at message subscribing end 302
Message Processing sentence, i.e. monitoring temperature sentence 304.Then, the temperature value " 61 that monitoring temperature sentence 304 includes to message 303
DEG C " be compared with preset temperature threshold (60 DEG C), determine that temperature value that message 303 includes is greater than temperature threshold, generate to
PUSH message 305 should meet the format of monitoring temperature sentence to PUSH message 305.Then, message subscribing end 302 will be wait push
Message 305 is converted to the PUSH message 306 with 303 same format of message, which is " B: temperature alarming ", wherein
" B " is the message subject of PUSH message 306, and message subject is the device name at message subscribing end 302.Stop press subscription end
PUSH message 306 is pushed to message forwarding end 301 by 302.
The method provided by the above embodiment of the application, by receive message forward end send message, using with reception
The message corresponding Message Processing sentence of message subject that includes handled, obtain to PUSH message, then will disappear wait push
Breath formats generation PUSH message, and PUSH message is sent to message forwarding end, improves the spirit of Message Processing
Activity helps to improve the compatibility of the equipment of processing information.
With continued reference to Fig. 4, it illustrates the streams according to another embodiment of the method for handling information of the application
Journey 400.This is used to handle the process 400 of the method for information, comprising the following steps:
Step 401, message that receive the message forwarding end transmission of communication connection, that format is the first preset format.
It in the present embodiment, can for handling the executing subject (such as message subscribing end shown in FIG. 1) of the method for information
To forward end to receive the message that format is the first preset format from message by wired connection mode or radio connection.Its
In, above-mentioned message includes the message subject for characterizing the type of message.It is preset that above-mentioned message subject can be technical staff
For the equipment of the equipment and processing message that generate message to be established to the information of corresponding relationship, which can be the classification of message
Title (such as " temperature ", " voltage " etc.) is also possible to generate the title (such as " A equipment ") of the equipment of message.Above-mentioned message
It further include load data, wherein load data can be the data that above-mentioned executing subject is used to handle.As an example, load number
According to can be generate message one end (such as news release end shown in FIG. 1) to target object (such as temperature, voltage etc.) into
The detection data of row detection.Above-mentioned first preset format, which can be, meets default communication protocol (such as TCP (Transmission
Control Protocol, transmission control protocol) etc.) format.
Step 402, it is based on message subject, determines the Message Processing sentence for handling message.
In the present embodiment, step 402 and the step 202 in Fig. 2 corresponding embodiment are almost the same, and which is not described herein again.
Step 403, be based on Message Processing sentence, load data is pre-processed, generate the second preset format wait locate
Data are managed, and pending data are handled, data after being handled.
In the present embodiment, above-mentioned executing subject can be primarily based on Message Processing sentence, be located in advance to load data
Reason generates the pending data of the second preset format.Wherein, above-mentioned second preset format can be above-mentioned executing subject and be counted
Supported according to processing (such as calculate, storage etc.) format (such as XML (Extensible Markup Language, it is expansible
Markup language) format etc.).Pending data can store in preset memory space, when above-mentioned executing subject need using
When pending data, it can be extracted from the memory space.
Optionally, the second preset format can be key-value pair data format.In general, key-value pair data can be with dictionary
(Dictionary) shape of format, JSON (JavaScript Object Notation, JavaScript object numbered musical notation) format
Formula storage.Wherein, dictionary is a kind of data structure, it can search its corresponding value (value) according to given key (key).
JSON is a kind of data interchange format of lightweight, is easy to people and reads and write, while being also easy to machine parsing and generating.
Then, above-mentioned executing subject can be handled pending data, data after being handled.Above-mentioned executing subject
Pending data can be handled according to preset processing mode (such as calculating, screening, deformation etc.), number after being handled
According to.
In some optional implementations of the present embodiment, above-mentioned Message Processing sentence can be SQL (Structured
Query Language, structured query language) sentence.Sql like language is advanced deproceduring programming language, and user is allowed to exist
It works in high level data structure.It does not require the specified deposit method to data of user, does not need user yet and understands specific number
According to location mode.Sql like language is write simply, and user is not necessarily to grasp what Python, Java, Golang etc. calculated commonly used in function
Programming language is suitble to non-developer to use.In practice, above-mentioned executing subject is generally arranged in edge network equipment, by side
Edge network equipments configuration can contribute to simplify programming, improve the efficiency of Message Processing at the operation for supporting sql like language.
In some optional implementations of the present embodiment, when the Message Processing sentence for handling received message is
When SQL statement, above-mentioned executing subject can in accordance with the following steps be handled pending data, data after being handled: right
Message Processing sentence is parsed, and the expression formula for handling pending data is generated, using the expression formula of generation to be processed
Data are handled, data after being handled.Above-mentioned executing subject can be according to SQL statement analytic method, to Message Processing language
Sentence is parsed, and expression formula is obtained.Wherein, the step of SQL statement analytic method, which specifically includes that, pre-processes sentence, will
Sentence segmentation is statement block, extracts object statement block.For example, including the data phase that characterization generates two equipment in SQL statement
The sentence added can then extract data from SQL statement, generate expression formula " a+b ", wherein a, b are respectively that two equipment are raw
At data.It should be noted that above-mentioned SQL statement analytic method is the well-known technique studied and applied extensively at present, herein
It repeats no more.
Step 404, it generates to PUSH message.
In the present embodiment, above-mentioned executing subject is generated to PUSH message.Wherein, the data after PUSH message includes processing
With the message subject of the type of data after characterization processing.In practice, present embodiment can be executed by preset SQL function, example
Such as, ultimately generating can be warning message, the theme of the warning message are as follows: function/alarm, the report to PUSH message
The load data of alert message are as follows: { alarm:{ device:A, temperature:61, level:warning } }.The warning message
The temperature (61 degree) for indicating equipment A has been more than preset temperature (60 degree).
Step 405, the PUSH message that format is the first preset format will be converted to PUSH message, and by PUSH message
Push to message forwarding end.
In the present embodiment, step 405 and the step 204 in Fig. 2 corresponding embodiment are almost the same, and which is not described herein again.
Figure 4, it is seen that the method for handling information compared with the corresponding embodiment of Fig. 2, in the present embodiment
Process 400 highlight load data pre-processed, obtain pending data, and handle pending data, obtain
Data after to processing ultimately generate the PUSH message including data after processing, improve the flexibility of information processing.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides one kind for handling letter
One embodiment of the device of breath, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer
For in various electronic equipments.
As shown in figure 5, the present embodiment includes: receiving unit 501 for handling the device 500 of information, it is configured to connect
Message that receive the message forwarding end transmission of communication connection, that format is the first preset format, wherein message includes disappearing for characterizing
The message subject of the type of breath;Determination unit 502 is configured to determine at the message for handling message based on message subject
Manage sentence;Processing unit 503 is configured to handle message based on Message Processing sentence, obtained to PUSH message;It pushes away
Unit 504 is sent, is configured to be converted to the PUSH message that format is the first preset format to PUSH message, and push is disappeared
Breath pushes to message forwarding end.
In the present embodiment, receiving unit 501 can be turned by wired connection mode or radio connection from message
Originator receives the message that format is the first preset format.Wherein, above-mentioned message includes the message master for characterizing the type of message
Topic.Above-mentioned message subject can be the equipment foundation pair of the preset equipment and processing message for that will generate message of technical staff
The information that should be related to, the information can be the item name (such as " temperature ", " voltage " etc.) of message, be also possible to generate message
Equipment title (such as " A equipment ").Above-mentioned first preset format, which can be, meets default communication protocol (such as TCP
(Transmission Control Protocol, transmission control protocol) etc.) format.
In the present embodiment, based on received message in receiving unit 501, above-mentioned determination unit 502 can be based on message
Theme determines the Message Processing sentence for handling message.Specifically, message subject and Message Processing sentence can have in advance
The corresponding relationship of foundation, the corresponding relationship can be by including the mapping table of message subject and Message Processing sentence come table
Sign;Alternatively, the corresponding relationship can be characterized by the mapping table including message subject and the mark of Message Processing sentence.
Above-mentioned executing subject can determine the corresponding Message Processing sentence of the message subject of received message by above-mentioned corresponding relationship.
Wherein, Message Processing sentence can be the program statement write based on various computer languages, including but not limited to below at least
It is a kind of: Python, Java, Golang etc..
In the present embodiment, processing unit 503 can be based on Message Processing sentence, handle received message, obtain
To PUSH message.Specifically, above-mentioned executing subject can use above-mentioned Message Processing sentence and directly handle message,
Data can be extracted from message, regeneration includes treated data to PUSH message after handling data.Practice
In, generation may include message subject to PUSH message, which can be (such as alarms to the type of PUSH message
Message) or above-mentioned executing subject mark (such as " B device ").
In the present embodiment, push unit 504 can be first the first preset format by format is converted to PUSH message
PUSH message, then by PUSH message push to message forwarding end.In general, PUSH message includes message subject, if other
Message subscribing end has subscribed the message subject, then end can be forwarded to obtain the PUSH message from message.
In some optional implementations of the present embodiment, message can also include load data;And processing unit
Include: processing module (not shown), is configured to pre-process load data based on Message Processing sentence, generate
The pending data of second preset format, and pending data is handled, data after being handled;Generation module (figure
In be not shown), be configured to generate to PUSH message, wherein after PUSH message include processing after data and characterization processing after number
According to type message subject.
In some optional implementations of the present embodiment, Message Processing sentence is structured query language SQL statement.
In some optional implementations of the present embodiment, above-mentioned processing module can be further configured to: be offseted
Breath processing sentence is parsed, and the expression formula for handling pending data is generated, using the expression formula of generation to number to be processed
According to being handled, data after being handled.
In some optional implementations of the present embodiment, the second preset format is key-value pair data format.
In some optional implementations of the present embodiment, the first preset format is the lattice for meeting default communication protocol
Formula, default communication protocol includes following one: MQTT agreement, limited applications agreement COAP are transmitted in message queue telemetering.
The device provided by the above embodiment of the application, by receive message forward end send message, using with reception
The message corresponding Message Processing sentence of message subject that includes handled, obtain to PUSH message, then will disappear wait push
Breath formats generation PUSH message, and PUSH message is sent to message forwarding end, improves the spirit of Message Processing
Activity helps to improve the compatibility of the equipment of processing information.
Below with reference to Fig. 6, it is (such as shown in FIG. 1 that it illustrates the electronic equipments for being suitable for being used to realize the embodiment of the present application
Message subscribing end) computer system 600 structural schematic diagram.Electronic equipment shown in Fig. 6 is only an example, should not be right
The function and use scope of the embodiment of the present application bring any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in
Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 606 and
Execute various movements appropriate and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data.
CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always
Line 604.
I/O interface 605 is connected to lower component: the storage section 606 including hard disk etc.;And including such as LAN card, tune
The communications portion 607 of the network interface card of modulator-demodulator etc..Communications portion 607 executes mailing address via the network of such as internet
Reason.Driver 608 is also connected to I/O interface 605 as needed.Detachable media 609, such as disk, CD, magneto-optic disk, half
Conductor memory etc. is mounted on as needed on driver 608, in order to as needed from the computer program read thereon
It is mounted into storage section 606.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 607, and/or from detachable media
609 are mounted.When the computer program is executed by central processing unit (CPU) 601, limited in execution the present processes
Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or
Computer-readable medium either the two any combination.Computer-readable medium for example can be --- but it is unlimited
In system, device or the device of --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or any above combination.It calculates
The more specific example of machine readable medium can include but is not limited to: electrical connection, portable meter with one or more conducting wires
Calculation machine disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory
(EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device or
The above-mentioned any appropriate combination of person.In this application, computer-readable medium, which can be, any includes or storage program has
Shape medium, the program can be commanded execution system, device or device use or in connection.And in the application
In, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, wherein
Carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to electric
Magnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable Jie
Any computer-readable medium other than matter, the computer-readable medium can be sent, propagated or transmitted for being held by instruction
Row system, device or device use or program in connection.The program code for including on computer-readable medium
It can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. or above-mentioned any conjunction
Suitable combination.
The calculating of the operation for executing the application can be write with one or more programming languages or combinations thereof
Machine program code, described program design language include object oriented program language-such as Java, Smalltalk, C+
+, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can
Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package,
Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part.
In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN)
Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service
Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet
Include receiving unit, determination unit, processing unit and push unit.Wherein, the title of these units not structure under certain conditions
The restriction of the pairs of unit itself, for example, receiving unit is also described as, " the message forwarding end for receiving communication connection is sent
, format be the first preset format message unit ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are held by the electronic equipment
When row, so that the electronic equipment: message that receive the message forwarding end transmission of communication connection, that format is the first preset format,
Wherein, message includes the message subject for characterizing the type of message;Based on message subject, the message for handling message is determined
Handle sentence;Based on Message Processing sentence, message is handled, is obtained to PUSH message;Lattice will be converted to PUSH message
Formula is the PUSH message of the first preset format, and PUSH message is pushed to message forwarding end.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein
Can technical characteristic replaced mutually and the technical solution that is formed.
Claims (14)
1. a kind of method for handling information, which comprises
Receive communication connection message forwarding end is sent, message that format is the first preset format, wherein the message includes
For characterizing the message subject of the type of the message;Wherein, the message subject is preset for that will generate setting for message
The standby equipment with processing message establishes the information of corresponding relationship;
Based on the message subject, the Message Processing sentence for handling the message is determined;
Based on the Message Processing sentence, the message is handled, is obtained to PUSH message;
The PUSH message that format is first preset format is converted to PUSH message by described, and by the PUSH message
Push to message forwarding end.
2. according to the method described in claim 1, wherein, the message further includes load data;And
It is described to be based on the Message Processing sentence, the message is handled, is obtained to PUSH message, comprising:
Based on the Message Processing sentence, the load data is pre-processed, generates the number to be processed of the second preset format
According to, and the pending data is handled, data after being handled;
It generates to PUSH message, wherein data after the data after PUSH message includes the processing and the characterization processing
Type message subject.
3. according to the method described in claim 2, wherein, the Message Processing sentence is structured query language SQL statement.
4. described to handle the pending data according to the method described in claim 3, wherein, number after being handled
According to, comprising:
The Message Processing sentence is parsed, the expression formula for handling the pending data is generated, utilizes generation
Expression formula handles the pending data, data after being handled.
5. according to the method described in claim 3, wherein, second preset format is key-value pair data format.
6. method described in one of -5 according to claim 1, wherein first preset format meets default communication protocol
Format, the default communication protocol includes following one: MQTT agreement, limited applications agreement COAP are transmitted in message queue telemetering.
7. a kind of for handling the device of information, described device includes:
Receiving unit, message that be configured to receive the message forwarding end transmission of communication connection, that format is the first preset format,
Wherein, the message includes the message subject for characterizing the type of the message;Wherein, the message subject is preset use
In the information that the equipment of the equipment and processing message that generate message is established to corresponding relationship;
Determination unit is configured to determine the Message Processing sentence for handling the message based on the message subject;
Processing unit is configured to handle the message based on the Message Processing sentence, obtained to PUSH message;
Push unit is configured to be converted to the PUSH message that format is first preset format to PUSH message for described,
And the PUSH message is pushed into the message and forwards end.
8. device according to claim 7, wherein the message further includes load data;And
The processing unit includes:
Processing module is configured to pre-process the load data based on the Message Processing sentence, it is pre- to generate second
If the pending data of format, and the pending data is handled, data after being handled;
Generation module is configured to generate to PUSH message, wherein data and the table after PUSH message includes the processing
Levy the message subject of the type of data after the processing.
9. device according to claim 8, wherein the Message Processing sentence is structured query language SQL statement.
10. device according to claim 9, wherein the processing module is further configured to: to the Message Processing
Sentence is parsed, and the expression formula for handling the pending data is generated, using the expression formula of generation to described to be processed
Data are handled, data after being handled.
11. device according to claim 9, wherein second preset format is key-value pair data format.
12. the device according to one of claim 7-11, wherein first preset format is to meet default communication protocol
Format, the default communication protocol includes following one: message queue telemetering transmit MQTT agreement, limited applications agreement
COAP。
13. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor
Such as method as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810550651.6A CN108763534B (en) | 2018-05-31 | 2018-05-31 | Method and apparatus for handling information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810550651.6A CN108763534B (en) | 2018-05-31 | 2018-05-31 | Method and apparatus for handling information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108763534A CN108763534A (en) | 2018-11-06 |
CN108763534B true CN108763534B (en) | 2019-10-18 |
Family
ID=64001521
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810550651.6A Active CN108763534B (en) | 2018-05-31 | 2018-05-31 | Method and apparatus for handling information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108763534B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111966619A (en) * | 2020-08-10 | 2020-11-20 | 北京北方华创微电子装备有限公司 | Information interaction method and device |
CN112202869B (en) * | 2020-09-27 | 2021-10-22 | 华人运通(上海)云计算科技有限公司 | Data transmission method, server, vehicle, and computer storage medium |
CN112653745B (en) * | 2020-12-16 | 2022-08-09 | 中国建设银行股份有限公司 | Configurable message pushing method and device |
CN113127232A (en) * | 2021-04-19 | 2021-07-16 | 北京京东振世信息技术有限公司 | Message processing method, device, equipment and storage medium |
CN113360292B (en) * | 2021-06-01 | 2024-03-15 | 北京百度网讯科技有限公司 | Message processing method, device, electronic equipment, storage medium and program product |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102420862A (en) * | 2011-11-29 | 2012-04-18 | 上海计算机软件技术开发中心 | Internet of things middleware message description structure and form conversion method thereof |
CN102523200A (en) * | 2011-11-29 | 2012-06-27 | 上海计算机软件技术开发中心 | Internet of things information processing method |
CN103458033A (en) * | 2013-09-04 | 2013-12-18 | 北京邮电大学 | System for providing services of event-driven service-oriented internet of things and working method thereof |
CN104007336A (en) * | 2014-05-06 | 2014-08-27 | 昆明理工大学 | Transformer on-line monitoring information polymerization method based on internet of things |
CN104899249A (en) * | 2015-05-04 | 2015-09-09 | 中国科学院信息工程研究所 | Reliable index update system and method under mass data |
CN105573760A (en) * | 2015-12-16 | 2016-05-11 | 南京邮电大学 | Storm-based processing system and method of data of Internet of Things |
CN106227899A (en) * | 2016-08-31 | 2016-12-14 | 北京京航计算通讯研究所 | The storage of the big data of a kind of internet of things oriented and querying method |
US9635118B1 (en) * | 2016-03-24 | 2017-04-25 | International Business Machines Corporation | Dynamic push notifications based on indoor micro-locations |
CN107483595A (en) * | 2017-08-23 | 2017-12-15 | 北京百度网讯科技有限公司 | Information-pushing method and device |
-
2018
- 2018-05-31 CN CN201810550651.6A patent/CN108763534B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102420862A (en) * | 2011-11-29 | 2012-04-18 | 上海计算机软件技术开发中心 | Internet of things middleware message description structure and form conversion method thereof |
CN102523200A (en) * | 2011-11-29 | 2012-06-27 | 上海计算机软件技术开发中心 | Internet of things information processing method |
CN103458033A (en) * | 2013-09-04 | 2013-12-18 | 北京邮电大学 | System for providing services of event-driven service-oriented internet of things and working method thereof |
CN104007336A (en) * | 2014-05-06 | 2014-08-27 | 昆明理工大学 | Transformer on-line monitoring information polymerization method based on internet of things |
CN104899249A (en) * | 2015-05-04 | 2015-09-09 | 中国科学院信息工程研究所 | Reliable index update system and method under mass data |
CN105573760A (en) * | 2015-12-16 | 2016-05-11 | 南京邮电大学 | Storm-based processing system and method of data of Internet of Things |
US9635118B1 (en) * | 2016-03-24 | 2017-04-25 | International Business Machines Corporation | Dynamic push notifications based on indoor micro-locations |
CN106227899A (en) * | 2016-08-31 | 2016-12-14 | 北京京航计算通讯研究所 | The storage of the big data of a kind of internet of things oriented and querying method |
CN107483595A (en) * | 2017-08-23 | 2017-12-15 | 北京百度网讯科技有限公司 | Information-pushing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108763534A (en) | 2018-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108763534B (en) | Method and apparatus for handling information | |
CN109145023A (en) | Method and apparatus for handling data | |
CN109634132A (en) | Smart home management method, device, medium and electronic equipment | |
CN109144735B (en) | Method and apparatus for processing data | |
CN109766082A (en) | The method and apparatus that the application program page jumps | |
CN108259598A (en) | A kind of awareness apparatus unified access method based on isomery fusion and cloud analytic technique | |
CN111028839B (en) | Smart home control method and device and electronic equipment | |
CN109309736A (en) | The generation method and generating means of globally unique ID | |
CN109257320A (en) | Message storage method and device | |
CN109388417A (en) | A kind of update method of communication protocol, system and terminal device | |
CN110532322A (en) | O&M exchange method, system, computer readable storage medium and equipment | |
CN109905431A (en) | Message treatment method and system, storage medium, electronic equipment | |
CN110391938A (en) | Method and apparatus for deployment services | |
CN109815107A (en) | The method and apparatus of automatic test | |
CN110427304A (en) | O&M method, apparatus, electronic equipment and medium for banking system | |
CN108924183A (en) | For handling the method and device of information | |
CN110070394A (en) | Data processing method, system, medium and calculating equipment | |
CN109471713A (en) | Method and apparatus for query information | |
CN110321252B (en) | Skill service resource scheduling method and device | |
CN108989157A (en) | Method, apparatus for smart machine control | |
CN108920309B (en) | Method and apparatus for handling information | |
CN112948138A (en) | Method and device for processing message | |
CN109005250A (en) | Method and apparatus for accessing server-side | |
CN109683942A (en) | Script management method, device, medium and electronic equipment | |
CN114707951A (en) | Alarm situation big data management method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |