Message processing method and device

By determining the message identifier and calling the function to implement unit processing of the message, the problem of violating the principle of variability encapsulation in the prior art is solved, the message processing process is simplified, and the stability and reliability of the message processing are achieved.

CN110597802BActive Publication Date: 2024-09-24BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810510300.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-05-24
Publication Date
2024-09-24
Estimated Expiration
2038-05-24

AI Technical Summary

Technical Problem

The existing technology violates the principle of encapsulation of variability in the program when processing messages, causing the message out-of-order processing logic to be hashed and distributed in various message processing services, and the key information of the out-of-order messages is scattered in the database, unable to provide clear information. information distribution.

Method used

By determining the message identifier of the received message, the corresponding function implementation unit is called for processing, a message hash table is generated, and processing is performed based on the message identifier and attribute information to form a message identifier chain, delete the closed-loop identifier chain, and output early warning information.

Benefits of technology

It simplifies the message processing process and conforms to the principle of encapsulation of variability in the program, making message processing convenient, fast, stable and reliable, and avoiding business redundancy and unnecessary occupation of database cache.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110597802B
    Figure CN110597802B
Patent Text Reader

Abstract

The present invention discloses a message processing method and device, and relates to the field of computer technology. A specific implementation of the method includes: determining a message identifier of a received message; determining a corresponding function implementation unit according to the message identifier; and calling the function implementation unit to process the message. This implementation method 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 violating the principle of variability in the program, simplifying the message processing flow, simplifying the development process, and making the message processing convenient, fast, stable and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a message processing method and device. Background Art

[0002] In the process of data processing, it is a common operation to access various messages according to business needs. When the message sources are distributed in various links of the upstream and downstream of the production system, are independent of each other, and are perpendicular to the data processing system, the message sequence becomes an important factor in data processing. The out-of-order arrival of messages from different unrelated data sources makes the development difficulty increase exponentially for some business needs that have strict requirements on message sequence. For example, in the entire ecosystem of the e-commerce field, various data sources upstream and downstream of the production system are based on data flow centered on waybills. This production model can naturally shield most of the message disorder, but for some business needs that have strict requirements on sequence, it is unreliable to pin the vision of orderly messages on unrelated message production ends.

[0003] At present, the commonly used method is to judge the business logic of each possible message disorder. Once the message disorder is found, the key information of the disordered message is stored in the database. When subsequent messages arrive, the disordered messages stored in the database are sorted and then business processing is performed.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0005] The message timing is judged at each business logic point, so that the message out-of-order processing logic is hashed and distributed in each message processing business. This violates the encapsulation principle of variability in the program (Principle of Encapsulation of Variation, EVP, that is, finding a variable factor of a system and encapsulating it. In other words, what may change in the design should be encapsulated as an abstract layer, rather than what will cause design changes). In addition, the key information of the out-of-order messages is temporarily stored in the database. These data are scattered in the database and cannot provide a clear information distribution situation. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a message processing method and device, which complies with the encapsulation principle of variability in a program, simplifies the message processing flow, thereby simplifying the development process, and makes message processing convenient, fast, stable and reliable.

[0007] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a message processing method is provided, comprising: determining a message identifier of a received message; determining a corresponding function implementation unit based on the message identifier; and calling the function implementation unit to process the message.

[0008] Optionally, determining the message identifier of the message includes: determining the message identifier of the message according to a source of the message.

[0009] Optionally, the method further includes: determining attribute information of the message; and generating a message hash table based on the message identifier and the attribute information.

[0010] Optionally, calling the function implementation unit to process the message includes: determining a semantic keyword in the function implementation unit; and processing the message according to the semantic keyword and the message hash table.

[0011] Optionally, the attribute information includes at least one of the following: message creation time, waybill number, message arrival time and message arrival count.

[0012] Optionally, the method further includes: generating a message identification chain based on messages having the same waybill number; and deleting the message identification chain when the message identification chain forms a closed loop.

[0013] Optionally, the method further includes: determining whether the current message is abnormal according to a preset order of message identifiers; and if so, outputting warning information.

[0014] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, a message processing device is provided, including: a message identifier determination module, used to determine the message identifier of a received message; a function implementation unit determination module, used to determine the corresponding function implementation unit according to the message identifier; a message processing module, used to call the function implementation unit to process the message.

[0015] Optionally, the message identifier determination module is further used to determine the message identifier of the message according to the source of the message.

[0016] Optionally, the device further comprises an attribute information determination module, configured to: determine attribute information of a message; and generate a message hash table based on a message identifier and the attribute information.

[0017] Optionally, the message processing module is further used to: determine a semantic keyword in the function implementation unit; and process the message according to the semantic keyword and the message hash table.

[0018] Optionally, the attribute information includes at least one of the following: message creation time, waybill number, message arrival time and message arrival count.

[0019] Optionally, the device further includes an identification chain module, which is used to: generate a message identification chain based on messages with the same waybill number; and delete the message identification chain when the message identification chain forms a closed loop.

[0020] The device also includes an early warning module, which is used to: determine whether the current message is abnormal according to the sequence of preset message identifiers; if so, output early warning information.

[0021] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the message processing method of an embodiment of the present invention.

[0022] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the message processing method of the embodiment of the present invention is implemented.

[0023] An embodiment of the above invention has the following advantages or beneficial effects: because the corresponding function implementation unit is determined according to the message identifier of the received message; the function implementation unit is called to process the message, so the technical problem of the prior art violating the principle of variability in the program is overcome, and then the encapsulation principle of variability in the program is achieved, the message processing flow is simplified, the development process is simplified, and the message processing is convenient, fast, stable and reliable.

[0024] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0026] Figure 1 is a schematic diagram of the main process of the message processing method according to an embodiment of the present invention;

[0027] Figure 2 is a schematic diagram of a hash table in a message processing method according to an embodiment of the present invention;

[0028] Figure 3 is a schematic diagram of main modules of a message processing device according to an embodiment of the present invention;

[0029] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0030] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0032] Figure 1 is a schematic diagram of the main flow of the message processing method according to an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0033] Step S101: determining the message identifier of the received message;

[0034] Step S102: determining a corresponding function implementation unit according to the message identifier;

[0035] Step S103: calling the function implementation unit to process the message.

[0036] For step S101, the message identifier can be determined according to the source of the message (also referred to as the data source or the message production end), that is, the message identifier is used to distinguish messages produced by different data sources. Each data source has a unique message identifier corresponding to it. Specifically, the message identifier can be flexibly configured according to the application scenario, for example, it can be a string, a number, or a combination of a string and a number, and the present invention is not limited here.

[0037] In an optional embodiment, the method further comprises:

[0038] Determine the attribute information of the message;

[0039] A message hash table is generated based on the message identifier and the attribute information.

[0040] As a specific example, the attribute information can be flexibly set according to the application scenario and business requirements, for example, it can include at least one of the following: message creation time, waybill number, message arrival time, and message arrival count, and can also include message legality. A waybill refers to a non-negotiable document issued by a carrier, which proves the cargo transportation contract and the cargo is taken over or loaded by the carrier, truck or air, and the carrier guarantees that the cargo will be delivered to the designated consignee. The waybill number is the unique identification code of the waybill, usually composed of numbers and letters. Each attribute has an attribute value. For example, if the value of the create time of a message is "2018-1-2", it means that the message was created on January 2, 2018.

[0041] The above hash table (also called hash table) is a data structure that is directly accessed based on the key value. It accesses records by mapping the key value to a position in the table to speed up the search. This mapping function is called a hash function, and the array that stores records is called a hash table.

[0042] The hash table can be cached in a database (such as a redis database) to facilitate subsequent query and analysis. As a specific example, Figure 2 As shown, the message identifier can be used as a key code and the attribute information can be used as a value. Among them, true means that the message is legal, and false means that the message is illegal.

[0043] For step S102, in this embodiment, the message processing process is abstracted into multiple separate function implementation units, that is, the message processing program is split into multiple separate function implementation units, and each function implementation unit implements a message processing function. In actual applications, the functions implemented by the function implementation units have a specific connection with the data source, so the message identifier determined according to the data source can be associated with the function implementation unit in advance, so when a message is received later, the corresponding function implementation unit can be determined according to the message identifier of the message.

[0044] In an optional embodiment, a function identifier (such as a string, a number or a combination thereof) or a number may be used to distinguish different function implementation units. Furthermore, a map type (map provides a more general element storage method, and the map collection class is used to store element pairs, called "keys" and "values", where each key is mapped to a value) may be constructed with a message identifier as the key and a function identifier or number as the value, so as to be used for subsequent rapid mobilization of function implementation units. After the function implementation unit is parsed, the dynamic bed frame processing class dynamically loads the processing logic in the function implementation unit, so that the code of the function implementation unit can be run arbitrarily as long as it is parsed once.

[0045] For step S103, in an optional embodiment, calling the function implementation unit to process the message includes:

[0046] Determining semantic keywords in the function implementation unit;

[0047] The message is processed according to the semantic keyword and the attribute information.

[0048] Specifically, semantic keywords represent specific logical actions. When the program analysis tool parses the semantic keywords, it executes the specific logical actions.

[0049] As a specific example, the semantic keywords may be shown in Table 1 below:

[0050] Table 1:

[0051] Semantic Keywords Semantic keyword usage scenarios if judge comed Used to indicate that a message has arrived > Size comparison < Size comparison . Indicates the properties of the current message [] Indicates the properties of the cached message

[0052] After starting the program analysis tool, read each character of the code of the function implementation unit in turn, filter out comments and blanks, and make the following judgments based on the semantic keywords of the function implementation unit:

[0053] 1. If the semantic keyword is if, then determine whether the first character after it excluding the space is a left bracket (i.e., the character "("), and after several characters, there is a right bracket (i.e., the character ")"). If the string in the bracket does not include ">", "<", "==", and "&&", etc., then determine that it is a Boolean input and parse it using the Java language reflection technology. Among them, the Java reflection mechanism is that in the running state, for any class, all the properties and methods of this class can be known; for any object, any of its methods and properties can be called. This function of dynamically obtaining information and dynamically calling object methods is called the reflection mechanism of the Java language.

[0054] 2. If the semantic keyword is comed, determine whether the message has arrived in the database cache. The current string pattern needs to be verified as: message identifier.comed. If the count corresponding to the message identifier of the current waybill number obtained from the database is > 0, it means that the message has arrived in the cache and returns true, otherwise returns false.

[0055] 3. If the semantic keyword is ">" or "<", determine the string pattern before and after the semantic keyword: message ID.Message attribute or message ID[message attribute].

[0056] 4. Read the content in the symbol "{}". This content is the business processing content. We will use Java reflection to parse and execute the preset warning function and business operation function.

[0057] Specifically, in actual production, network interruptions and message backlogs will affect the time when messages arrive, but the production time of messages is certain, so three message function implementation units can be set:

[0058] The first function implementation unit is applied to the case where the judgment of the business requires the support of messages from two data sources. For example, for the same waybill, only after receiving the message A1 from data source A and the message B1 from data source B, can the relevant business be processed. As a specific example, the message identifier corresponding to data source A is waybill_a, and the message identifier corresponding to data source B is waybill_b, then the code of the first function implementation unit is as follows:

[0059]

[0060] Among them, comed is a predefined semantic keyword, indicating that this message has been received. The meaning of this code is: after both messages arrive, process these two messages and proceed to the next step.

[0061] Regarding the function of the first function implementation unit mentioned above, usually in the prior art, it is necessary to add message processing logic in the message processing of data source A and the message processing of data source B, thereby causing business redundancy. However, the first function implementation unit of the embodiment of the present invention does not need to add message processing logic in the message processing of data source A and data source B, but only needs to cache the first arrived messages, and process the messages when the subsequent messages arrive, thereby avoiding business redundancy.

[0062] The second function implementation unit is applied to the case where the same data source reissues a message, that is, for the same waybill, after receiving a message from data source C, another message from data source C is received. For example, the message identifier corresponding to data source C is waybill_c, and the code of the second function implementation unit is as follows:

[0063]

[0064]

[0065] Among them, ".createtime" represents the creation time of the current message, and "[createtime]" represents the creation time of the message that has been stored in the database. The meaning of this code is: if the creation time of the current message is greater than the creation time of the previous message, the current message will be processed and the next step will be carried out.

[0066] The third function implementation unit is used for message supplement operation, that is, for the same waybill, a message from the previous data source is received. For example, in the logistics system, a delivery message of a waybill has been received (that is, the waybill has been delivered), and a weighing message of the waybill is received (that is, a station that has operated the waybill has re-weighed it). For example, the message identifier corresponding to the data source D is waybill_d, and the code of the third function implementation unit is as follows:

[0067] if(waybill_d.comed&&waybill_d.[waybillstate]===150)

[0068] {if(waybill_d.waybillstate===13)

[0069] {}

[0070] }

[0071] Among them, "waybill_d.[waybillstate]==150" indicates a successful delivery operation, and "waybill_d.waybillstate==13" indicates a weighing operation. The meaning of this code is: if a weighing message is received after a successful delivery, the weighing message is processed and the next step is carried out.

[0072] In order to make the message processing method of the embodiment of the present invention seamlessly cut into the message processing system, a custom Java annotation can be used to assign the message identifier as a default value to the method for processing business in the processing system, develop a message interceptor to intercept the message, and use the function implementation unit to process the message. Among them, Java annotations are some meta information attached to the code, which are used by some tools to parse and use during compilation and runtime, and play the functions of description and configuration. Annotations will not and cannot affect the actual logic of the code, and only play an auxiliary role.

[0073] The message processing method of the embodiment of the present invention determines the corresponding function implementation unit according to the message identifier of the received message; and calls the function implementation unit to process the message. Therefore, the technical problem that the prior art violates the principle of variability in the program is overcome, and then the encapsulation principle of variability in the program is achieved, the message processing flow is simplified, the development process is simplified, and the message processing is convenient, fast, stable and reliable.

[0074] In an optional embodiment, the method further comprises:

[0075] Generate a message identification chain based on messages with the same waybill number;

[0076] When the message identification chain forms a closed loop, the message identification chain is deleted.

[0077] Specifically, the judgment of whether the message identification chain forms a closed loop can be flexibly set according to the application scenario. For example, in a certain business, N data sources are involved (N is an integer greater than or equal to 1). When messages from all data sources are received, that is, N messages are received, the message identification chain composed of the message identifications of the N messages is a closed loop. When the message identification chain forms a closed loop, it means that the waybill corresponding to the message identification chain has completed all operations. As a specific example, in a logistics system, the business involves waybill generation, weighing, distribution, and delivery, etc., then the message identification chain generated by the messages generated by the above operations is a closed loop.

[0078] When a message identification chain forms a closed loop, deleting the message identification chain can release the cache space of the database and improve the utilization rate of the database.

[0079] In an optional embodiment, the method further comprises:

[0080] Determine whether the current message is abnormal according to the sequence of preset message identifiers;

[0081] If so, a warning message is output.

[0082] In actual applications, the messages generated by multiple data sources have a chronological order. According to the order of the preset message identifiers, determining whether the current message is abnormal may include:

[0083] According to the current message identification chain, it is determined whether the message identification of the currently received message is consistent with the sequence of the preset message identifications. If they are consistent, the message is determined to be normal; if they are inconsistent, the message is determined to be abnormal. When the message is abnormal, an early warning message can be sent to the staff by email, text message, etc. As a specific example, an early warning function can be set in the function implementation unit. Once a message abnormality is found, the early warning function is called to send an early warning message to the staff.

[0084] Figure 3 is a schematic diagram of the main modules of the message processing device 300 according to an embodiment of the present invention, such as Figure 3 As shown, the device 300 includes:

[0085] A message identification determination module 301, used to determine the message identification of a received message;

[0086] A function implementation unit determination module 302, used to determine a corresponding function implementation unit according to the message identifier;

[0087] The message processing module 303 is used to call the function implementation unit to process the message.

[0088] Optionally, the message identifier determination module 301 is further used to determine the message identifier of the message according to the source of the message.

[0089] Optionally, the device further comprises an attribute information determination module, configured to: determine attribute information of a message; and generate a message hash table based on a message identifier and the attribute information.

[0090] Optionally, the message processing module 303 is further used to: determine the semantic keywords in the function implementation unit; and process the message according to the semantic keywords and the attribute information.

[0091] Optionally, the attribute information includes at least one of the following: message creation time, waybill number, message arrival time and message arrival count.

[0092] Optionally, the device further includes an identification chain module, which is used to: generate a message identification chain based on messages with the same waybill number; and delete the message identification chain when the message identification chain forms a closed loop.

[0093] Optionally, the device further comprises an early warning module, which is used to: determine whether the current message is abnormal according to a preset sequence of message identifiers; if so, output early warning information.

[0094] The message processing device of the embodiment of the present 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 violating the principle of variability in the program, simplifying the message processing flow, simplifying the development process, and making message processing convenient, fast, stable and reliable.

[0095] The above device can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.

[0096] Figure 4 An exemplary system architecture 400 is shown to which the message processing method or message processing apparatus according to the embodiment of the present invention can be applied.

[0097] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0098] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0099] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0100] Server 405 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using terminal devices 401, 402, and 403. The backend management server may analyze and process received data such as product information query requests, and feed back processing results (such as target push information and product information) to the terminal device.

[0101] It should be noted that the message processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the message processing device is generally arranged in the server 405 .

[0102] It should be understood that Figure 4The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0103] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0104] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which 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 part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0105] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0106] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0107] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a sending module, an acquisition module, a determination module, and a first processing module. The names of these modules do not, in some cases, constitute a limitation on the unit itself. For example, the sending module may also be described as a "module for sending a picture acquisition request to the connected server."

[0110] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0111] determining a message identifier of a received message;

[0112] Determine a corresponding function implementation unit according to the message identifier;

[0113] The function implementation unit is called to process the message.

[0114] The technical solution of the embodiment of the present invention determines the corresponding function implementation unit according to the message identifier of the received message, thereby processing the message, overcoming the technical problem that the prior art violates the principle of variability in the program, simplifies the message processing flow, simplifies the development process, and makes message processing convenient, fast, stable and reliable.

[0115] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A message processing method, It is characterized in that include: determining a message identifier of a received message; Determine a corresponding function implementation unit according to the message identifier; Calling the function implementation unit to process the message, including: determining a semantic keyword in the function implementation unit; processing the message according to the semantic keyword and a message hash table with a message identifier as a key code and attribute information of the message as a value; The method also includes: determining the attribute information of the message, obtaining the messages having the same waybill number in the attribute information, and generating a message identification chain; and when the message identification chain forms a closed loop, deleting the message identification chain.

2. The method according to claim 1, It is characterized in that The message identifier of the confirmation message includes: Determine the message ID of the message based on the source of the message.

3. The method according to claim 2, It is characterized in that The method further comprises: Determine the attribute information of the message; A message hash table is generated based on the message identifier and the attribute information.

4. The method according to claim 3, It is characterized in that The attribute information includes at least one of the following: message creation time, waybill number, message arrival time and message arrival times.

5. The method according to claim 4, It is characterized in that The method further comprises: Determine whether the current message is abnormal according to the sequence of preset message identifiers; If so, a warning message is output.

6. A message processing device, It is characterized in that include: A message identification determination module, used to determine the message identification of a received message; A function implementation unit determination module, used to determine the corresponding function implementation unit according to the message identifier; A message processing module, used for calling the function implementation unit to process the message; The identification chain module is used to determine the attribute information of the message, obtain the messages with the same waybill number in the attribute information, and generate a message identification chain; when the message identification chain forms a closed loop, the message identification chain is deleted.

7. The device according to claim 6, It is characterized in that The message identifier determination module is further used to determine the message identifier of the message according to the source of the message.

8. The device according to claim 7, It is characterized in that The device also includes an attribute information determination module, which is used to: Determine the attribute information of the message; A message hash table is generated based on the message identifier and the attribute information.

9. The device according to claim 8, It is characterized in that The attribute information includes at least one of the following: message creation time, waybill number, message arrival time and message arrival times.

10. The device according to claim 6, It is characterized in that The device also includes an early warning module, which is used to: Determine whether the current message is abnormal according to the sequence of preset message identifiers; If so, a warning message is output.

11. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

12. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.