CN114816371B - Message processing method, device, equipment and medium - Google Patents

Message processing method, device, equipment and medium Download PDF

Info

Publication number
CN114816371B
CN114816371B CN202210746463.7A CN202210746463A CN114816371B CN 114816371 B CN114816371 B CN 114816371B CN 202210746463 A CN202210746463 A CN 202210746463A CN 114816371 B CN114816371 B CN 114816371B
Authority
CN
China
Prior art keywords
message
type
target
configuration file
field
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210746463.7A
Other languages
Chinese (zh)
Other versions
CN114816371A (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.)
Shanghai Huarui Software Co ltd
Shenzhen Huarui Distributed Technology Co ltd
Original Assignee
Shanghai Huarui Software Co ltd
Shenzhen Huarui Distributed 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 Shanghai Huarui Software Co ltd, Shenzhen Huarui Distributed Technology Co ltd filed Critical Shanghai Huarui Software Co ltd
Priority to CN202210746463.7A priority Critical patent/CN114816371B/en
Publication of CN114816371A publication Critical patent/CN114816371A/en
Application granted granted Critical
Publication of CN114816371B publication Critical patent/CN114816371B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • 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

Abstract

The invention relates to the field of development, and provides a message processing method, a device, equipment and a medium, which can lead a constructed configuration file into an upstream system at an initialization stage of the upstream system when the start of the upstream system is detected, automatically generate an analysis code corresponding to each message type according to the configuration file, reduce the development cost of the analysis code, improve the development efficiency, further analyze a target message according to the message type of the target message and the analysis code to obtain message content, consume the target message according to the message content, and effectively improve the message processing efficiency by a full-automatic code generation and consumption mode.

Description

Message processing method, device, equipment and medium
Technical Field
The present invention relates to the field of development technologies, and in particular, to a method, an apparatus, a device, and a medium for processing a message.
Background
In a security trading system, message fields of different service types are different, so that in order to accurately analyze and consume each service message, a downstream system needs to perform a large amount of coding analysis according to the service types when processing the message, the development cost is high, the lead cycle is long, and the message processing efficiency is low.
Disclosure of Invention
In view of the above, it is necessary to provide a message processing method, device, apparatus and medium, aiming at solving the problem of low message processing efficiency.
A message processing method, the message processing method comprising:
constructing a configuration file according to the message type;
when detecting that an upstream system is started, importing the configuration file into the upstream system at an initialization stage of the upstream system, and generating an analysis code corresponding to each message type according to the configuration file;
when a binary message is received, determining the received binary message as a target message, and acquiring the message type of the target message as a target type;
analyzing the target message according to the target type and the analysis code to obtain message content;
and consuming the target message according to the message content.
According to a preferred embodiment of the present invention, after the configuration file is constructed according to the message type, the method further comprises:
when detecting that a new message type exists, generating a new configuration item according to the new message type;
adding the newly added configuration item to the configuration file;
wherein the configuration file includes a constant value part representing an application layer field type, and a structure having a unique return attribute.
According to a preferred embodiment of the present invention, the generating of the parsing code corresponding to each message type according to the configuration file includes:
determining field contents corresponding to all fields in the message corresponding to each message type according to the configuration file;
and generating a resolving code corresponding to each message type according to the field content corresponding to each field based on a dynamic code generation technology.
According to the preferred embodiment of the present invention, the obtaining the message type of the target message as the target type includes:
acquiring a message number of the target message;
determining the message type of the target message according to the message number of the target message;
and determining the message type of the target message as the target type.
According to a preferred embodiment of the present invention, the parsing the target message according to the target type and the parsing code comprises:
acquiring a sub-code corresponding to the target type from the analysis code;
analyzing the target message by using the subcode;
in the analysis process, when an inherit keyword is detected to exist in a message body of the target message, determining that an inheritance relationship exists, determining the name of a relay body according to the field content corresponding to the inherit keyword, and preferentially analyzing the relay body according to the name of the relay body;
in the analysis process, the original type attribute of each field in the target message is obtained, and the type attribute of the configuration file is associated according to the original type attribute to obtain the field type corresponding to each field in the target message.
According to a preferred embodiment of the present invention, said consuming said targeted message according to said message content comprises:
and pushing the message content to a downstream system.
According to a preferred embodiment of the present invention, said consuming said targeted message according to said message content further comprises:
acquiring a table structure and service data of a configuration database;
performing expression operation on the message content according to the service data to obtain an operation result;
and adding the operation result to each field corresponding to the table structure.
A message processing apparatus, the message processing apparatus comprising:
the construction unit is used for constructing a configuration file according to the message type;
the generating unit is used for importing the configuration file into an upstream system in an initialization stage of the upstream system when the upstream system is detected to be started, and generating an analysis code corresponding to each message type according to the configuration file;
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining the received binary message as a target message when the binary message is received, and acquiring the message type of the target message as the target type;
the analysis unit is used for analyzing the target message according to the target type and the analysis code to obtain message content;
and the consumption unit is used for consuming the target message according to the message content.
A computer device, the computer device comprising:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the message processing method.
A computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the message processing method.
According to the technical scheme, the analysis code can be automatically generated based on the configuration file of the upstream system, so that the development cost is reduced, and the message processing efficiency is improved.
Drawings
Fig. 1 is a flow chart of a preferred embodiment of the message processing method of the present invention.
Fig. 2 is a functional block diagram of a preferred embodiment of the message processing apparatus of the present invention.
Fig. 3 is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention for implementing a message processing method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flow chart of a message processing method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The message processing method is applied to one or more computer devices, which are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive web Television (IPTV), an intelligent wearable device, and the like.
The computer device may also include a network device and/or a user device. The network device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network servers.
The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform.
Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The Network in which the computer device is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
And S10, constructing a configuration file according to the message type.
In this embodiment, the configuration file refers to an encoding configuration file for an upstream message in an upstream system.
For the analysis and storage of the messages of the newly added service types, only software application programs can be updated in the traditional mode, and the development and test period is longer.
Therefore, for the new message type, after the configuration file is constructed according to the message type, the method further includes:
when detecting that a new message type exists, generating a new configuration item according to the new message type;
adding the newly added configuration item to the configuration file;
wherein the configuration file includes a constant value part representing the application layer field type, and a structure with a unique return attribute (i.e., name attribute).
Wherein the application layer field types may include, but are not limited to: amount type, username type, etc.
According to the method, the analysis requirement on the type of the newly added message can be met by adding the configuration item, the original hard coding process is split into the configurable structural mode, and the development efficiency is effectively improved.
S11, when the upstream system is detected to be started, the configuration file is imported into the upstream system in the initialization stage of the upstream system, and the analysis code corresponding to each message type is generated according to the configuration file.
In a traditional message analysis mode, an independent code needs to be generated in each analysis, and the development cost is high.
For example: for a distributed security trading platform, the types of messages are more, the analysis fields of different message numbers are different, when a message is added, a plurality of code classes such as an entity class, an analysis implementation class and a persistence implementation class need to be added synchronously, alignment with an upstream message field can be achieved only through full joint debugging, and development cost is high.
In order to solve the above problems, the present embodiment implements automatic decoding of a downstream message based on an upstream message encoding configuration file, and because the same configuration is used, there is no problem of message alignment, the decoding process is the reverse order of the encoding process, and a multilayer inheritance relationship is tiled into a sequential structure by using recursion, and layer-by-layer skipping is not performed when a message is analyzed, thereby reducing the complexity of the program.
Specifically, the generating an analysis code corresponding to each message type according to the configuration file includes:
determining field contents corresponding to all fields in the message corresponding to each message type according to the configuration file;
and generating a resolving code corresponding to each message type according to the field content corresponding to each field based on a dynamic code generation technology.
The embodiment generates the analysis code in the initialization stage when the upstream system is started, thereby avoiding the influence on the efficiency of message processing caused by regeneration when the analysis is required, and simultaneously avoiding the influence on various performances of the system in normal operation.
S12, when the binary message is received, the received binary message is determined as a target message, and the message type of the target message is acquired as the target type.
It should be noted that, in order to reduce the delay problem in the message passing process between the upstream system and the downstream system, the message passing is usually performed in the form of binary message. However, the problem is that the downstream system needs to analyze the received binary message to obtain the information carried by the binary message.
In at least one embodiment of the present invention, the obtaining the message type of the target message as the target type includes:
acquiring a message number of the target message;
determining the message type of the target message according to the message number of the target message;
and determining the message type of the target message as the target type.
Wherein the message number is a unique identification of the message type.
And S13, analyzing the target message according to the target type and the analysis code to obtain message content.
In at least one embodiment of the present invention, the parsing the target message according to the target type and the parsing code comprises:
acquiring a sub-code corresponding to the target type from the analysis code;
analyzing the target message by using the subcode;
in the analysis process, when an inherit keyword is detected to exist in a message body of the target message, determining that an inheritance relationship exists, determining the name of a relay body according to the field content corresponding to the inherit keyword, and preferentially analyzing the relay body according to the name of the relay body;
in the parsing process, the original type attribute of each field in the target message is obtained, and the type attribute of the configuration file is associated according to the original type attribute (primativetype attribute), so that the field type corresponding to each field in the target message is obtained.
For example: and when an inheritance relationship exists, using an inherit keyword to refer to the name of the relay, if the relay is encountered during the initialization of the data persistence service, recursively analyzing the relay first and using the relay as the foremost field of the target message, and simultaneously sequentially arranging other analyzed fields according to the field sequence to obtain the complete field of the message. Each field is associated with the type attribute of the configuration file according to the primativetype attribute, so that the field types in C + + such as char, unit8, int64 and the like can be obtained, the binary length relations corresponding to the types are fixed mapping relations, and therefore the binary message body (namely the message body of the target message) can be automatically analyzed according to the analyzed configuration without additional hard coding, development efficiency is improved, and development cost is reduced.
According to the embodiment, the differentiation of message structures among different message types is eliminated through configuration, so that the different message types can be uniformly processed by using the same frame logic, developers do not need to hard code each message, and the execution efficiency is improved.
S14, consuming the target message according to the message content.
In this embodiment, the consuming the target message according to the message content includes:
and pushing the message content to a downstream system.
In this embodiment, the consuming the target message according to the message content further includes:
acquiring a table structure and service data of a configuration database;
performing expression operation on the message content according to the service data to obtain an operation result;
and adding the operation result to each field corresponding to the table structure.
For example: the table structure may use a List as a reference data structure, the fields are added in sequence, and the fields include field names, field types, field lengths, and field indexes.
The service data refers to specific service demand data, and according to the service demand data, the message content can be subjected to expression operations including addition, subtraction, multiplication, division, multi-field combination operation and the like.
In the embodiment, the analyzed fields are injected into the corresponding fields of each database table based on the analyzed message structure, and before injection, expression operation can be performed on each field, so that the original persistent codes are simplified into a row of warehousing configuration table records, and the warehousing efficiency is improved.
According to the technical scheme, when the starting of the upstream system is detected, the constructed configuration file is imported into the upstream system in the initialization stage of the upstream system, the analysis code corresponding to each message type is automatically generated according to the configuration file, the development cost of the analysis code is reduced, the development efficiency is improved, the target message is further analyzed according to the message type of the target message and the analysis code to obtain the message content, the target message is consumed according to the message content, and the message processing efficiency is effectively improved through the full-automatic code generation and consumption mode.
Fig. 2 is a functional block diagram of a message processing apparatus according to a preferred embodiment of the present invention. The message processing apparatus 11 includes a construction unit 110, a generation unit 111, a determination unit 112, a parsing unit 113, and a consumption unit 114. A module/unit as referred to herein is a series of computer program segments stored in a memory that can be executed by a processor and that can perform a fixed function. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
The construction unit 110 constructs a configuration file according to the message type.
In this embodiment, the configuration file refers to an encoding configuration file for an upstream message in an upstream system.
For the analysis and storage of the messages of the newly added service types, only software application programs can be updated in the traditional mode, and the development and test period is longer.
Therefore, aiming at the type of the newly added message, after the configuration file is constructed according to the type of the message, when the type of the newly added message is detected, the newly added configuration item is generated according to the type of the newly added message;
adding the newly added configuration item to the configuration file;
wherein the configuration file includes a constant value part representing the application layer field type, and a structure with a unique return attribute (i.e., name attribute).
Wherein the application layer field types may include, but are not limited to: amount type, username type, etc.
According to the method, the analysis requirement on the type of the newly added message can be met by adding the configuration item, the original hard coding process is split into the configurable structural mode, and the development efficiency is effectively improved.
When detecting that an upstream system is started, the generating unit 111 imports the configuration file into the upstream system at an initialization stage of the upstream system, and generates an analysis code corresponding to each message type according to the configuration file.
In a traditional message analysis mode, an independent code needs to be generated in each analysis, and the development cost is high.
For example: for a distributed security trading platform, the types of messages are more, the analysis fields of different message numbers are different, when a message is added, a plurality of code classes such as an entity class, an analysis implementation class and a persistence implementation class need to be added synchronously, alignment with an upstream message field can be achieved only through full joint debugging, and development cost is high.
In order to solve the above problem, the present embodiment implements automatic decoding of a downstream message based on an upstream message encoding configuration file, and because the same configuration is used, there is no problem of message alignment, the decoding process is the reverse order of the encoding process, and a multilayer inheritance relationship is tiled into a sequential structure by using recursion, and no layer-by-layer jump is performed when a message is analyzed, thereby reducing the complexity of the program.
Specifically, the generating unit 111 generates the parsing code corresponding to each message type according to the configuration file includes:
determining field contents corresponding to all fields in the message corresponding to each message type according to the configuration file;
and generating a resolving code corresponding to each message type according to the field content corresponding to each field based on a dynamic code generation technology.
The embodiment generates the analysis code in the initialization stage when the upstream system is started, thereby avoiding the influence on the efficiency of message processing caused by regeneration when the analysis is required, and simultaneously avoiding the influence on various performances of the system in normal operation.
When a binary message is received, the determination unit 112 determines the received binary message as a target message, and acquires a message type of the target message as a target type.
It should be noted that, in order to reduce the delay problem in the message transmission process between the upstream system and the downstream system, the message transmission is usually performed in the form of binary messages. However, the problem is that the downstream system needs to analyze the received binary message to obtain the information carried by the binary message.
In at least one embodiment of the present invention, the determining unit 112 obtaining the message type of the target message as the target type includes:
acquiring a message number of the target message;
determining the message type of the target message according to the message number of the target message;
and determining the message type of the target message as the target type.
Wherein the message number is a unique identification of the message type.
The parsing unit 113 parses the target message according to the target type and the parsing code to obtain a message content.
In at least one embodiment of the present invention, the parsing unit 113 parsing the target message according to the target type and the parsing code includes:
acquiring a sub-code corresponding to the target type from the analysis code;
analyzing the target message by using the subcode;
in the analysis process, when an inherit keyword is detected to exist in a message body of the target message, determining that an inheritance relationship exists, determining the name of a relay body according to the field content corresponding to the inherit keyword, and preferentially analyzing the relay body according to the name of the relay body;
in the parsing process, the original type attribute of each field in the target message is obtained, and the type attribute of the configuration file is associated according to the original type attribute (primativetype attribute), so that the field type corresponding to each field in the target message is obtained.
For example: and when an inheritance relationship exists, using an inherit keyword to refer to the name of the relay, if the relay is encountered during the initialization of the data persistence service, recursively analyzing the relay first and using the relay as the foremost field of the target message, and simultaneously sequentially arranging other analyzed fields according to the field sequence to obtain the complete field of the message. Each field is associated with the type attribute of the configuration file according to the primaivetype attribute, so that the field types in C + + such as char, unit8, int64 and the like can be obtained, the binary length relations corresponding to the types are fixed mapping relations, and therefore, the binary message body (namely the message body of the target message) can be automatically analyzed according to the analyzed configuration without additional hard coding, the development efficiency is improved, and the development cost is reduced.
According to the embodiment, the differentiation of message structures among different message types is eliminated through configuration, so that the same frame logic can be used for uniformly processing the different message types, developers do not need to hard code each message, and the execution efficiency is improved.
The parsing unit 113 consumes the targeted message according to the message content.
In this embodiment, the consuming, by the parsing unit 113, the target message according to the message content includes:
and pushing the message content to a downstream system.
In this embodiment, the consuming the target message according to the message content further includes:
acquiring a table structure and service data of a configuration database;
performing expression operation on the message content according to the service data to obtain an operation result;
and adding the operation result to each field corresponding to the table structure.
For example: the table structure may use a List as a reference data structure, the fields are added in sequence, and the fields include field names, field types, field lengths, and field indexes.
The service data refers to specific service demand data, and according to the service demand data, expression operations including addition, subtraction, multiplication and division, multi-field combination operation and the like can be performed on the message content.
In the embodiment, the analyzed fields are injected into the corresponding fields of each database table based on the analyzed message structure, and before injection, expression operation can be performed on each field, so that the original persistent codes are simplified into a row of warehousing configuration table records, and the warehousing efficiency is improved.
According to the technical scheme, when the starting of the upstream system is detected, the constructed configuration file is imported into the upstream system in the initialization stage of the upstream system, the analysis code corresponding to each message type is automatically generated according to the configuration file, the development cost of the analysis code is reduced, the development efficiency is improved, the target message is further analyzed according to the message type of the target message and the analysis code to obtain the message content, the target message is consumed according to the message content, and the message processing efficiency is effectively improved through the full-automatic code generation and consumption mode.
Fig. 3 is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention for implementing a message processing method.
The computer device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program, such as a message handling program, stored in the memory 12 and executable on the processor 13.
It will be understood by those skilled in the art that the schematic diagram is merely an example of the computer device 1, and does not constitute a limitation to the computer device 1, the computer device 1 may have a bus-type structure or a star-shaped structure, the computer device 1 may further include more or less other hardware or software than those shown, or different component arrangements, for example, the computer device 1 may further include an input and output device, a network access device, etc.
It should be noted that the computer device 1 is only an example, and other electronic products that are now or may come into existence in the future, such as may be adapted to the present invention, should also be included within the scope of the present invention, and are hereby incorporated by reference.
The memory 12 includes at least one type of readable storage medium, which includes flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 12 may in some embodiments be an internal storage unit of the computer device 1, for example a removable hard disk of the computer device 1. The memory 12 may also be an external storage device of the computer device 1 in other embodiments, such as a plug-in removable hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the computer device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the computer device 1. The memory 12 can be used not only for storing application software installed in the computer apparatus 1 and various kinds of data such as a code of a message processing program, etc., but also for temporarily storing data that has been output or is to be output.
The processor 13 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 13 is a Control Unit (Control Unit) of the computer device 1, connects various components of the whole computer device 1 by various interfaces and lines, and executes various functions of the computer device 1 and processes data by running or executing programs or modules (for example, executing a message processing program and the like) stored in the memory 12 and calling data stored in the memory 12.
The processor 13 executes the operating system of the computer device 1 and various installed application programs. The processor 13 executes the application program to implement the steps in the various message processing method embodiments described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units, which are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing certain functions, which are used to describe the execution of the computer program in the computer device 1. For example, the computer program may be divided into a building unit 110, a generating unit 111, a determining unit 112, a parsing unit 113, a consuming unit 114.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute parts of the message processing method according to the embodiments of the present invention.
The modules/units integrated by the computer device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random-access Memory, or the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one line is shown in FIG. 3, but that does not indicate only one bus or type of bus. The bus is arranged to enable connection communication between the memory 12 and at least one processor 13 etc.
Although not shown, the computer device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 13 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The computer device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the computer device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the computer device 1 and other computer devices.
Optionally, the computer device 1 may further comprise a user interface, which may be a Display (Display), an input unit, such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the computer device 1 and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
Fig. 3 shows only the computer device 1 with the components 12-13, and it will be understood by a person skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the computer device 1 and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
With reference to fig. 1, the memory 12 of the computer device 1 stores a plurality of instructions to implement a message processing method, and the processor 13 can execute the plurality of instructions to implement:
constructing a configuration file according to the message type;
when detecting that an upstream system is started, importing the configuration file into the upstream system at an initialization stage of the upstream system, and generating an analysis code corresponding to each message type according to the configuration file;
when a binary message is received, determining the received binary message as a target message, and acquiring the message type of the target message as a target type;
analyzing the target message according to the target type and the analysis code to obtain message content;
and consuming the target message according to the message content.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
It should be noted that all the data involved in the present application are legally acquired.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The invention is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the present invention may also be implemented by one unit or means through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (8)

1. A message processing method, characterized in that the message processing method comprises:
constructing a configuration file according to the message type, wherein the configuration file refers to an encoding configuration file of an upstream message in an upstream system of a distributed transaction platform, and the message type refers to a service type;
when the upstream system is detected to be started, the configuration file is imported into the upstream system in the initialization stage of the upstream system, and an analysis code corresponding to each message type is generated according to the configuration file;
when a binary message is received, determining the received binary message as a target message, and acquiring the message type of the target message as a target type;
analyzing the target message according to the target type and the analysis code to obtain message content, wherein analyzing the target message according to the target type and the analysis code comprises: acquiring a sub-code corresponding to the target type from the analysis code; analyzing the target message by utilizing the subcode; in the analysis process, when an inherit keyword is detected to exist in a message body of the target message, determining that an inheritance relationship exists, determining the name of a relay body according to the field content corresponding to the inherit keyword, and preferentially analyzing the relay body according to the name of the relay body; acquiring the original type attribute of each field in the target message in the analysis process, and associating the typeattributes of the configuration files according to the original type attributes to obtain the field type corresponding to each field in the target message;
consuming the target message according to the message content;
wherein after constructing the configuration file according to the message type, the method further comprises: when detecting that a new message type exists, generating a new configuration item according to the new message type; adding the newly added configuration item to the configuration file; the configuration file comprises a constant value part for representing the type of an application layer field and a structural body with a unique return attribute, wherein the type of the application layer field comprises an amount type and a user name type.
2. The message processing method of claim 1, wherein the generating a parsing code corresponding to each message type according to the configuration file comprises:
determining field contents corresponding to all fields in the message corresponding to each message type according to the configuration file;
and generating a resolving code corresponding to each message type according to the field content corresponding to each field based on a dynamic code generation technology.
3. The message processing method of claim 1, wherein the obtaining the message type of the target message as a target type comprises:
acquiring a message number of the target message;
determining the message type of the target message according to the message number of the target message;
and determining the message type of the target message as the target type.
4. A message processing method as recited in claim 1, wherein the consuming the targeted message in accordance with the message content comprises:
and pushing the message content to a downstream system.
5. A message processing method according to claim 1, wherein said consuming the targeted message according to the message content, further comprises:
acquiring a table structure and service data of a configuration database;
performing expression operation on the message content according to the service data to obtain an operation result;
and adding the operation result to each field corresponding to the table structure.
6. A message processing apparatus, characterized in that the message processing apparatus comprises:
the system comprises a construction unit, a configuration unit and a processing unit, wherein the construction unit is used for constructing a configuration file according to a message type, the configuration file refers to an encoding configuration file of an upstream message in an upstream system of a distributed transaction platform, and the message type refers to a service type;
the generating unit is used for importing the configuration file into the upstream system in an initialization stage of the upstream system when the upstream system is detected to be started, and generating an analysis code corresponding to each message type according to the configuration file;
the system comprises a determining unit, a judging unit and a sending unit, wherein the determining unit is used for determining a received binary message as a target message when the binary message is received, and acquiring the message type of the target message as a target type;
the analysis unit is configured to analyze the target message according to the target type and the analysis code to obtain a message content, where analyzing the target message according to the target type and the analysis code includes: acquiring a sub-code corresponding to the target type from the analysis code; analyzing the target message by using the subcode; in the analysis process, when an inherit keyword is detected to exist in a message body of the target message, determining that an inheritance relationship exists, determining the name of a relay according to the field content corresponding to the inherit keyword, and preferentially analyzing the relay according to the name of the relay; in the analysis process, acquiring an original type attribute of each field in the target message, and associating a type attribute of the configuration file according to the original type attribute to obtain a field type corresponding to each field in the target message;
the consumption unit is used for consuming the target message according to the message content;
after the configuration file is constructed according to the message type, when a new message type is detected, generating a new configuration item according to the new message type; adding the newly added configuration item to the configuration file; the configuration file comprises a constant value part for representing the application layer field type and a structural body with a unique return attribute, and the application layer field type comprises a money amount type and a user name type.
7. A computer device, characterized in that the computer device comprises:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the message processing method of any of claims 1 to 5.
8. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein at least one instruction that is executed by a processor in a computer device to implement the message processing method of any one of claims 1 to 5.
CN202210746463.7A 2022-06-29 2022-06-29 Message processing method, device, equipment and medium Active CN114816371B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210746463.7A CN114816371B (en) 2022-06-29 2022-06-29 Message processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210746463.7A CN114816371B (en) 2022-06-29 2022-06-29 Message processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114816371A CN114816371A (en) 2022-07-29
CN114816371B true CN114816371B (en) 2022-11-08

Family

ID=82522257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210746463.7A Active CN114816371B (en) 2022-06-29 2022-06-29 Message processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114816371B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116455997B (en) * 2023-06-12 2023-08-22 深圳华锐分布式技术股份有限公司 STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309002A (en) * 2019-05-29 2019-10-08 北京达佳互联信息技术有限公司 Message treatment method, device, electronic equipment and storage medium
CN111596905A (en) * 2020-05-09 2020-08-28 远光软件股份有限公司 Method, device, storage medium and terminal for generating java object

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10223176B1 (en) * 2017-10-13 2019-03-05 Amazon Technologies, Inc. Event handler nodes for visual scripting
CN111460020B (en) * 2020-04-02 2023-09-08 抖音视界有限公司 Method, device, electronic equipment and medium for resolving message
CN113765857B (en) * 2020-06-04 2022-10-25 华为技术有限公司 Message forwarding method, device, equipment and storage medium
CN111858093B (en) * 2020-07-10 2021-03-26 北京和德宇航技术有限公司 Message processing method, device, equipment and storage medium
CN113162977B (en) * 2021-03-16 2022-10-18 Oppo广东移动通信有限公司 Information processing method and device, equipment and storage medium
CN114153635A (en) * 2021-12-08 2022-03-08 上海品顺信息科技有限公司 Message processing method, device, storage medium and computer equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309002A (en) * 2019-05-29 2019-10-08 北京达佳互联信息技术有限公司 Message treatment method, device, electronic equipment and storage medium
CN111596905A (en) * 2020-05-09 2020-08-28 远光软件股份有限公司 Method, device, storage medium and terminal for generating java object

Also Published As

Publication number Publication date
CN114816371A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN113806434B (en) Big data processing method, device, equipment and medium
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
CN111949708A (en) Multi-task prediction method, device, equipment and medium based on time sequence feature extraction
CN113961584A (en) Method and device for analyzing field blood relationship, electronic equipment and storage medium
CN115048111B (en) Code generation method, device, equipment and medium based on metadata
CN115081538A (en) Customer relationship identification method, device, equipment and medium based on machine learning
CN114816371B (en) Message processing method, device, equipment and medium
CN115129753A (en) Data blood relationship analysis method and device, electronic equipment and storage medium
CN111985194A (en) Data storage method and device, electronic equipment and storage medium
CN114185776A (en) Big data point burying method, device, equipment and medium for application program
CN115314570A (en) Data issuing method, device, equipment and medium based on protocol development framework
CN114818656B (en) Binary file analysis method, device, equipment and medium based on gray scale upgrading
CN114860349B (en) Data loading method, device, equipment and medium
CN114860314B (en) Deployment upgrading method, device, equipment and medium based on database compatibility
CN111950707B (en) Behavior prediction method, device, equipment and medium based on behavior co-occurrence network
CN115543214B (en) Data storage method, device, equipment and medium in low-delay scene
CN115934576B (en) Test case generation method, device, equipment and medium in transaction scene
CN114911464A (en) Code generation method, device and equipment based on domain drive and storage medium
CN111950707A (en) Behavior prediction method, apparatus, device and medium based on behavior co-occurrence network
CN114139199A (en) Data desensitization method, apparatus, device and medium
CN113868285A (en) Data reading method and device, electronic equipment and storage medium
CN115510093A (en) Data query method, device and equipment for crossing heterogeneous data sources and storage medium
CN114237571A (en) Code data conversion method, device, equipment and medium
CN115328583A (en) Log printing method, device, equipment and medium based on preset C + + log library
CN114968415A (en) Configuration file modification method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant