CN116436991A - Data message sending method and device, storage medium and electronic equipment - Google Patents

Data message sending method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116436991A
CN116436991A CN202310362158.2A CN202310362158A CN116436991A CN 116436991 A CN116436991 A CN 116436991A CN 202310362158 A CN202310362158 A CN 202310362158A CN 116436991 A CN116436991 A CN 116436991A
Authority
CN
China
Prior art keywords
data message
service component
target service
data
identification information
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.)
Pending
Application number
CN202310362158.2A
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310362158.2A priority Critical patent/CN116436991A/en
Publication of CN116436991A publication Critical patent/CN116436991A/en
Pending legal-status Critical Current

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a data message sending method and device, a storage medium and electronic equipment, and relates to the technical field of smart families, wherein the data message sending method comprises the following steps: parameter detection is carried out on the first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message and the connection is used for realizing data transmission among service components; determining a target service component subscribed to the first data message according to the first identification information; acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode; the first data message after analysis is sent to the target service component, and the technical scheme is adopted, so that the problem that the data sending is unsuccessful when the service component cannot process the data under the condition that the connection component is coupled with the service component is solved, and the reliability of the system is reduced.

Description

Data message sending method and device, storage medium and electronic equipment
Technical Field
The application relates to the technical field of smart families, in particular to a data message sending method and device, a storage medium and electronic equipment.
Background
In the related art, the two service components complete data interaction through the connection component, that is, in the prior art, the connection component generally directly transmits the received data to the service component, when the connection component is coupled with the service component, the service component cannot process the data, so that the data transmission is unsuccessful, and the reliability of the system is reduced.
Aiming at the problems that in the related art, under the condition that a connecting component is coupled with a service component, when the service component cannot process data, data transmission is unsuccessful, and further the reliability of a system is reduced, and the like, an effective solution is not proposed.
Disclosure of Invention
The embodiment of the application provides a data message sending method and device, a storage medium and electronic equipment, which at least solve the problems that in the related art, when a service component cannot process data under the condition that a connection component is coupled with the service component, the data sending is unsuccessful, and the reliability of a system is reduced and the like.
According to one embodiment of the present application, there is provided a method for transmitting a data packet, including: performing parameter detection on a first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission between service components; determining a target service component subscribed to the first data message according to the first identification information; acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode; and sending the analyzed first data message to the target service component.
In an exemplary embodiment, obtaining a first parsing manner corresponding to the target service component includes: acquiring second identification information of the target service component, wherein the second identification information uniquely identifies the target service component; determining a connection table corresponding to the second identification information, wherein the connection table is used for indicating the corresponding relation between the second identification information and the first analysis mode; and determining a first analysis mode corresponding to the target service component according to the connection table.
In an exemplary embodiment, determining, according to the connection table, a first parsing manner corresponding to the target service component includes at least one of: determining a decryption mode of the first data message according to the connection table; determining an analytic protocol head function of the first data message according to the connection table; and determining an analytic data function of the first data message according to the connection table.
In an exemplary embodiment, after determining, according to the connection table, a first parsing manner corresponding to the target service component, the method further includes: under the condition that the decryption mode of the first data message is determined according to the connection table, decrypting the first data message according to the decryption mode; under the condition that an analytic protocol head function of the first data message is determined according to the connection table, mobilizing the analytic protocol head function to acquire protocol head information of the first data message; and under the condition that the analytic data function of the first data message is determined according to the connection table, calling the analytic data function to unpack the first data message.
In an exemplary embodiment, decrypting the first data packet according to the decryption method includes: invoking a decryption function and a decryption pointer corresponding to the decryption mode in a security component, wherein the security component and the target service component are positioned in the same system; decrypting the first data message through the decryption function and the decryption finger.
In an exemplary embodiment, obtaining a first parsing manner corresponding to the target service component, and parsing the first data packet according to the first parsing manner includes: determining a protocol for encapsulating the first data message; in the case where the number of protocols is plural, performing the parsing step: determining an outermost protocol for encapsulating the first data message; determining a second analysis mode of the data message corresponding to the outermost layer protocol, and analyzing the data message corresponding to the outermost layer protocol according to the second analysis mode, wherein the first analysis mode comprises: the second analysis mode; and circularly executing the analyzing step until the data message corresponding to the innermost protocol is analyzed according to the innermost protocol for packaging the first data message.
In an exemplary embodiment, before determining, according to the first identification information, a target service component subscribed to the first data packet, the method further includes: receiving a registration request of the target service component, wherein the registration request is used for indicating the target service component to subscribe to a data message transmitted through the connection; and storing the corresponding relation between the first identification information of the connection and the second identification information of the target service component in a command distribution table according to the registration request.
According to another embodiment of the present application, there is further provided a device for sending a data packet, including: the device comprises an acquisition module, a service component and a service component, wherein the acquisition module is used for carrying out parameter detection on a first data message to acquire first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among the service components; the determining module is used for determining a target service component subscribed to the first data message according to the first identification information; the analysis module is used for acquiring a first analysis mode corresponding to the target service component and analyzing the first data message according to the first analysis mode; and the sending module is used for sending the analyzed first data message to the target service component.
According to still another aspect of the embodiments of the present application, there is further provided a computer readable storage medium having a computer program stored therein, where the computer program is configured to execute the above-mentioned data packet transmission method when executed.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the method for sending a data packet according to the computer program.
In the embodiment of the application, parameter detection is performed on a first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission between service components; determining a target service component subscribed to the first data message according to the first identification information; acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode; the analyzed first data message is sent to the target service component; by adopting the technical scheme, the problems that when the service component cannot process data under the condition that the connection component is coupled with the service component, data transmission is unsuccessful, and further the reliability of a system is reduced are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic diagram of a hardware environment of a method for sending a data packet according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of sending a data message according to an embodiment of the present application;
FIG. 3 is a flow chart of a method of sending a data message according to an alternative embodiment of the present application;
fig. 4 is a schematic diagram of a method for sending a data packet according to an alternative embodiment of the present application;
fig. 5 is a block diagram of a data packet transmitting apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a method for sending a data packet is provided. The data message sending method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described data packet transmission method may be applied to a hardware environment formed by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a method for sending a data packet is provided and applied to the terminal device, and fig. 2 is a flowchart of a method for sending a data packet according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, performing parameter detection on a first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among service components;
step S204, determining a target service component subscribed to the first data message according to the first identification information;
step S206, a first analysis mode corresponding to the target service component is obtained, and the first data message is analyzed according to the first analysis mode;
step S208, the analyzed first data message is sent to the target service component.
Through the steps, parameter detection is carried out on the first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among service components; determining a target service component subscribed to the first data message according to the first identification information; acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode; according to the method, the system and the device, the problem that in the related art, when the service component cannot process data under the condition that the connection component is coupled with the service component, the data transmission is unsuccessful, and further the reliability of the system is reduced is solved.
Alternatively, the above step S206 may be implemented by: acquiring second identification information of the target service component, wherein the second identification information uniquely identifies the target service component; determining a connection table corresponding to the second identification information, wherein the connection table is used for indicating the corresponding relation between the second identification information and the first analysis mode; and determining a first analysis mode corresponding to the target service component according to the connection table.
It should be noted that, when the target service component needs to subscribe to a certain data, the target service component registers the second identification information of the target service component and the analysis mode for analyzing the data in the connection table in a registration mode, and when the command distribution component receives the first data message sent by the connection component, the first data message is analyzed according to the analysis mode in the connection table corresponding to the target service component.
Through the embodiment, a general command distribution mechanism is adopted to flexibly distribute commands, and when the target service component registers in service component information, the data is analyzed according to the analysis mode of user registration, and the analyzed data is sent to the corresponding service component, so that the reliability of the system is improved.
In an exemplary embodiment, determining, according to the connection table, a first parsing manner corresponding to the target service component includes at least one of: determining a decryption mode of the first data message according to the connection table; determining an analytic protocol head function of the first data message according to the connection table; and determining an analytic data function of the first data message according to the connection table.
It should be noted that, the parsing mode of the target service component registration includes at least one of the following: decryption mode, analysis protocol head function and analysis data function.
It should be noted that, in the case that the target service component does not register the parsing manner, the connection management component forwards the received first data packet to the target service component, and the connection management component does not parse the first data packet.
Through the embodiment, the target service component autonomously registers the corresponding analysis mode, and flexibly processes the first data message according to the corresponding analysis mode of the target service component registration, so that the requirements of the target service component are met to a higher degree.
In an exemplary embodiment, after determining, according to the connection table, a first parsing manner corresponding to the target service component, the method further includes: under the condition that the decryption mode of the first data message is determined according to the connection table, decrypting the first data message according to the decryption mode; under the condition that an analytic protocol head function of the first data message is determined according to the connection table, mobilizing the analytic protocol head function to acquire protocol head information of the first data message; and under the condition that the analytic data function of the first data message is determined according to the connection table, calling the analytic data function to unpack the first data message.
Specifically, the parsing method registered in the target service component includes: under the condition of the decryption mode, decrypting the first data message according to the registered decryption mode; the analysis mode registered in the target service component comprises the following steps: under the condition of analyzing the protocol head function, the command distribution component calls the analyzed protocol head function to acquire the protocol head information of the first data message, and sends the protocol head information and the information except the protocol head in the first data message to the target service component; the analysis mode registered in the target service component comprises the following steps: under the condition of analyzing the data function, the command distribution component calls the analyzed data function, and unpacks the first data message and sends the unpacked data message.
Through the embodiment, the target service component autonomously registers the corresponding analysis mode, and flexibly processes the first data message according to the corresponding analysis mode of the target service component registration, so that the requirements of the target service component are met to a higher degree.
In an exemplary embodiment, decrypting the first data packet according to the decryption method includes: invoking a decryption function and a decryption pointer corresponding to the decryption mode in a security component, wherein the security component and the target service component are positioned in the same system; decrypting the first data message through the decryption function and the decryption finger.
It should be noted that, when it is determined that the first data packet needs to be decrypted according to the connection table, a decryption function and a decryption pointer corresponding to the decryption manner are called in the security component, and the first data packet is decrypted through the decryption function and the decryption pointer.
In an exemplary embodiment, obtaining a first parsing manner corresponding to the target service component, and parsing the first data packet according to the first parsing manner includes: determining a protocol for encapsulating the first data message; in the case where the number of protocols is plural, performing the parsing step: determining an outermost protocol for encapsulating the first data message; determining a second analysis mode of the data message corresponding to the outermost layer protocol, and analyzing the data message corresponding to the outermost layer protocol according to the second analysis mode, wherein the first analysis mode comprises: the second analysis mode; and circularly executing the analyzing step until the data message corresponding to the innermost protocol is analyzed according to the innermost protocol for packaging the first data message.
It should be noted that, the number of the protocols for encapsulating the first data packet may be plural, and in the case that the number of the protocols for encapsulating the first data packet is plural, the first data packet needs to be parsed circularly until the data packet corresponding to the innermost protocol is parsed according to the parsing mode corresponding to the innermost protocol; that is, for each protocol, a corresponding parsing scheme is included.
For example, the resolution mode corresponding to the outermost protocol is: decryption mode, analysis protocol head function and analysis data function; the parsing mode corresponding to the next layer protocol of the outermost layer protocol may be: the corresponding instant system modes of the innermost layer protocol of the analytic protocol head function and the analytic data function … … can be as follows: and analyzing the protocol head function. The embodiment of the invention does not limit the analysis mode corresponding to each layer of protocol.
In an exemplary embodiment, before determining, according to the first identification information, a target service component subscribed to the first data packet, the method further includes: receiving a registration request of the target service component, wherein the registration request is used for indicating the target service component to subscribe to a data message transmitted through the connection; and storing the corresponding relation between the first identification information of the connection and the second identification information of the target service component in a command distribution table according to the registration request.
That is, when the target service component needs to subscribe to a certain data, the target service component adopts a registration mode to register the second identification information of the target service component into the command distribution table, so that the first data message can be sent to the target service component according to the information stored in the command distribution table.
In an exemplary embodiment, sending the parsed first data message to the target service component includes: determining a corresponding command distribution function in a command distribution table according to the protocol type of the first data message and the first identification information; and calling the command distribution function to send the parsed first data message to the target service component.
In order to better understand the process of the method for sending the data message, the following describes the implementation method flow of sending the data message in combination with the alternative embodiment, but is not used for limiting the technical scheme of the embodiment of the application.
In this embodiment, a method for sending a data packet is provided, and fig. 3 is a flow diagram of a system for sending a data packet according to an alternative embodiment of the present application, where as shown in fig. 3, the system for sending a data packet includes:
the system comprises a business component, a command distribution component connected with the business component, a connection component connected with the command distribution component, a connection management component connected with the connection component and a safety component of the command distribution component.
The connecting component is used for receiving and transmitting data messages;
a connection management component for managing (creating, deleting, etc.) connections;
a command distribution component for transmitting the connected data to the corresponding service component;
the business component is used for receiving the data distributed by the command distribution component, processing business logic and sending the data to the connection component;
and the safety component is used for encrypting and decrypting the data.
Fig. 4 is a flowchart of a method for sending a data packet according to an alternative embodiment of the present application, as shown in fig. 4, specifically including the following steps:
step S401: the command distribution component receives the data message sent by the connection component;
step S402: detecting parameters of the data message, and determining whether first identification information conn-id carried by the data message is obtained, wherein the first identification information is used for indicating connection for transmitting the first data message, the connection is used for realizing data transmission between service components, and executing step S403 under the condition that the conn-id is obtained, otherwise executing step S412;
step S403: determining a corresponding connection table according to the conn-id;
step S404: determining whether the data message corresponding to the Nth layer protocol needs to be decrypted according to the connection table, executing step S405 if the data message needs to be decrypted, otherwise executing step S406;
step S405: decrypting the data message corresponding to the N layer protocol;
step S406: determining whether an analytic protocol head function exists in the connection table, executing step S407 if the analytic protocol head function exists, otherwise executing step S408;
step S407: calling the analytic protocol head function to obtain the protocol head information of the data message corresponding to the Nth layer protocol;
step S408: determining whether an analytic data function exists in the connection table, executing step S409 if the analytic data function exists, otherwise executing step S410;
step S409: invoking the analytic data function to obtain the data information of the data message corresponding to the Nth layer protocol;
step S410: determining whether an N-1 layer protocol exists, executing steps S404-S409 if the N-1 layer protocol exists, otherwise executing S411;
step S411: calling the cmd of the innermost layer to inquire a command distribution table, determining a target service component according to the command distribution table, and sending the analyzed data to the target service component;
step S412: and returning a sending result.
According to the technical scheme, the problems that in the related art, when the service component cannot process data under the condition that the connection component is coupled with the service component, data transmission is unsuccessful, and further reliability of a system is reduced are solved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
Fig. 5 is a block diagram of a data packet transmitting device according to an embodiment of the present application; as shown in fig. 4, includes:
the obtaining module 52 is configured to perform parameter detection on a first data packet to obtain first identification information carried in the first data packet, where the first identification information is used to indicate a connection for transmitting the first data packet, and the connection is used to implement data transmission between service components;
a determining module 54, configured to determine, according to the first identification information, a target service component subscribed to the first data packet;
the parsing module 56 is configured to obtain a first parsing manner corresponding to the target service component, and parse the first data packet according to the first parsing manner;
and the sending module 58 is configured to send the parsed first data packet to the target service component.
Through the device, parameter detection is carried out on the first data message so as to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among service components; determining a target service component subscribed to the first data message according to the first identification information; acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode; according to the method, the system and the device, the problem that in the related art, when the service component cannot process data under the condition that the connection component is coupled with the service component, the data transmission is unsuccessful, and further the reliability of the system is reduced is solved.
In an exemplary embodiment, the parsing module 56 is configured to obtain second identification information of the target service component, where the second identification information uniquely identifies the target service component; determining a connection table corresponding to the second identification information, wherein the connection table is used for indicating the corresponding relation between the second identification information and the first analysis mode; and determining a first analysis mode corresponding to the target service component according to the connection table.
It should be noted that, when the target service component needs to subscribe to a certain data, the target service component registers the second identification information of the target service component and the analysis mode for analyzing the data in the connection table in a registration mode, and when the command distribution component receives the first data message sent by the connection component, the first data message is analyzed according to the analysis mode in the connection table corresponding to the target service component.
Through the embodiment, a general command distribution mechanism is adopted to flexibly distribute commands, and when the target service component registers in service component information, the data is analyzed according to the analysis mode of user registration, and the analyzed data is sent to the corresponding service component, so that the reliability of the system is improved.
In one exemplary embodiment, parsing module 56 is configured to perform at least one of: determining a decryption mode of the first data message according to the connection table; determining an analytic protocol head function of the first data message according to the connection table; and determining an analytic data function of the first data message according to the connection table.
It should be noted that, the parsing mode of the target service component registration includes at least one of the following: decryption mode, analysis protocol head function and analysis data function.
It should be noted that, in the case that the target service component does not register the parsing manner, the connection management component forwards the received first data packet to the target service component, and the connection management component does not parse the first data packet.
Through the embodiment, the target service component autonomously registers the corresponding analysis mode, and flexibly processes the first data message according to the corresponding analysis mode of the target service component registration, so that the requirements of the target service component are met to a higher degree.
In an exemplary embodiment, the parsing module 56 is further configured to decrypt the first data packet according to the decryption method if the decryption method of the first data packet is determined according to the connection table; under the condition that an analytic protocol head function of the first data message is determined according to the connection table, mobilizing the analytic protocol head function to acquire protocol head information of the first data message; and under the condition that the analytic data function of the first data message is determined according to the connection table, calling the analytic data function to unpack the first data message.
Specifically, the parsing method registered in the target service component includes: under the condition of the decryption mode, decrypting the first data message according to the registered decryption mode; the analysis mode registered in the target service component comprises the following steps: under the condition of analyzing the protocol head function, the command distribution component calls the analyzed protocol head function to acquire the protocol head information of the first data message, and sends the protocol head information and the information except the protocol head in the first data message to the target service component; the analysis mode registered in the target service component comprises the following steps: under the condition of analyzing the data function, the command distribution component calls the analyzed data function, and unpacks the first data message and sends the unpacked data message.
Through the embodiment, the target service component autonomously registers the corresponding analysis mode, and flexibly processes the first data message according to the corresponding analysis mode of the target service component registration, so that the requirements of the target service component are met to a higher degree.
In an exemplary embodiment, the parsing module 56 is further configured to invoke a decryption function and a decryption pointer corresponding to the decryption manner in a security component, where the security component and the target service component are located in the same system; decrypting the first data message through the decryption function and the decryption finger.
It should be noted that, when it is determined that the first data packet needs to be decrypted according to the connection table, a decryption function and a decryption pointer corresponding to the decryption manner are called in the security component, and the first data packet is decrypted through the decryption function and the decryption pointer.
In an exemplary embodiment, parsing module 56 is further configured to determine a protocol for encapsulating the first data message; in the case where the number of protocols is plural, performing the parsing step: determining an outermost protocol for encapsulating the first data message; determining a second analysis mode of the data message corresponding to the outermost layer protocol, and analyzing the data message corresponding to the outermost layer protocol according to the second analysis mode, wherein the first analysis mode comprises: the second analysis mode; and circularly executing the analyzing step until the data message corresponding to the innermost protocol is analyzed according to the innermost protocol for packaging the first data message.
It should be noted that, the number of the protocols for encapsulating the first data packet may be plural, and in the case that the number of the protocols for encapsulating the first data packet is plural, the first data packet needs to be parsed circularly until the data packet corresponding to the innermost protocol is parsed according to the parsing mode corresponding to the innermost protocol; that is, for each protocol, a corresponding parsing scheme is included.
For example, the resolution mode corresponding to the outermost protocol is: decryption mode, analysis protocol head function and analysis data function; the parsing mode corresponding to the next layer protocol of the outermost layer protocol may be: the corresponding instant system modes of the innermost layer protocol of the analytic protocol head function and the analytic data function … … can be as follows: and analyzing the protocol head function. The embodiment of the invention does not limit the analysis mode corresponding to each layer of protocol.
In an exemplary embodiment, the obtaining module 52 is further configured to receive a registration request for the target service component, where the registration request is used to instruct the target service component to subscribe to the data packet transmitted through the connection; and storing the corresponding relation between the first identification information of the connection and the second identification information of the target service component in a command distribution table according to the registration request.
That is, when the target service component needs to subscribe to a certain data, the target service component adopts a registration mode to register the second identification information of the target service component into the command distribution table, so that the first data message can be sent to the target service component according to the information stored in the command distribution table.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, carrying out parameter detection on a first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among service components;
s2, determining a target service component subscribed to the first data message according to the first identification information;
s3, acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode;
and sending the analyzed first data message to the target service component.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, carrying out parameter detection on a first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among service components;
s2, determining a target service component subscribed to the first data message according to the first identification information;
s3, acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode;
and sending the analyzed first data message to the target service component.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. The method for sending the data message is characterized by comprising the following steps:
performing parameter detection on a first data message to obtain first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission between service components;
determining a target service component subscribed to the first data message according to the first identification information;
acquiring a first analysis mode corresponding to the target service component, and analyzing the first data message according to the first analysis mode;
and sending the analyzed first data message to the target service component.
2. The method for sending a data packet according to claim 1, wherein obtaining a first parsing scheme corresponding to the target service component includes:
acquiring second identification information of the target service component, wherein the second identification information uniquely identifies the target service component;
determining a connection table corresponding to the second identification information, wherein the connection table is used for indicating the corresponding relation between the second identification information and the first analysis mode;
and determining a first analysis mode corresponding to the target service component according to the connection table.
3. The method for sending a data packet according to claim 2, wherein determining, according to the connection table, a first parsing scheme corresponding to the target service component includes at least one of:
determining a decryption mode of the first data message according to the connection table;
determining an analytic protocol head function of the first data message according to the connection table;
and determining an analytic data function of the first data message according to the connection table.
4. The method for sending a data packet according to claim 3, wherein after determining the first parsing mode corresponding to the target service component according to the connection table, the method further comprises:
under the condition that the decryption mode of the first data message is determined according to the connection table, decrypting the first data message according to the decryption mode;
under the condition that an analytic protocol head function of the first data message is determined according to the connection table, mobilizing the analytic protocol head function to acquire protocol head information of the first data message;
and under the condition that the analytic data function of the first data message is determined according to the connection table, calling the analytic data function to unpack the first data message.
5. The method for sending a data packet according to claim 4, wherein decrypting the first data packet according to the decryption method includes:
invoking a decryption function and a decryption pointer corresponding to the decryption mode in a security component, wherein the security component and the target service component are positioned in the same system;
decrypting the first data message through the decryption function and the decryption finger.
6. The method for sending a data packet according to claim 1, wherein obtaining a first parsing scheme corresponding to the target service component, and parsing the first data packet according to the first parsing scheme, includes:
determining a protocol for encapsulating the first data message;
in the case where the number of protocols is plural, performing the parsing step: determining an outermost protocol for encapsulating the first data message; determining a second analysis mode of the data message corresponding to the outermost layer protocol, and analyzing the data message corresponding to the outermost layer protocol according to the second analysis mode, wherein the first analysis mode comprises: the second analysis mode;
and circularly executing the analyzing step until the data message corresponding to the innermost protocol is analyzed according to the innermost protocol for packaging the first data message.
7. The method for sending a data packet according to claim 1, wherein before determining, according to the first identification information, to subscribe to a target service component of the first data packet, the method further comprises:
receiving a registration request of the target service component, wherein the registration request is used for indicating the target service component to subscribe to a data message transmitted through the connection;
and storing the corresponding relation between the first identification information of the connection and the second identification information of the target service component in a command distribution table according to the registration request.
8. A data message transmitting apparatus, comprising:
the device comprises an acquisition module, a service component and a service component, wherein the acquisition module is used for carrying out parameter detection on a first data message to acquire first identification information carried in the first data message, wherein the first identification information is used for indicating connection for transmitting the first data message, and the connection is used for realizing data transmission among the service components;
the determining module is used for determining a target service component subscribed to the first data message according to the first identification information;
the analysis module is used for acquiring a first analysis mode corresponding to the target service component and analyzing the first data message according to the first analysis mode;
and the sending module is used for sending the analyzed first data message to the target service component.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202310362158.2A 2023-04-06 2023-04-06 Data message sending method and device, storage medium and electronic equipment Pending CN116436991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310362158.2A CN116436991A (en) 2023-04-06 2023-04-06 Data message sending method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310362158.2A CN116436991A (en) 2023-04-06 2023-04-06 Data message sending method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116436991A true CN116436991A (en) 2023-07-14

Family

ID=87079137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310362158.2A Pending CN116436991A (en) 2023-04-06 2023-04-06 Data message sending method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116436991A (en)

Similar Documents

Publication Publication Date Title
CN111327662B (en) Communication method and management device of heterogeneous Internet of things platform
CN108173727B (en) Intelligent household appliance network access method and equipment
US9425982B2 (en) Server and method for providing device management service and device receiving the device management service
CN114938365B (en) Function module updating method and device, storage medium and electronic device
CN116361155A (en) Method and device for testing software development kit, storage medium and electronic device
CN115297162B (en) Message sending method and device, storage medium and electronic device
CN116436991A (en) Data message sending method and device, storage medium and electronic equipment
CN116614858A (en) Data transmission method and device, storage medium and electronic equipment
CN116033006A (en) Data processing method, system, storage medium and electronic device
CN115314549B (en) Offline equipment management method, storage medium and electronic device
CN115002206B (en) Control method and device of intelligent equipment, storage medium and electronic device
CN114760235B (en) Method and device for executing dial testing task, storage medium and electronic device
CN116527738A (en) Service information processing method and device, storage medium and electronic device
CN117768256A (en) Equipment control method, device, storage medium and electronic device
CN117707488A (en) Function response method and device, storage medium and electronic device
CN115296948B (en) Scene information updating method and device, storage medium and electronic device
CN114697359B (en) Data collection method and device, storage medium and electronic device
CN115297345B (en) Method and device for processing screen-throwing request, storage medium and electronic device
CN115174296B (en) Equipment function access method and device, storage medium and electronic device
CN115174513B (en) Message pushing method and device, storage medium and electronic device
CN118394651A (en) Method and device for sending test cases, storage medium and electronic device
CN116389068A (en) Login method and device of application system, storage medium and electronic device
CN116389436A (en) Broadcasting method and device of processing result, storage medium and electronic device
CN117579409A (en) Control instruction processing method and device, storage medium and electronic device
CN116546055A (en) Service message processing method and device, storage medium and electronic device

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