CN110597802A - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN110597802A
CN110597802A CN201810510300.2A CN201810510300A CN110597802A CN 110597802 A CN110597802 A CN 110597802A CN 201810510300 A CN201810510300 A CN 201810510300A CN 110597802 A CN110597802 A CN 110597802A
Authority
CN
China
Prior art keywords
message
determining
identification
processing
identifier
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.)
Granted
Application number
CN201810510300.2A
Other languages
Chinese (zh)
Other versions
CN110597802B (en
Inventor
田野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810510300.2A priority Critical patent/CN110597802B/en
Publication of CN110597802A publication Critical patent/CN110597802A/en
Application granted granted Critical
Publication of CN110597802B publication Critical patent/CN110597802B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a message processing method and device, and relates to the technical field of computers. One embodiment of the method comprises: determining a message identifier of a received message; determining a corresponding function realization unit according to the message identifier; and calling the function implementation unit to process the message. According to the implementation mode, the corresponding function implementation unit is determined according to the message identifier of the received message, so that the message is processed, the technical problem that the principle of variability in a program is violated in the prior art is solved, the message processing flow is simplified, the development process is simplified, and the message is processed conveniently, quickly, stably and reliably.

Description

Message processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a message.
Background
In the process of data processing, accessing various messages according to the requirements of services is a common operation, when message sources are distributed in all links of the upstream and downstream of a production system, do not belong to the same link and are perpendicular to a data processing system, the message time sequence becomes a non-negligible factor in the data processing, and the unrelated messages of different data sources arrive out of order, so that the development difficulty is increased in a geometric grade manner for part of service requirements with strict requirements on the message time sequence. For example, in the whole ecology of the e-commerce field, the data sources upstream and downstream of the production system are built in the waybill-centered data flow, and this production mode can naturally block most of the message disorder, but for some business demands with strict requirements on timing, it is unreliable to trust the vision of message ordering to unrelated message production ends.
At present, a common method is to judge each service logic in which message disorder may occur, store key information of the disorder message in a database once the message disorder is found, sort the disorder message stored in the database when a subsequent message arrives, and then perform service processing.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
in other words, what may happen in the design may change, and it should be packaged as an abstract layer, rather than what may cause design change, and the key information of the out-of-order message is temporarily stored in a database, and the data is distributed in the database in a scattered way, so that a clear information distribution situation cannot be provided.
Disclosure of Invention
In view of this, embodiments of the present invention provide a message processing method and apparatus, which conform to the principle of packaging variability in a program, and simplify a message processing flow, thereby simplifying a development process, and enabling message processing to be convenient, fast, stable, and reliable.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a message processing method including: determining a message identifier of a received message; determining a corresponding function realization unit according to the message identifier; and calling the function implementation unit to process the message.
Optionally, the determining the message identifier of the message includes: and determining the message identification of the message according to the source of the message.
Optionally, the method further comprises: determining attribute information of the message; and generating a message hash table based on the message identification and the attribute information.
Optionally, invoking the function implementation unit to process the message includes: determining semantic keywords in the function implementation unit; and processing the message according to the semantic keyword and the message hash table.
Optionally, the attribute information includes at least one of: message creation time, waybill number, message arrival time, and message arrival times.
Optionally, the method further comprises: generating a message identification chain based on the messages with the same waybill number; and when the message identification chain forms a closed loop, deleting the message identification chain.
Optionally, the method further comprises: determining whether the current message is abnormal or not according to the preset sequence of the message identifiers; if yes, outputting early warning information.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a message processing apparatus including: a message identifier determining module for determining the message identifier of the received message; a function realization unit determining module, configured to determine a corresponding function realization unit according to the message identifier; and the message processing module is used for calling the function implementation unit to process the message.
Optionally, the message identifier determining module is further configured to: and determining the message identification of the message according to the source of the message.
Optionally, the apparatus further includes an attribute information determination module, configured to: determining attribute information of the message; and generating a message hash table based on the message identification and the attribute information.
Optionally, the message processing module is further configured to: determining semantic keywords in the function implementation unit; and processing the message according to the semantic keyword and the message hash table.
Optionally, the attribute information includes at least one of: message creation time, waybill number, message arrival time, and message arrival times.
Optionally, the apparatus further comprises an identification chain module configured to: generating a message identification chain based on the messages with the same waybill number; and when the message identification chain forms a closed loop, deleting the message identification chain.
The device also comprises an early warning module used for: determining whether the current message is abnormal or not according to the preset sequence of the message identifiers; if yes, outputting early warning information.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic apparatus including: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the message processing method according to the embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program implementing a message processing method of an embodiment of the present invention when executed by a processor.
One embodiment of the above invention has the following advantages or benefits: because the corresponding function realization unit is determined according to the message identifier of the received message; the technical means for processing the message by calling the function implementation unit overcomes the technical problem that the prior art violates the principle of variability in the program, thereby achieving the technical effects of conforming to the principle of variability packaging in the program, simplifying the message processing flow, simplifying the development process and enabling the message processing to be convenient, rapid, stable and reliable.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a message processing method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a hash table in a message processing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of main blocks of a message processing apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a message processing method according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step S101: determining a message identifier of a received message;
step S102: determining a corresponding function realization unit according to the message identifier;
step S103: and calling the function implementation unit to process the message.
For step S101, the message identifier may be determined according to the source (also referred to as data source or message producer) of the message, i.e. the message identifier is used to distinguish the messages produced by different data sources. For each data source there is a unique message identification associated with it. Specifically, the message identifier may be flexibly configured according to an application scenario, and may be, for example, a character string, a number, or a combination of a character string and a number, which is not limited herein.
In an optional embodiment, the method further comprises:
determining attribute information of the message;
and generating a message hash table based on the message identification and the attribute information.
As a specific example, the attribute information may be flexibly set according to an application scenario and a service requirement, and may include at least one of the following: message creation time (create time), waybill number (waybill number), message arrival time (com time), and message arrival number (count), and may also include message validity (legacy). The waybill refers to a non-negotiable document issued by a carrier to prove that a cargo transportation contract and cargo are taken over or loaded onto a ship, a vehicle and air by the carrier, and the carrier guarantees that the cargo is handed to a designated receiver, and the waybill number is a unique identification code of the waybill and generally consists of numbers and letters. Each attribute has an attribute value, e.g., the value of the create time of a message is "2018-1-2", which means that the message was created on day 1, month 2 in 2018.
The Hash table (also called Hash table) is a data structure directly accessed according to a key value (key value), and it is used to access a record by mapping the key value to a position in the table, so as to speed up the lookup. This mapping function is called a hash function and the array in which the records are stored is called a hash table.
The hash table may be cached in a database (e.g., a redis database) to facilitate subsequent queries and analysis. As a specific example, as shown in fig. 2, the message identifier may be used as a key and the attribute information may be used as a value. Where true indicates that the message is legitimate and false indicates that the message is illegitimate.
For step S102, in this embodiment, the message processing procedure is abstracted into a plurality of separate function implementation units, that is, the message processing program is split into a plurality of separate function implementation units, and each function implementation unit implements a message processing function. In practical application, the implemented function of the function implementing unit has a specific relation with the data source, so that the message identifier determined according to the data source can be associated with the function implementing unit in advance, and when a message is received subsequently, the corresponding function implementing unit can be determined according to the message identifier of the message.
In alternative embodiments, function identifiers (e.g., strings, numbers, or combinations thereof) or numbers may be used to distinguish between different function implementing units. Further, the message identifier may be used as a key, the function identifier or the number may be used as a value, a map type may be constructed (a map provides a more general element storage method, a map set class is used to store element pairs, which are called as a "key" and a "value", where each key is mapped to a value) to be used for subsequently and rapidly invoking the function implementation unit, after the function implementation unit completes parsing, the dynamic bedstead processing class dynamically loads the processing logic in the function implementation unit, and the purpose that the code of the function implementation unit can be arbitrarily run only once parsed is achieved.
For step S103, in an optional embodiment, invoking the function implementation unit to process the message includes:
determining semantic keywords in the function implementation unit;
and processing the message according to the semantic keyword and the attribute information.
Specifically, the semantic keywords represent specific logical actions, and after the program analysis tool parses the semantic keywords, the specific logical actions are executed.
As a specific example, the semantic keyword may be as shown in table 1 below:
table 1:
semantic keywords Semantic keyword usage scenarios
if Judgment of
comed For indicating that a message has come
> Size comparison
< Size comparison
. Attributes representing a current message
[] Attributes representing cached messages
After a program analysis tool is started, reading each character of the code of the function realization unit in sequence, filtering out comments and blanks, and judging according to semantic keywords of the function realization unit as follows:
1. if the semantic keyword is if, the first character except the empty lattice at the back is judged to be a left bracket (namely a character "("), and a character right bracket (namely a character ")" is arranged after a plurality of characters), if the character string in the bracket does not comprise ">", "<", "═ and &" and the like, the input is judged to be Boolean type input, and the input is analyzed by a java language reflection technology. Wherein, the java reflection mechanism is in a running state, and all attributes and methods of any class can be known; for any object, any method and attribute thereof can be called, and the function of dynamically acquiring information and dynamically calling the object method is called as a reflection mechanism of java language.
2. If the semantic keyword is combed, judging whether the message comes in the database cache, and checking that the current character string mode is as follows: and combed, if the count >0 corresponding to the message identifier of the current waybill number is obtained from the database, the message in the cache comes, and true is returned, otherwise false is returned.
3. If the semantic keyword is ">" or "<", judging the front and back character string modes of the semantic keyword: message attribute or message identification [ message attribute ].
4. Reading the content in the symbol "{ }", wherein the content is service processing content, and performing analysis on a preset early warning function and a preset service operation function by using java reflection.
Specifically, in actual production, the interruption of the network and the backlog of the message both affect the arrival time of the message, but the production time of the message is determined, so three message function implementation units can be set:
the first function implementation unit is applied to the case that the service determination requires the support of the messages of two data sources, for example, for the same waybill, the processing of the related service can be performed only after receiving the message a1 of the data source a and the message B1 of the data source B. As a specific example, the message identifier corresponding to the data source a is waybill _ a, and the message identifier corresponding to the data source B is waybill _ B, then the code of the first function implementation unit is as follows:
where, quote is a predefined semantic keyword that represents that the message has been received. The meaning of this piece of code is: and after the two messages arrive, processing the two messages and carrying out the next flow.
For the function of the first function implementation unit, in the prior art, it is usually necessary to add a message processing logic in the message processing of the data source a and a message processing logic in the message processing of the data source B, so as to cause service redundancy.
The second function implementation unit is applied to the case of reissuing a message from the same data source, that is, for the same waybill, after receiving the message from the data source C, the second function implementation unit receives the message from the data source C. For example, if the message identifier corresponding to the data source C is waybill _ C, the code of the second function implementation unit is as follows:
where ". createtime" represents the creation time of the current message, "[ createtime ]" represents the creation time of the message that has been stored in the database, the meaning of this piece of code is: and if the creation time of the current message is greater than that of the previous message, processing the current message and carrying out the next flow.
The third function implementing unit is applied to the case of supplementary message operation, that is, for the same waybill, a message of a previous data source is received, for example, in a logistics system, a transfer message of a certain waybill is received (that is, the waybill has completed transfer), and a weighing message of the waybill is received (that is, a certain station operating the waybill has performed weighing operation again). For example, if the message identifier corresponding to the data source D is waybill _ D, the code of the third function implementation unit is as follows:
if(waybill_d.comed&&waybill_d.[waybillstate]==150)
{if(waybill_d.waybillstate==13)
{}
}
where "waybill _ d. [ waybillstate ] ═ 150" represents a pass operation, and "waybill _ d. [ waybillstate ] -. 13" represents a weighing operation. The meaning of this piece of code is: and if the weighing information is properly received, processing the weighing information and carrying out the next process.
In order to enable the message processing method of the embodiment of the invention to be seamlessly switched into the message processing system, java annotation can be customized, the message identifier is used as a default value to be assigned to a method for processing services in the processing system, a message interceptor is developed to intercept messages, and the messages are processed by utilizing the function implementation unit. The java annotation is some meta-information attached to the code, is used for some tools to perform parsing and use during compiling and running, plays a role in description and configuration, and the annotation does not influence the actual logic of the code and only plays an auxiliary role.
The message processing method of the embodiment of the invention determines the corresponding function realization unit according to the message identification of the received message; the technical means for processing the message by calling the function implementation unit overcomes the technical problem that the prior art violates the principle of variability in the program, thereby achieving the technical effects of conforming to the principle of variability packaging in the program, simplifying the message processing flow, simplifying the development process and enabling the message processing to be convenient, rapid, stable and reliable.
In an optional embodiment, the method further comprises:
generating a message identification chain based on the messages with the same waybill number;
and when the message identification chain forms a closed loop, deleting the message identification chain.
Specifically, the determination of whether the message identifier chain forms a closed loop may be flexibly set according to an application scenario, for example, N data sources (N is an integer greater than or equal to 1) are involved in a certain service, when messages of all the data sources are received, that is, when N messages are received, the message identifier chain formed by the message identifiers of the N messages is a closed loop, and when the message identifier chain forms a closed loop, it indicates that the waybill corresponding to the message identifier chain has completed all operations. As a specific example, in a logistics system, the business involves waybill generation, weighing, distribution, and due delivery, etc., and the message identification chain generated by the messages generated by the above operations is a closed loop.
When the message identification chain forms a closed loop, the cache space of the database can be released by deleting the message identification chain, and the utilization rate of the database is improved.
In an optional embodiment, the method further comprises:
determining whether the current message is abnormal or not according to the preset sequence of the message identifiers;
if yes, outputting early warning information.
In practical application, messages generated by a plurality of data sources have a chronological order. Determining whether the current message is abnormal according to a preset sequence of message identifiers may include:
judging whether the sequence of the message identifier of the currently received message is consistent with the preset sequence of the message identifier or not according to the current message identifier chain, and if so, determining that the message is normal; and if the message is inconsistent, determining that the message is abnormal. When the message is abnormal, the early warning information can be sent to the staff in the modes of mails, short messages and the like. As a specific example, an early warning function may be set in the function implementation unit, and once the message is found to be abnormal, the early warning function is called to send early warning information to the staff.
Fig. 3 is a schematic diagram of main blocks of a message processing apparatus 300 according to an embodiment of the present invention, as shown in fig. 3, the apparatus 300 including:
a message identifier determining module 301, configured to determine a message identifier of a received message;
a function implementation unit determining module 302, configured to determine a corresponding function implementation unit according to the message identifier;
a message processing module 303, configured to invoke the function implementation unit to process the message.
Optionally, the message identifier determining module 301 is further configured to: and determining the message identification of the message according to the source of the message.
Optionally, the apparatus further includes an attribute information determination module, configured to: determining attribute information of the message; and generating a message hash table based on the message identification and the attribute information.
Optionally, the message processing module 303 is further configured to: determining semantic keywords in the function implementation unit; and processing the message according to the semantic keyword and the attribute information.
Optionally, the attribute information includes at least one of: message creation time, waybill number, message arrival time, and message arrival times.
Optionally, the apparatus further comprises an identification chain module configured to: generating a message identification chain based on the messages with the same waybill number; and when the message identification chain forms a closed loop, deleting the message identification chain.
Optionally, the apparatus further comprises an early warning module configured to: determining whether the current message is abnormal or not according to the preset sequence of the message identifiers; if yes, outputting early warning information.
The message processing device of the embodiment of the invention determines the corresponding function implementation unit according to the message identifier of the received message, thereby processing the message, overcoming the technical problem of the prior art that the principle of resisting the variability in the program is violated, simplifying the message processing flow, simplifying the development process, and enabling the message processing to be convenient, rapid, stable and reliable.
The device can execute the method provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
Fig. 4 shows an exemplary system architecture 400 to which the message processing method or the message processing apparatus of the embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have various communication client applications installed thereon, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 401, 402, and 403. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that the message processing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the message processing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not in some cases constitute a limitation on the unit itself, and for example, the sending module may also be described as a "module that sends a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
determining a message identifier of a received message;
determining a corresponding function realization unit according to the message identifier;
and calling the function implementation unit to process the message.
According to the technical scheme of the embodiment of the invention, the corresponding function implementation unit is determined according to the message identifier of the received message, so that the message is processed, the technical problem that the prior art violates the principle of variability in a program is solved, the message processing flow is simplified, the development process is simplified, and the message processing is convenient, rapid, stable and reliable.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A message processing method, comprising:
determining a message identifier of a received message;
determining a corresponding function realization unit according to the message identifier;
and calling the function implementation unit to process the message.
2. The method of claim 1, wherein determining the message identification of the message comprises:
and determining the message identification of the message according to the source of the message.
3. The method of claim 2, further comprising:
determining attribute information of the message;
and generating a message hash table based on the message identification and the attribute information.
4. The method of claim 3, wherein invoking the function implementation unit to process the message comprises:
determining semantic keywords in the function implementation unit;
and processing the message according to the semantic keyword and the message hash table.
5. The method of claim 3, wherein the attribute information comprises at least one of: message creation time, waybill number, message arrival time, and message arrival times.
6. The method of claim 5, further comprising:
generating a message identification chain based on the messages with the same waybill number;
and when the message identification chain forms a closed loop, deleting the message identification chain.
7. The method of claim 6, further comprising:
determining whether the current message is abnormal or not according to the preset sequence of the message identifiers;
if yes, outputting early warning information.
8. A message processing apparatus, comprising:
a message identifier determining module for determining the message identifier of the received message;
a function realization unit determining module, configured to determine a corresponding function realization unit according to the message identifier;
and the message processing module is used for calling the function implementation unit to process the message.
9. The apparatus of claim 8, wherein the message identification determination module is further configured to: and determining the message identification of the message according to the source of the message.
10. The apparatus of claim 9, further comprising an attribute information determination module configured to:
determining attribute information of the message;
and generating a message hash table based on the message identification and the attribute information.
11. The apparatus of claim 10, wherein the message processing module is further configured to:
determining semantic keywords in the function implementation unit;
and processing the message according to the semantic keyword and the message hash table.
12. The apparatus of claim 10, wherein the attribute information comprises at least one of: message creation time, waybill number, message arrival time, and message arrival times.
13. The apparatus of claim 12, further comprising an identification chain module configured to:
generating a message identification chain based on the messages with the same waybill number;
and when the message identification chain forms a closed loop, deleting the message identification chain.
14. The apparatus of claim 13, further comprising an early warning module to:
determining whether the current message is abnormal or not according to the preset sequence of the message identifiers;
if yes, outputting early warning information.
15. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201810510300.2A 2018-05-24 2018-05-24 Message processing method and device Active CN110597802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810510300.2A CN110597802B (en) 2018-05-24 2018-05-24 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810510300.2A CN110597802B (en) 2018-05-24 2018-05-24 Message processing method and device

Publications (2)

Publication Number Publication Date
CN110597802A true CN110597802A (en) 2019-12-20
CN110597802B CN110597802B (en) 2024-09-24

Family

ID=68848569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810510300.2A Active CN110597802B (en) 2018-05-24 2018-05-24 Message processing method and device

Country Status (1)

Country Link
CN (1) CN110597802B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612679A (en) * 2021-07-29 2021-11-05 百度在线网络技术(北京)有限公司 Message verification method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779180A (en) * 2012-06-29 2012-11-14 华为技术有限公司 Operation processing method of data storage system and data storage system
WO2014206278A1 (en) * 2013-06-25 2014-12-31 Tencent Technology (Shenzhen) Company Limited Message query methods and devices
CN105095366A (en) * 2015-06-26 2015-11-25 小米科技有限责任公司 Method and device for processing character messages
CN106775626A (en) * 2016-11-14 2017-05-31 北京小米移动软件有限公司 Notification message processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779180A (en) * 2012-06-29 2012-11-14 华为技术有限公司 Operation processing method of data storage system and data storage system
WO2014206278A1 (en) * 2013-06-25 2014-12-31 Tencent Technology (Shenzhen) Company Limited Message query methods and devices
CN105095366A (en) * 2015-06-26 2015-11-25 小米科技有限责任公司 Method and device for processing character messages
CN106775626A (en) * 2016-11-14 2017-05-31 北京小米移动软件有限公司 Notification message processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612679A (en) * 2021-07-29 2021-11-05 百度在线网络技术(北京)有限公司 Message verification method and device, electronic equipment and storage medium
CN113612679B (en) * 2021-07-29 2023-02-24 百度在线网络技术(北京)有限公司 Message verification method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110597802B (en) 2024-09-24

Similar Documents

Publication Publication Date Title
CN110019080B (en) Data access method and device
US10277414B2 (en) Communication gateway services in a networked message distribution system
EP3557437B1 (en) Systems and methods for search template generation
CN111400061A (en) Data processing method and system
CN109150929B (en) Data request processing method and device under high concurrency scene
CN111125107A (en) Data processing method, device, electronic equipment and medium
CN110795315A (en) Method and device for monitoring service
CN110764796A (en) Method and device for updating cache
CN113626223A (en) Interface calling method and device
CN112818026A (en) Data integration method and device
CN111753019A (en) Data partitioning method and device applied to data warehouse
CN114003659A (en) Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
CN110705935B (en) Logistics document processing method and device
CN113641633A (en) File processing method, file processing device, electronic equipment, medium and computer program
CN113656737A (en) Webpage content display method and device, electronic equipment and storage medium
CN110688355A (en) Method and device for changing container state
CN110597802A (en) Message processing method and device
CN113761565A (en) Data desensitization method and apparatus
US11023672B1 (en) Dynamic service injection
CN112783903B (en) Method and device for generating update log
CN113760861A (en) Data migration method and device
CN113312053A (en) Data processing method and device
CN112653745B (en) Configurable message pushing method and device
CN113821519B (en) Data processing method and domain drive design architecture
CN108334560B (en) Information acquisition method and related equipment

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