CN115052054A - Communication message configuration method, device, readable storage medium and equipment - Google Patents

Communication message configuration method, device, readable storage medium and equipment Download PDF

Info

Publication number
CN115052054A
CN115052054A CN202210971336.7A CN202210971336A CN115052054A CN 115052054 A CN115052054 A CN 115052054A CN 202210971336 A CN202210971336 A CN 202210971336A CN 115052054 A CN115052054 A CN 115052054A
Authority
CN
China
Prior art keywords
message
data
linked list
communication
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210971336.7A
Other languages
Chinese (zh)
Other versions
CN115052054B (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.)
Jiangxi Lianchuang Precision Electromechanics Co ltd
Original Assignee
Jiangxi Lianchuang Precision Electromechanics 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 Jiangxi Lianchuang Precision Electromechanics Co ltd filed Critical Jiangxi Lianchuang Precision Electromechanics Co ltd
Priority to CN202210971336.7A priority Critical patent/CN115052054B/en
Publication of CN115052054A publication Critical patent/CN115052054A/en
Application granted granted Critical
Publication of CN115052054B publication Critical patent/CN115052054B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The invention discloses a communication message configuration method, a device, a readable storage medium and equipment, which are applied to an application layer, wherein the application layer is respectively in communication connection with a data communication layer and a service processing layer, and the method comprises the following steps: acquiring a communication message editing instruction issued by a user, and determining a corresponding message code according to the communication message editing instruction to determine a corresponding message field linked list; calling a service processing layer to create a corresponding editing interface according to the message field linked list, and collecting message data edited by a user based on the editing interface to obtain a target message field linked list; sending the target message field linked list to a data communication layer, and calling the data communication layer to splice the message data in the target message field linked list into a character stream; and setting the character stream as a message text part, correspondingly adding a message head part, a verification mode and a message tail part to obtain a message data packet, and sending the message data packet to a target node. The invention solves the problem of low efficiency in the prior art under the condition of more message data.

Description

Communication message configuration method, device, readable storage medium and equipment
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a readable storage medium, and a device for configuring a communication packet.
Background
In a typical application of communication message data generation, a developer needs to create/modify an interface UI file corresponding to communication message data to complete data addition and modification of communication message data attributes (data name, field number, field 1 name, interface control corresponding to field 1, field 1 input limit, field 1 data processing logic … field N name, interface control corresponding to field N, field N input limit, field N data processing logic); meanwhile, a communication message data service processing class corresponding to communication message data needs to be created/modified to complete the packaging and unpacking of communication message data attribute information (field 1 data type, field 1 data length, data 1 data processing logic, … field N data type, field N data length, and data N data processing logic). When each communication message is packaged, the data of the field 1, the field 2 and the field … are spliced into a character stream according to the communication protocol constraint in sequence.
However, although the conventional method can correctly complete the generation of the communication packet data, each communication packet needs a corresponding interface UI file and service processing class, and when different communication packets are faced, the corresponding interface UI files and service processing classes need to be modified, which causes problems of more repetitive work and low efficiency along with the increase of the number of packet data.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, a readable storage medium, and a device for configuring a communication packet, and aims to solve the problem of low efficiency in the case of a large number of packet data in the prior art.
The embodiment of the invention is realized as follows:
a communication message configuration method is applied to an application layer, wherein the application layer is respectively in communication connection with a data communication layer and a service processing layer, and the method comprises the following steps:
acquiring a communication message editing instruction issued by a user, determining a corresponding message code according to the communication message editing instruction, and determining a corresponding message field linked list according to the message code;
calling the service processing layer to create a corresponding editing interface according to the message field linked list, and collecting message data edited by a user based on the editing interface to obtain a target message field linked list carrying the message data;
sending the target message field linked list to the data communication layer, and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
and setting the character stream as a message text part, correspondingly adding a message head part, a verification mode and a message tail part to obtain a message data packet, and sending the message data packet to a target node.
Further, the method for configuring a communication packet, wherein the step of invoking the service processing layer to create a corresponding editing interface according to the packet field linked list, and acquiring packet data edited by a user based on the editing interface to obtain a target packet field linked list carrying the packet data further includes:
judging whether the message data is legal or not;
if yes, executing the step of sending the target message field linked list to the data communication layer, and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
if not, sending out prompt information, wherein the prompt information is used for prompting the user that the message data is illegal.
Further, the method for configuring a communication packet further includes:
after receiving message data packets sent by other nodes, calling the data communication layer to unpack the message data packets so as to obtain message codes, message text contents and text content lengths;
and determining a corresponding message field linked list according to the message codes so as to analyze and display the text content of the message.
Further, the method for configuring a communication packet, wherein the step of obtaining a communication packet editing instruction issued by a user, determining a corresponding packet code according to the communication packet editing instruction, and determining a corresponding packet field linked list according to the packet code further includes:
adding the mapping relation of different types of fields and corresponding service classes into a context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types so as to form message field linked lists by the service classes of different field types;
and establishing a mapping relation between the message code of the communication message and the message field linked list through a preset configuration file.
Further, the above communication packet configuration method, wherein the step of obtaining a communication packet editing instruction issued by a user, determining a corresponding packet code according to the communication packet editing instruction, and determining a corresponding packet field linked list according to the packet code includes:
when a communication message editing instruction issued by a user is detected, a corresponding message code is determined according to the communication message editing instruction, and a preset configuration file is loaded by a preset tool to obtain a message field linked list corresponding to the message code.
Further, the method for configuring a communication packet, wherein the step of sending the target packet field linked list to the data communication layer and calling the data communication layer to splice the packet data in the target packet field linked list into a character stream according to a preset field sequence further includes:
acquiring a message communication mode of the data communication layer, and establishing a corresponding message data communication realization class according to the message communication mode;
and calling the message data communication implementation class to send the target message field linked list to the data communication layer.
Further, the method for configuring a communication packet, where the step of adding the mapping relationship between the fields of different types and the corresponding service classes to the context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types to form the service classes of different field types into a packet field linked list, further includes:
obtaining different types of fields contained in a communication message, respectively setting attribute information of the different types of fields, and determining the service classes of the different types of fields according to the attribute information.
Another object of the present invention is to provide a communication packet configuration apparatus, applied to an application layer, where the application layer is communicatively connected to a data communication layer and a service processing layer, respectively, and the apparatus includes:
the acquisition module is used for acquiring a communication message editing instruction issued by a user, determining a corresponding message code according to the communication message editing instruction, and determining a corresponding message field linked list according to the message code;
the acquisition module is used for calling the service processing layer to create a corresponding editing interface according to the message field linked list and acquiring message data edited by a user based on the editing interface to obtain a target message field linked list carrying the message data;
the splicing module is used for sending the target message field linked list to the data communication layer and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
and the sending module is used for setting the character stream as a message text part, correspondingly adding a message head part, a verification mode and a message tail part to obtain a message data packet, and sending the message data packet to a target node.
It is a further object of the invention to provide a readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of the method of any of the above.
It is a further object of the invention to provide an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the program.
The invention can determine the corresponding message code to determine the corresponding message field linked list by the communication message editing instruction sent by the user, the message field linked list contains the service class for processing all field types in the current communication message, and creates a corresponding editing interface according to the message field linked list for the user to edit different types of fields, when facing message data composed of different field types, it is not necessary to modify the corresponding interface UI file and service processing class, and after the user finishes editing the message data, the message data are spliced into character streams according to the sequence of preset fields through a data communication layer, are sent out after being packaged, and carry out corresponding unpacking operation when message data packets sent by other nodes are received, the method and the device complete the configuration process of the whole message data, and solve the problem of low efficiency in the prior art under the condition of large number of message data.
Drawings
Fig. 1 is a schematic structural diagram of a communication packet configuration system according to an embodiment of the present invention;
fig. 2 is a flowchart of a communication packet configuration method according to a first embodiment of the present invention;
fig. 3 is a block diagram of a communication packet configuration apparatus according to a fourth embodiment of the present invention.
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The following embodiments can be applied to the communication packet configuration system shown in fig. 1, where the structure shown in fig. 1 is the communication packet configuration system provided in an embodiment of the present invention, and includes an application layer, and a data communication layer and a service processing layer that are respectively in communication connection with the application layer, where:
the application layer is used for receiving an editing instruction of a user and displaying a corresponding editing interface, and sending collected user editing information to the data communication layer for processing, the data communication layer is used for receiving data sent by the application layer and sending the data to a corresponding node, wherein the data comprises but is not limited to message data and a message field linked list, and the service processing layer is used for creating a corresponding service class, creating the editing interface and displaying the editing interface through the application layer.
It should be noted that the configuration shown in fig. 1 is not intended to limit the communication message configuration system, which in other embodiments may include fewer or more components than shown, or some components may be combined, or a different arrangement of components.
The following describes how to improve the efficiency of communication message configuration in detail with reference to specific embodiments and accompanying drawings.
Example one
Referring to fig. 2, a communication packet configuration method in a first embodiment of the present invention is shown, and is applied to an application layer, where the application layer is in communication connection with a data communication layer and a service processing layer, respectively, and the method includes steps S10 to S13.
Step S10, a communication message editing instruction issued by a user is obtained, a corresponding message code is determined according to the communication message editing instruction, and a corresponding message field linked list is determined according to the message code.
Specifically, in this embodiment, the communication message editing instruction may be issued by clicking a communication message data menu, and when the user clicks the communication message data menu, the corresponding communication message editing instruction is issued to start the current communication message editing function.
Step S11, the service processing layer is invoked to create a corresponding editing interface according to the message field linked list, and collects the message data edited by the user based on the editing interface to obtain a target message field linked list carrying the message data.
The method includes the steps that a field type of a current communication message can be determined according to a message field linked list, in order to modify data of different field types in the communication message conveniently, a corresponding editing interface is created according to the message field linked list, specifically, different editing areas are included in the editing interface, the different editing areas provide input for the field data of different types, a user can input data input of the corresponding field type in the corresponding editing area, and finally a target message field linked list carrying the message data input by the user is obtained.
In addition, in some optional embodiments of the present invention, in order to further improve the security of the communication packet and the accuracy of configuration, the step of invoking the service processing layer to create a corresponding editing interface according to the packet field linked list, and acquiring packet data edited by a user based on the editing interface to obtain a target packet field linked list carrying the packet data further includes:
judging whether the message data is legal or not;
if yes, executing the step of sending the target message field linked list to the data communication layer, and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
if not, sending out prompt information, wherein the prompt information is used for prompting the user that the message data is illegal.
Specifically, when the data input by the user is illegal, a prompt message is sent to prompt the user that the message data is illegal, wherein the data is illegal, including but not limited to that the input data field is not in accordance with the field type specified in the editing interface or the data per se is not in accordance with the specification.
Step S12, sending the target packet field linked list to the data communication layer, and calling the data communication layer to splice the packet data in the target packet field linked list into a character stream according to a preset field sequence.
Specifically, a target message field linked list carrying message data is sent to a data communication layer, so as to extract the message data in the target message field linked list, and the message data in the target message field linked list is spliced into a character stream according to a preset field sequence, wherein the preset field sequence can refer to an arrangement sequence of fields in the message field linked list, and in specific implementation, a tool (for example, AbsndBwProtocal realizes a class call ICommDataField interface seriaFieldData function) of the data communication layer is called to splice the message data edited by a user into the character stream according to the field sequence.
In addition, in some optional embodiments of the present invention, the sending the target packet field linked list to the data communication layer, and calling the data communication layer to splice the packet data in the target packet field linked list into a character stream according to a preset field sequence includes:
acquiring a message communication mode of the data communication layer, and establishing a corresponding message data communication realization class according to the message communication mode;
and calling the message data communication implementation class to send the target message field linked list to the data communication layer.
Specifically, the corresponding message data communication implementation classes are respectively determined according to message communication modes, wherein the message communication modes include but are not limited to a serial port, a network port and a CAN port, so that data transmission between different message header protocols and data communication modes CAN be respectively realized.
Step S13, setting the character stream as a text part of the message, correspondingly adding a message header, a verification method, and a message tail to obtain a message data packet, and sending the message data packet to a target node.
Specifically, the character stream includes all data information of the previous message data, a message header, a verification mode and a message tail are correspondingly added to obtain a message data packet, and the message data packet is sent to a target node. Wherein the target node includes, but is not limited to, other software or other modules in software in an application.
In summary, the method for configuring communication message in the above embodiment of the present invention can determine the corresponding message code according to the communication message editing instruction issued by the user to determine the corresponding message field linked list, where the message field linked list contains the service class for processing all field types in the current communication message, and creates a corresponding editing interface according to the message field linked list for the user to edit different types of fields, when facing message data composed of different field types, it is not necessary to modify the corresponding interface UI file and service processing class, and after the user finishes editing the message data, the message data are spliced into character streams according to the sequence of preset fields through a data communication layer, and are sent out after being packaged, the method and the device complete the configuration process of the whole message data, and solve the problem of low efficiency in the prior art under the condition of large number of message data.
Example two
The difference between the communication packet configuration method in this embodiment and the communication packet configuration method in the first embodiment is that:
the method further comprises the following steps:
after receiving message data packets sent by other nodes, calling the data communication layer to unpack the message data packets so as to obtain message codes, message text contents and text content lengths;
and determining a corresponding message field linked list according to the message codes so as to analyze and display the text content of the message.
Specifically, a tool (an analysis data function of an ICorganization interface implementation class) corresponding to the data communication layer is called to unpack the message data packet so as to obtain the data message coding, the message text content and the text content length. The implementation class of the back ICommication interface acquires the corresponding message field linked list from the service processing layer according to the message coding, and then calls a corresponding tool (deserialFieldData of the ICommDataField interface) to analyze and display the text content of the received message.
In summary, in the method for configuring communication packets in the above embodiments of the present invention, a corresponding packet code can be determined according to a communication packet editing instruction issued by a user to determine a corresponding packet field linked list, where the packet field linked list includes a service class for processing all field types in the current communication packet, and a corresponding editing interface is created according to the packet field linked list for the user to edit different types of fields, when the user faces packet data composed of different field types, the user does not need to modify corresponding interface UI files and service processing classes, and after the user finishes editing the packet data, the packet data is spliced into a character stream according to a preset field sequence through a data communication layer, and is sent out after being packaged, and when receiving packet data packets sent by other nodes, a corresponding unpacking operation is performed to complete a configuration flow of the entire packet data, the problem of inefficiency in the prior art under the condition of more message data number is solved.
EXAMPLE III
The difference between the communication packet configuration method in this embodiment and the communication packet configuration method in the first embodiment is that:
step S10 is preceded by:
adding the mapping relation of different types of fields and corresponding service classes into a context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types so as to form message field linked lists by the service classes of different field types;
and establishing a mapping relation between the message code of the communication message and the message field linked list through a preset configuration file.
Wherein, the service attributes include but are not limited to interface control (i.e. creating an editing interface), data serialization processing (data packaging), data deserialization processing (data unpacking), and data validity check, etc., in specific implementation, the service attributes can be encapsulated into a single independent service class by using C + + language, the service classes corresponding to different types of fields are encapsulated into independent modules, a uniform field operation access interface is provided for other modules, the mapping relationship between the different types of fields and the corresponding service classes is added into the context management class by a reflection mechanism, so that when the message field linked list is required to be composed, the corresponding service classes are created by the context management class according to the field types to form the message field linked list by the service classes of different field types, and the mapping relationship between the message coding of the communication message and the message field linked list is established by presetting a configuration file, so that when one of the message encoding and the linked list of message fields is determined, the other can be determined.
Specifically, when a communication message editing instruction issued by a user is detected, a corresponding message code is determined according to the communication message editing instruction, and a preset tool loads the preset configuration file to obtain a message field linked list corresponding to the message code.
In this embodiment, a preset tool (e.g., a CCommBwTool class) loads a configuration file to obtain a mapping relationship between a message code and a message field linked list composed of service classes of different types of fields, and a corresponding service class can be created according to a field type through a context management class to compose the service classes of the different types of fields into the message field linked list.
Therefore, when the communication message data processing type needs to be newly increased and modified, developers only need to edit the configuration file and add/modify the business processing type of the corresponding field to complete the newly increased and modified communication message data, so that the maintainability and the expansibility are greatly improved, and the error probability is reduced.
Further, the step of adding the mapping relationship between the fields of different types and the corresponding service classes to the context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types to combine the service classes of different field types into a message field linked list further includes:
obtaining different types of fields contained in a communication message, respectively setting attribute information of the different types of fields, and determining the service classes of the different types of fields according to the attribute information.
Specifically, when a field service class object is created, a calling tool (setFieldProp function) sets field attribute information (including a field name, a data type, an input limit, a data length and the like), and a previous field service processing class tool (setNextField function) is called to set a current field as a subsequent field of the previous field (if the current field is a first field, the calling is not needed), an interface control is sequentially created, validity of user input data is checked, data serialization (packaging) and deserialization (unpacking) are performed, after the relevant logic processing of the current field is completed, the calling tool (getNextField) is continuously called to obtain a next field for processing, so as to determine a service class of a communication message, and then a message field linked list composed of different types of fields contained in the communication message is obtained according to the service class until the composition of the linked list is completed.
In summary, the method for configuring communication message in the above embodiment of the present invention can determine the corresponding message code according to the communication message editing instruction issued by the user to determine the corresponding message field linked list, where the message field linked list contains the service class for processing all field types in the current communication message, and creates a corresponding editing interface according to the message field linked list for the user to edit different types of fields, when facing message data composed of different field types, it is not necessary to modify the corresponding interface UI file and service processing class, and after the user finishes editing the message data, the message data are spliced into character streams according to the sequence of preset fields through a data communication layer, and are sent out after being packaged, the configuration process of the whole message data is completed, and the problem of low efficiency under the condition of large number of message data in the prior art is solved.
Example four
Referring to fig. 3, a communication packet configuration apparatus proposed in a fourth embodiment of the present invention is shown, and is applied to an application layer, where the application layer is in communication connection with a data communication layer and a service processing layer, respectively, and the apparatus includes:
an obtaining module 100, configured to obtain a communication packet editing instruction issued by a user, determine a corresponding packet code according to the communication packet editing instruction, and determine a corresponding packet field linked list according to the packet code;
the acquisition module 200 is configured to invoke the service processing layer to create a corresponding editing interface according to the message field linked list, and acquire message data edited by a user based on the editing interface to obtain a target message field linked list carrying the message data;
the splicing module 300 is configured to send the target packet field linked list to the data communication layer, and call the data communication layer to splice the packet data in the target packet field linked list into a character stream according to a preset field sequence;
a sending module 400, configured to set the character stream as a text part of a message, correspondingly add a message header, a verification mode, and a message tail to obtain a message data packet, and send the message data packet to a target node.
Further, in some optional embodiments of the present invention, wherein the apparatus further comprises:
the judging module is used for judging whether the message data is legal or not;
the execution module is used for sending the target message field linked list to the data communication layer and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence when judging that the message data are legal;
and the prompting module is used for sending out prompting information when the message data is judged to be illegal, and the prompting information is used for prompting a user that the message data is illegal.
Further, in some optional embodiments of the present invention, wherein the apparatus further comprises:
the receiving module is used for calling the data communication layer to unpack the message data packet after receiving the message data packet sent by other nodes so as to acquire the message code, the message text content and the text content length;
and the display module is used for determining a corresponding message field linked list according to the message codes so as to analyze and display the content of the message text.
Further, in some optional embodiments of the present invention, wherein the apparatus further comprises:
the composition module is used for adding the mapping relation of different types of fields and corresponding service classes into a context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types so as to compose the service classes of different field types into a message field linked list;
and the establishing module is used for establishing a mapping relation between the message code of the communication message and the message field linked list through a preset configuration file.
Further, in some optional embodiments of the present invention, wherein the apparatus further comprises:
and the loading module is used for determining a corresponding message code according to the communication message editing instruction when the communication message editing instruction issued by the user is detected, and loading the preset configuration file by a preset tool to acquire a message field linked list corresponding to the message code.
Further, in some optional embodiments of the present invention, wherein the apparatus further comprises:
the creating module is used for acquiring a message communication mode of the data communication layer and creating a corresponding message data communication implementation class according to the message communication mode;
and the linked list sending module is used for calling the message data communication implementation class to send the target message field linked list to the data communication layer.
Further, in some optional embodiments of the present invention, wherein the apparatus further comprises:
and the attribute acquisition module is used for acquiring different types of fields contained in the communication message, respectively setting attribute information of the fields of different types, and determining the service classes of the fields of different types according to the attribute information.
The functions or operation steps of the above modules when executed are substantially the same as those of the above method embodiments, and are not described herein again.
EXAMPLE five
In another aspect, the present invention further provides a readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method according to any one of the first to third embodiments.
EXAMPLE six
Another aspect of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of the method according to any one of the first to third embodiments.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable storage medium may even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A communication message configuration method is applied to an application layer, wherein the application layer is respectively in communication connection with a data communication layer and a service processing layer, and the method comprises the following steps:
acquiring a communication message editing instruction issued by a user, determining a corresponding message code according to the communication message editing instruction, and determining a corresponding message field linked list according to the message code;
calling the service processing layer to create a corresponding editing interface according to the message field linked list, and collecting message data edited by a user based on the editing interface to obtain a target message field linked list carrying the message data;
sending the target message field linked list to the data communication layer, and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
and setting the character stream as a message text part, correspondingly adding a message head part, a verification mode and a message tail part to obtain a message data packet, and sending the message data packet to a target node.
2. The method according to claim 1, wherein the step of invoking the service processing layer to create a corresponding editing interface according to the packet field linked list, and acquiring packet data edited by a user based on the editing interface to obtain a target packet field linked list carrying the packet data further comprises:
judging whether the message data is legal or not;
if yes, executing the step of sending the target message field linked list to the data communication layer, and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
if not, sending out prompt information, wherein the prompt information is used for prompting the user that the message data is illegal.
3. The method of claim 1, further comprising:
after receiving message data packets sent by other nodes, calling the data communication layer to unpack the message data packets so as to obtain message codes, message text contents and text content lengths;
and determining a corresponding message field linked list according to the message codes so as to analyze and display the text content of the message.
4. The method according to claim 1, wherein the step of obtaining the communication packet editing instruction issued by the user, determining the corresponding packet code according to the communication packet editing instruction, and determining the corresponding packet field linked list according to the packet code further comprises:
adding the mapping relation of different types of fields and corresponding service classes into a context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types so as to combine the service classes of different field types into a message field linked list;
and establishing a mapping relation between the message code of the communication message and the message field linked list through a preset configuration file.
5. The method according to claim 4, wherein the steps of obtaining a communication message editing instruction issued by a user, determining a corresponding message code according to the communication message editing instruction, and determining a corresponding message field linked list according to the message code include:
when a communication message editing instruction issued by a user is detected, a corresponding message code is determined according to the communication message editing instruction, and a preset configuration file is loaded by a preset tool to obtain a message field linked list corresponding to the message code.
6. The method according to claim 1, wherein the step of sending the target packet field linked list to the data communication layer and invoking the data communication layer to splice the packet data in the target packet field linked list into a character stream according to a preset field sequence further comprises:
acquiring a message communication mode of the data communication layer, and establishing a corresponding message data communication realization class according to the message communication mode;
and calling the message data communication implementation class to send the target message field linked list to the data communication layer.
7. The method according to claim 4, wherein the step of adding the mapping relationship between the fields of different types and the corresponding service classes to the context management class through a reflection mechanism, and creating the corresponding service classes through the context management class according to the field types to combine the service classes of different field types into the packet field linked list further comprises:
obtaining different types of fields contained in a communication message, respectively setting attribute information of the different types of fields, and determining the service classes of the different types of fields according to the attribute information.
8. A communication packet configuration apparatus, applied to an application layer, where the application layer is in communication connection with a data communication layer and a service processing layer, respectively, the apparatus comprising:
the acquisition module is used for acquiring a communication message editing instruction issued by a user, determining a corresponding message code according to the communication message editing instruction, and determining a corresponding message field linked list according to the message code;
the acquisition module is used for calling the service processing layer to create a corresponding editing interface according to the message field linked list and acquiring message data edited by a user based on the editing interface to obtain a target message field linked list carrying the message data;
the splicing module is used for sending the target message field linked list to the data communication layer and calling the data communication layer to splice the message data in the target message field linked list into a character stream according to a preset field sequence;
and the sending module is used for setting the character stream as a message text part, correspondingly adding a message head part, a verification mode and a message tail part to obtain a message data packet, and sending the message data packet to a target node.
9. A readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 7 when executing the program.
CN202210971336.7A 2022-08-15 2022-08-15 Communication message configuration method, device, readable storage medium and equipment Active CN115052054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210971336.7A CN115052054B (en) 2022-08-15 2022-08-15 Communication message configuration method, device, readable storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210971336.7A CN115052054B (en) 2022-08-15 2022-08-15 Communication message configuration method, device, readable storage medium and equipment

Publications (2)

Publication Number Publication Date
CN115052054A true CN115052054A (en) 2022-09-13
CN115052054B CN115052054B (en) 2022-10-25

Family

ID=83167350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210971336.7A Active CN115052054B (en) 2022-08-15 2022-08-15 Communication message configuration method, device, readable storage medium and equipment

Country Status (1)

Country Link
CN (1) CN115052054B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117527731A (en) * 2024-01-08 2024-02-06 珠海星云智联科技有限公司 Packet editing method, computer equipment and medium for hardware unloading

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289774A (en) * 2011-09-13 2011-12-21 上海普元信息技术股份有限公司 Graphical message processing and test system and method in financial transaction processing system
CN103780481A (en) * 2012-10-18 2014-05-07 中兴通讯股份有限公司 Method and apparatus for modifying and forwarding message in data communication network
CN110209377A (en) * 2019-04-26 2019-09-06 平安科技(深圳)有限公司 Interface packet processing method, device, equipment and storage medium based on factory class
CN111818098A (en) * 2020-09-01 2020-10-23 广东省新一代通信与网络创新研究院 Message editing method and device and computer readable storage medium
CN112052370A (en) * 2020-09-02 2020-12-08 平安科技(深圳)有限公司 Message generation method and device, electronic equipment and computer readable storage medium
CN112104634A (en) * 2020-09-08 2020-12-18 中国电力科学研究院有限公司 Data message processing method, system, equipment and readable storage medium
CN113595931A (en) * 2021-07-08 2021-11-02 杭州海康威视数字技术股份有限公司 Message processing method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289774A (en) * 2011-09-13 2011-12-21 上海普元信息技术股份有限公司 Graphical message processing and test system and method in financial transaction processing system
CN103780481A (en) * 2012-10-18 2014-05-07 中兴通讯股份有限公司 Method and apparatus for modifying and forwarding message in data communication network
CN110209377A (en) * 2019-04-26 2019-09-06 平安科技(深圳)有限公司 Interface packet processing method, device, equipment and storage medium based on factory class
CN111818098A (en) * 2020-09-01 2020-10-23 广东省新一代通信与网络创新研究院 Message editing method and device and computer readable storage medium
CN112052370A (en) * 2020-09-02 2020-12-08 平安科技(深圳)有限公司 Message generation method and device, electronic equipment and computer readable storage medium
WO2021189826A1 (en) * 2020-09-02 2021-09-30 平安科技(深圳)有限公司 Message generation method and apparatus, electronic device, and computer-readable storage medium
CN112104634A (en) * 2020-09-08 2020-12-18 中国电力科学研究院有限公司 Data message processing method, system, equipment and readable storage medium
CN113595931A (en) * 2021-07-08 2021-11-02 杭州海康威视数字技术股份有限公司 Message processing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117527731A (en) * 2024-01-08 2024-02-06 珠海星云智联科技有限公司 Packet editing method, computer equipment and medium for hardware unloading
CN117527731B (en) * 2024-01-08 2024-04-09 珠海星云智联科技有限公司 Packet editing method, computer equipment and medium for hardware unloading

Also Published As

Publication number Publication date
CN115052054B (en) 2022-10-25

Similar Documents

Publication Publication Date Title
US6564265B2 (en) Apparatus for encoding and decoding data according to a protocol specification
US8381201B2 (en) Processing of expressions
CN110032511A (en) A kind of interface test method and interface testing equipment
CN111104106A (en) Visual development method, system and medium for integrating business process and communication message
CN111190596A (en) Joint debugging method and device, computer equipment and readable storage medium
CN110532182B (en) Automatic testing method and device for virtualization platform
CN115052054B (en) Communication message configuration method, device, readable storage medium and equipment
CN113238740A (en) Code generation method, code generation device, storage medium, and electronic apparatus
CN111338716A (en) Data processing method and device based on rule engine and terminal equipment
CN115599347A (en) Automatic code development implementation method and system
CN106897060A (en) Based on patterned data processing method and device
CN112860308A (en) Configuration method of interface definition, service processing method, server and storage medium
CN107291619A (en) EMS memory occupation analysis method and device
CN114629830B (en) Method and system for automatically controlling test center instrument test
CN110880099B (en) Workflow engine-based task event processing method, device, equipment and medium
CN113312031A (en) Naming service interface of software communication system structure
CN111401020A (en) Interface loading method and system and computing equipment
CN110297651A (en) The update method and device of the common variable of protocol interface
CN117435177B (en) Application program interface construction method, system, equipment and storage medium
CN110232027B (en) Method and system for performing system test based on editable data
Lima et al. Test execution of telecommunications services using CORBA
CN115185856A (en) Configuration method and device of test interface, storage medium and computer equipment
CN114327428A (en) Application program interface editing method and device, electronic equipment and medium
Linder et al. JavaCADD: A Java-based Server and GUI for Providing Distributed ECAD Services
CN116820931A (en) Data verification method, system, equipment and medium for NuTest

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