CN117997978A - Message transmission method, device, computer equipment and storage medium - Google Patents

Message transmission method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117997978A
CN117997978A CN202211338995.3A CN202211338995A CN117997978A CN 117997978 A CN117997978 A CN 117997978A CN 202211338995 A CN202211338995 A CN 202211338995A CN 117997978 A CN117997978 A CN 117997978A
Authority
CN
China
Prior art keywords
message
target
initial
external system
request message
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
CN202211338995.3A
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.)
SF Technology Co Ltd
Original Assignee
SF Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN202211338995.3A priority Critical patent/CN117997978A/en
Publication of CN117997978A publication Critical patent/CN117997978A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a message transmission method, a device, a computer device and a storage medium, wherein the message transmission method comprises the following steps: acquiring request data for an external system sent by a logistics platform, wherein the request data comprises a first request message and configuration information of the external system; performing format conversion on the first request message based on the configuration information to obtain a second request message; determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with an external system in the plurality of initial encryption algorithms; encrypting the second request message based on a target encryption algorithm to obtain a target request message; and sending the target request message to an external system. The embodiment of the application can reduce the development cost of the logistics platform and the external system for developing the docking code to zero, improve the stability of the logistics platform and realize the private authentication of the external system in the process of message transmission.

Description

Message transmission method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of data transmission technologies, and in particular, to a method and apparatus for transmitting a message, a computer device, and a storage medium.
Background
The logistics platform is an enterprise-level express management system, which can help enterprises to intelligently manage express and monitor express cost, so that more and more external systems select to be in butt joint with the logistics platform. When the existing external system is in butt joint with the logistics platform, butt joint codes are required to be developed on the logistics platform and the external system, huge development cost is required to be input on the logistics platform and the external system, and stability of the logistics platform is reduced due to frequent edition.
Disclosure of Invention
The embodiment of the application provides a message transmission method, a device, computer equipment and a storage medium, which do not need to develop a docking code on a logistics platform and an external system, so that the development cost for developing the docking code on the logistics platform and the external system is reduced to zero, the stability of the logistics platform is improved, and the private authentication of the external system can be realized in the message transmission process.
In one aspect, the present application provides a message transmission method, where the message transmission method is applied to a message transmission device, where the message transmission device is respectively connected with a logistics platform and an external system in a communication manner, and the message transmission method includes:
acquiring request data for the external system, which is sent by the logistics platform, wherein the request data comprises a first request message and configuration information of the external system;
Performing format conversion on the first request message based on the configuration information to obtain a second request message;
determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with the external system in the plurality of initial encryption algorithms;
encrypting the second request message based on the target encryption algorithm to obtain a target request message;
And sending the target request message to the external system.
In some embodiments of the present application, the performing format conversion on the first request message based on the configuration information to obtain a second request message includes:
Determining a target message conversion code from a plurality of initial message conversion codes which are generated in advance based on the configuration information;
and performing format conversion on the first request message based on the target message conversion code to obtain a second request message.
In some embodiments of the present application, the determining, based on the configuration information, a target message conversion code from a plurality of initial message conversion codes generated in advance includes:
Acquiring a plurality of configuration interface information corresponding to a plurality of initial message conversion codes generated in advance respectively;
screening candidate interface information from the plurality of configuration interface information based on the configuration information, wherein the candidate interface information is information matched with the configuration information in the plurality of configuration interface information;
and determining the initial message conversion code corresponding to the candidate interface information as the target message conversion code.
In some embodiments of the present application, the target message conversion code includes encryption information of the external system, and the determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms includes:
acquiring a plurality of initial algorithm identifications corresponding to a plurality of pre-injected initial encryption algorithms respectively;
screening a target algorithm identifier from the plurality of initial algorithm identifiers based on the encryption information, wherein the target algorithm identifier is an identifier matched with the encryption information in the plurality of initial algorithm identifiers;
And determining the initial encryption algorithm corresponding to the target algorithm identifier as a target encryption algorithm.
In some embodiments of the present application, after the sending the target request packet to the external system, the method further includes:
Receiving an initial response message returned by the external system based on the target request message;
Performing format conversion on the initial response message based on the target message conversion code to obtain a target response message;
And sending the target response message to the logistics platform.
In some embodiments of the present application, the first request message includes a plurality of initial message parameter names and a plurality of initial message parameter values corresponding to the plurality of initial message parameter names, and before the format conversion is performed on the first request message based on the configuration information to obtain the second request message, the method further includes:
Determining whether candidate message parameter names exist in the initial message parameter names based on the initial message parameter values, wherein the candidate message parameter names are parameter names in which the corresponding initial message parameter values do not exist;
when candidate message parameter names exist in the plurality of initial message parameter names, invoking a pre-injected parameter acquisition function to acquire candidate message parameter values corresponding to the candidate message parameter names from the logistics platform;
and based on the candidate message parameter values, filling in the plurality of initial message parameter values.
In some embodiments of the present application, before the converting the format of the first request message based on the target message converting code to obtain the second request message, the method further includes:
And injecting the target message conversion code, the plurality of initial encryption algorithms and the parameter acquisition function into a preset execution environment to initialize the execution environment, wherein the execution environment is a preset running environment of the target message conversion code.
In another aspect, the present application provides a message transmission device, where the message transmission device is connected to the logistics platform and the external system in a communication manner, and the message transmission device includes:
The data acquisition unit is used for acquiring request data which are sent by the logistics platform and are aimed at the external system, wherein the request data comprise a first request message and configuration information of the external system;
the message conversion unit is used for carrying out format conversion on the first request message based on the configuration information to obtain a second request message;
A first determining unit configured to determine a target encryption algorithm from a plurality of initial encryption algorithms injected in advance, the target encryption algorithm being an algorithm matching with the external system among the plurality of initial encryption algorithms;
the message encryption unit is used for encrypting the second request message based on the target encryption algorithm to obtain a target request message;
and the message transmission unit is used for sending the target request message to the external system.
In some embodiments of the present application, the message conversion unit is specifically configured to:
Determining a target message conversion code from a plurality of initial message conversion codes which are generated in advance based on the configuration information;
and performing format conversion on the first request message based on the target message conversion code to obtain a second request message.
In some embodiments of the present application, the message conversion unit is specifically further configured to:
Acquiring a plurality of configuration interface information corresponding to a plurality of initial message conversion codes generated in advance respectively;
screening candidate interface information from the plurality of configuration interface information based on the configuration information, wherein the candidate interface information is information matched with the configuration information in the plurality of configuration interface information;
and determining the initial message conversion code corresponding to the candidate interface information as the target message conversion code.
In some embodiments of the present application, the target message conversion code includes encryption information of the external system, and the first determining unit is specifically configured to:
acquiring a plurality of initial algorithm identifications corresponding to a plurality of pre-injected initial encryption algorithms respectively;
screening a target algorithm identifier from the plurality of initial algorithm identifiers based on the encryption information, wherein the target algorithm identifier is an identifier matched with the encryption information in the plurality of initial algorithm identifiers;
And determining the initial encryption algorithm corresponding to the target algorithm identifier as a target encryption algorithm.
In some embodiments of the present application, the message transmission apparatus further includes:
And the message receiving unit is used for receiving an initial response message returned by the external system based on the target request message.
In some embodiments of the present application, the message conversion unit is further configured to:
And performing format conversion on the initial response message based on the target message conversion code to obtain a target response message.
In some embodiments of the present application, the packet transmission unit is further configured to:
And sending the target response message to the logistics platform.
In some embodiments of the present application, the first request message includes a plurality of initial message parameter names and a plurality of initial message parameter values corresponding to the plurality of initial message parameter names, and the message transmission device further includes:
A second determining unit, configured to determine, based on the plurality of initial message parameter values, whether a candidate message parameter name exists in the plurality of initial message parameter names, where the candidate message parameter name is a parameter name in which no corresponding initial message parameter value exists in the plurality of initial message parameter names;
The parameter acquisition unit is used for calling a pre-injected parameter acquisition function to acquire candidate message parameter values corresponding to the candidate message parameter names from the logistics platform when the candidate message parameter names exist in the plurality of initial message parameter names;
and the parameter filling unit is used for filling the plurality of initial message parameter values based on the candidate message parameter values.
In some embodiments of the present application, the message transmission apparatus further includes:
The initialization unit is used for injecting the target message conversion codes, the plurality of initial encryption algorithms and the parameter acquisition function into a preset execution environment to initialize the execution environment, wherein the execution environment is a preset running environment of the target message conversion codes.
In another aspect, the present application also provides a computer apparatus, including:
One or more processors;
A memory; and
One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method of any of the first aspects.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program to be loaded by a processor for performing the steps of the method for transmitting a message according to any of the first aspects.
The application carries out format conversion on the first request message by the message transmission device based on configuration information of an external system, does not need to develop a docking code on a logistics platform and the external system, reduces the development cost input by developing the docking code on the logistics platform and the external system to zero, improves the stability of the logistics platform, carries out encryption processing on the message after format conversion based on a target encryption algorithm determined in a plurality of pre-injected initial encryption algorithms, and can realize private authentication of the external system in the message transmission process.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a scenario of a message transmission system according to an embodiment of the present application;
FIG. 2 is a flow chart of an embodiment of a message transmission method according to an embodiment of the present application;
fig. 3 is a flowchart of a specific embodiment of a message transmission method provided in an embodiment of the present application;
Fig. 4 is a schematic structural diagram of an embodiment of a message transmission device provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of an embodiment of a computer device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on the drawings are merely for convenience in describing the present application and simplifying the description, and do not indicate or imply that the apparatus or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the present application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described as "exemplary" in this disclosure is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail so as not to obscure the description of the application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
It should be noted that, because the method of the embodiment of the present application is executed in the computer device, the processing objects of each computer device exist in the form of data or information, for example, time, which is essentially time information, it can be understood that in the subsequent embodiment, if the size, the number, the position, etc. are all corresponding data, so that the computer device can process the data, which is not described herein in detail.
The embodiment of the application provides a message transmission method, a message transmission device, computer equipment and a storage medium, and the message transmission method, the device, the computer equipment and the storage medium are respectively described in detail below.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a message transmission system provided by an embodiment of the present application, where the message transmission system may include a computer device 100, and a message transmission apparatus, such as the computer device in fig. 1, is integrated in the computer device 100.
In the embodiment of the present application, the computer device 100 is mainly configured to obtain request data for an external system sent by a logistics platform, where the request data includes a first request message and configuration information of the external system; performing format conversion on the first request message based on the configuration information to obtain a second request message; determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with an external system in the plurality of initial encryption algorithms; encrypting the second request message based on a target encryption algorithm to obtain a target request message; the target request message is sent to the external system, the computer device 100 can perform format conversion on the first request message based on the configuration information, a docking code is not required to be developed between the logistics platform and the external system, development cost input by the logistics platform and the external system for developing the docking code is reduced to zero, stability of the logistics platform is improved, the computer device 100 can encrypt the message after format conversion according to a pre-injected target encryption algorithm, and private authentication of the external system can be realized in the message transmission process.
In the embodiment of the present application, the computer device 100 may be an independent server, or may be a server network or a server cluster formed by servers, for example, the computer device 100 described in the embodiment of the present application includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a cloud server formed by a plurality of servers. Wherein the Cloud server is composed of a large number of computers or web servers based on Cloud Computing (Cloud Computing).
It is to be understood that the computer device 100 used in embodiments of the present application may be a device that includes both receive and transmit hardware, i.e., a device having receive and transmit hardware capable of performing bi-directional communications over a bi-directional communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may be one of a mobile phone, a tablet computer, a notebook computer, and the like.
It will be appreciated by those skilled in the art that the application environment shown in fig. 1 is merely an application scenario of the present application, and is not limited to the application scenario of the present application, and other application environments may further include more or fewer computer devices than those shown in fig. 1, for example, only 1 computer device is shown in fig. 1, and it will be appreciated that the message transmission system may further include one or more other services, which are not limited herein.
In addition, as shown in fig. 1, the packet transmission system may further include a memory 200 for storing data, such as a plurality of initial encryption algorithms, for example, a fifth version of a message digest Algorithm (MESSAGE DIGEST Algorithm 5, md5), a secure hash Algorithm (Secure Hash Algorithm, SHA), a data encryption standard Algorithm (Data Encryption Standard, DES), such as configuration information of an external system, specifically, a system ID of the external system, a user ID of the external system, an interface address of the external system, and the like.
It should be noted that, the schematic view of the scenario of the message transmission system shown in fig. 1 is only an example, and the message transmission system and the scenario described in the embodiment of the present application are for more clearly describing the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application, and those skilled in the art can know that, with the evolution of the message transmission system and the appearance of a new service scenario, the technical solution provided by the embodiment of the present application is equally applicable to similar technical problems.
Firstly, in the embodiment of the present application, a message transmission method is provided, an execution body of the message transmission method is a message transmission device, the message transmission device is applied to a computer device, the message transmission device is respectively in communication connection with a logistics platform and an external system, and the message transmission method includes: acquiring request data for the external system, which is sent by the logistics platform, wherein the request data comprises a first request message and configuration information of the external system; performing format conversion on the first request message based on the configuration information to obtain a second request message; determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with the external system in the plurality of initial encryption algorithms; encrypting the second request message based on the target encryption algorithm to obtain a target request message; and sending the target request message to the external system.
As shown in fig. 2, a flow chart of an embodiment of a message transmission method according to the present application is shown, and the message transmission method may include the following steps 301 to 305, which are specifically as follows:
301. request data which are sent by the logistics platform and aimed at the external system are obtained, wherein the request data comprise a first request message and configuration information of the external system.
The logistics platform is an enterprise-level express management system, the logistics platform is in communication connection with a plurality of external systems through a message transmission device, the external system is one of the plurality of external systems, the logistics platform can realize whole-course express tracking, and when logistics information changes, the logistics information is pushed to the external system. The request data is data sent by the logistics platform to the message transmission device aiming at the external system, the request data comprises a first request message and configuration information of the external system, the first request message is a logistics platform interface format request message, the first request message carries logistics information sent by the logistics platform to the external system, the logistics platform interface format is a format of a message sent by an interface of the logistics platform, and the logistics platform interface format comprises but is not limited to XML messages, JSON messages and the like. The configuration information is identification information of the external system, and is used for uniquely identifying the external system, and the configuration information of the external system includes, but is not limited to, a system ID of the external system, a user ID of the external system, interface information of the external system, and the like. When the physical platform needs to send the logistics information to the external system, the physical platform assembles the logistics information into a first request message according to the interface format of the physical platform, and sends request data containing the first request message and configuration information of the external system to the message transmission device, and after receiving the request data, the message transmission device obtains the first request message in the request data and the configuration information of the external system and sends the first request message to the external system based on the configuration information.
302. And carrying out format conversion on the first request message based on the configuration information to obtain a second request message.
The second request message is a message obtained after the format conversion of the first request message, the second request message is an external system interface format request message, the external system interface format is a format of a message sent by an interface of an external system, and the external system interface format comprises but is not limited to an XML message, a JSON message and the like. In order to send the first request message to the external system, after obtaining the request data for the external system sent by the logistics platform, the message transmission device performs format conversion on the first request message based on the configuration information so as to convert the first request message into a second request message in an external system interface format.
In a specific embodiment, as shown in fig. 3, the step 302 of performing format conversion on the first request message based on the configuration information to obtain a second request message may include the following steps 401 to 402, which are specifically as follows:
401. Determining a target message conversion code from a plurality of initial message conversion codes which are generated in advance based on the configuration information;
402. And performing format conversion on the first request message based on the target message conversion code to obtain a second request message.
The plurality of initial message conversion codes are codes which are respectively generated for a plurality of external systems in advance and are used for message conversion, the plurality of initial message conversion codes are in one-to-one correspondence with the plurality of external systems, for example, the plurality of external systems comprise an external system A, an external system B and an external system C, and then the initial message conversion codes A, the initial message conversion codes B and the initial message conversion codes C which respectively correspond to the external system A, the external system B and the external system C are respectively generated in advance. The target message conversion code is an initial message conversion code corresponding to the external system, and can assemble the request message of the logistics platform interface format into the request message of the external system interface format.
In order to enable the logistics platform to be in butt joint with a plurality of external systems, for the external systems which need to be accessed into the logistics platform, initial message conversion codes corresponding to the external systems are generated in advance according to interface documents of the external systems. When format conversion is performed on the first request message based on the configuration information, firstly, a target message conversion code matched with the configuration information is determined from a plurality of initial message conversion codes generated in advance based on the configuration information, and then format conversion is performed on the first request message based on the target message conversion code, so that a second request message in an external system interface format can be obtained.
In a specific embodiment, determining the target message conversion code from the pre-generated multiple initial message conversion codes based on the configuration information in step 401 may include the following steps 501 to 503, which are specifically as follows:
501. Acquiring a plurality of configuration interface information corresponding to a plurality of initial message conversion codes generated in advance respectively;
502. screening candidate interface information from the plurality of configuration interface information based on the configuration information, wherein the candidate interface information is information matched with the configuration information in the plurality of configuration interface information;
503. and determining the initial message conversion code corresponding to the candidate interface information as the target message conversion code.
Each initial message conversion code in the plurality of initial message conversion codes has corresponding configuration interface information, and the configuration interface information corresponding to each initial message conversion code can be a system interface address of an external system corresponding to each initial message conversion code. The candidate interface information is information matched with the configuration information in the plurality of configuration interface information, for example, the configuration interface information a is a system interface address of the external system a, the configuration information includes the system interface address of the external system a, the configuration interface information a is matched with the configuration information, and the configuration interface information a is the candidate interface information.
When determining a target message conversion code from a plurality of pre-generated initial message conversion codes based on configuration information, the embodiment firstly acquires a plurality of configuration interface information corresponding to the plurality of initial message conversion codes, then compares the configuration information with the plurality of configuration interface information, screens candidate interface information matched with the configuration information from the plurality of configuration interface information based on a comparison result, and finally determines the initial message conversion code corresponding to the candidate interface information as the target message conversion code.
303. Determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with the external system in the plurality of initial encryption algorithms.
The plurality of initial encryption algorithms are encryption algorithms supported by the plurality of external systems, the plurality of initial encryption algorithms include, but are not limited to, message digest Algorithm fifth edition (MESSAGE DIGEST Algorithm 5, MD5), secure hash Algorithm (Secure Hash Algorithm, SHA), data encryption standard Algorithm (Data Encryption Standard, DES), and the like, and the target encryption Algorithm is an encryption Algorithm supported by the external systems. In order to support private authentication of an external system in a message transmission process, the embodiment pre-injects a plurality of initial encryption algorithms, and after obtaining a second request message, determines a target encryption algorithm from the pre-injected plurality of initial encryption algorithms, so as to encrypt the second request message based on the target encryption algorithm in a subsequent step.
In a specific embodiment, as shown in fig. 3, the target message conversion code includes encryption information of an external system, and the determining the target encryption algorithm from the pre-injected multiple initial encryption algorithms in step 303 may include the following steps 403 to 405, which are specifically as follows:
403. acquiring a plurality of initial algorithm identifications corresponding to a plurality of pre-injected initial encryption algorithms respectively;
404. screening a target algorithm identifier from the plurality of initial algorithm identifiers based on the encryption information, wherein the target algorithm identifier is an identifier matched with the encryption information in the plurality of initial algorithm identifiers;
405. and determining the initial encryption algorithm corresponding to the target algorithm identifier as a target encryption algorithm.
The target message conversion code comprises encryption information of an external system, wherein the encryption information comprises, but is not limited to, algorithm identification, a secret key and the like of a target encryption algorithm. The plurality of initial algorithm identifications are identifications corresponding to the plurality of initial encryption algorithms respectively and are used for uniquely identifying each initial encryption algorithm, the target algorithm identification is an identification matched with encryption information in the plurality of initial algorithm identifications, for example, the encryption information comprises an algorithm identification of MD5, the initial algorithm identification A is matched with the encryption information, and the initial algorithm identification A is the target algorithm identification.
When determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, the embodiment firstly acquires a plurality of initial algorithm identifications corresponding to the pre-injected initial encryption algorithms respectively, then screens out an identification matched with encryption information, namely, a target algorithm identification, from the plurality of initial algorithm identifications based on encryption information, and finally determines the initial encryption algorithm corresponding to the target algorithm identification as the target encryption algorithm.
304. And encrypting the second request message based on the target encryption algorithm to obtain a target request message.
The target request message is a message obtained by encrypting the second request message based on the target encryption algorithm, and after determining the target encryption algorithm from a plurality of pre-injected initial encryption algorithms, the embodiment encrypts the second request message based on the target encryption algorithm to obtain the target request message. The encryption processing steps of the second request message are different according to different target encryption algorithms, for example, when the target encryption algorithm is MD5, the current timestamp can be dynamically obtained when the second request message is encrypted, then signature information is generated based on the system ID, the key and the timestamp, and finally the signature information is placed in the header of the second request message, so that the encryption processing of the second request message can be realized.
305. And sending the target request message to the external system.
After the message transmission device performs format conversion and encryption processing on the first request message, the obtained target request message can be sent to an external system, on one hand, because the first request message is subjected to format conversion in the message transmission device, a docking code is not required to be developed on a logistics platform and an external system, the development cost of the logistics platform and the external system for developing the docking code is reduced to zero, and the logistics platform is good in stability because the logistics platform does not frequently issue. On the other hand, in the process of message transmission, the message can be encrypted based on a pre-injected encryption algorithm, so that the converted message supports private authentication of an external system.
In a specific embodiment, as shown in fig. 3, after the target request packet is sent to the external system in step 305, the following steps 306 to 308 may be included, which are specifically as follows:
306. receiving an initial response message returned by the external system based on the target request message;
307. Performing format conversion on the initial response message based on the target message conversion code to obtain a target response message;
308. and sending the target response message to the logistics platform.
The initial response message is a response result returned by the external system after receiving the target request message, the initial response message is an external system interface format response message, and the target response message is a logistics platform interface format response message. The target message conversion code not only can assemble the request message of the logistics platform interface format into the request message of the external system interface format, but also can assemble the response message of the external system interface format into the response message of the logistics platform interface format. After receiving the target request message sent by the message transmission device, the external system of the embodiment returns an initial response message to the message transmission device based on the target request message, and after receiving the initial response message, the message transmission device performs format conversion on the initial response message based on the target message conversion code to obtain a target response message, and then sends the target response message to the logistics platform.
In a specific embodiment, the first request message includes a plurality of initial message parameter names and a plurality of initial message parameter values corresponding to the plurality of initial message parameter names, and before the format conversion is performed on the first request message based on the configuration information in step 302 to obtain the second request message, the method may include the following steps 309 to 311, which are specifically as follows:
309. Determining whether candidate message parameter names exist in the initial message parameter names based on the initial message parameter values, wherein the candidate message parameter names are parameter names in which the corresponding initial message parameter values do not exist;
310. when candidate message parameter names exist in the plurality of initial message parameter names, invoking a pre-injected parameter acquisition function to acquire candidate message parameter values corresponding to the candidate message parameter names from the logistics platform;
311. And based on the candidate message parameter values, filling in the plurality of initial message parameter values.
The first request message includes a plurality of initial message parameter names and a plurality of initial message parameter values, where the plurality of initial message parameter names are parameter names of logistic information carried in the first request message, for example, the plurality of initial message parameter names may be a bill number, a sender, a receiver, a current link, etc., the plurality of initial message parameter values are parameter values corresponding to the plurality of initial message parameter names, for example, when the plurality of initial messages Wen Canshu are a bill number, a sender, a receiver, the plurality of initial message parameter values are specific bill numbers, sender names, receiver names. The candidate message parameter names are parameter names of missing initial message parameter values in the plurality of initial message parameter names, for example, the plurality of initial message Wen Canshu names are the bill number, the sender and the receiver, but the plurality of initial message parameter values are specific bill number and sender names, that is, the receiver does not have the corresponding initial message parameter values, and the receiver is the candidate message parameter name at this time.
Considering that the first request message has a missing parameter value, after the message transmission device acquires the first request message, determining whether an initial message parameter name with the missing initial message parameter value exists in the initial message parameter names, namely a candidate message parameter name, when the candidate message parameter name exists in the initial message parameter names, invoking a pre-injected parameter acquisition function to acquire the candidate message parameter value corresponding to the candidate message parameter name from the logistics platform, and supplementing the initial message parameter values based on the candidate message parameter values. For example, when the recipient does not have the corresponding initial message parameter value, the message transmission device may acquire the recipient name corresponding to the operation list number from the logistics platform by calling the pre-injected parameter acquisition function, and add the recipient name to the plurality of initial message parameter values, so that each initial message parameter name in the first request message has the corresponding initial message parameter value.
In a specific embodiment, before the format conversion of the first request message based on the target message conversion code in step 402 to obtain the second request message, the method may include the following step 406, which is specifically as follows:
406. And injecting the target message conversion code, the plurality of initial encryption algorithms and the parameter acquisition function into a preset execution environment to initialize the execution environment, wherein the execution environment is a preset running environment of the target message conversion code.
The execution environment is the preset execution environment of the target message conversion code, and the execution environment can be a JavaScript executor in any language, for example, golang and Java all have corresponding JavaScript executors. Before the format conversion of the first request message, the target message conversion code, a plurality of initial encryption algorithms and a parameter acquisition function are required to be injected into a preset execution environment so as to initialize the execution environment. After the target message conversion code is injected into the execution environment, the message conversion code can be executed in the execution environment, so that the message conversion is realized. In addition, because a plurality of initial encryption algorithms are injected in advance in the execution environment, a target encryption algorithm can be called from the plurality of initial encryption algorithms to encrypt the message in the message conversion process, so that private authentication of an external system is realized. In addition, because the parameter acquisition function is injected in the execution environment in advance, the data interaction between the parameter acquisition function and the logistics platform can be carried out in the message conversion process.
In order to better implement the message transmission method in the embodiment of the present application, on the basis of the message transmission method, the embodiment of the present application further provides a message transmission device, as shown in fig. 4, where the message transmission device 700 includes:
A data obtaining unit 701, configured to obtain request data for the external system sent by the logistics platform, where the request data includes a first request packet and configuration information of the external system;
A message conversion unit 702, configured to perform format conversion on the first request message based on the configuration information, so as to obtain a second request message;
a first determining unit 703 configured to determine a target encryption algorithm from a plurality of initial encryption algorithms injected in advance, the target encryption algorithm being an algorithm matching the external system among the plurality of initial encryption algorithms;
A message encrypting unit 704, configured to encrypt the second request message based on the target encryption algorithm, to obtain a target request message;
And a message transmission unit 705, configured to send the target request message to the external system.
In the embodiment of the application, the message transmission device carries out format conversion on the first request message based on the configuration information of the external system, and the development cost of the logistics platform and the external system for developing the docking code is reduced to zero without developing the docking code on the logistics platform and the external system, so that the stability of the logistics platform is improved, the message after format conversion is encrypted based on the target encryption algorithm determined in the pre-injected multiple initial encryption algorithms, and the private authentication of the external system can be realized in the message transmission process.
In some embodiments of the present application, the message conversion unit 702 is specifically configured to:
Determining a target message conversion code from a plurality of initial message conversion codes which are generated in advance based on the configuration information;
and performing format conversion on the first request message based on the target message conversion code to obtain a second request message.
In some embodiments of the present application, the message conversion unit 702 is specifically further configured to:
Acquiring a plurality of configuration interface information corresponding to a plurality of initial message conversion codes generated in advance respectively;
screening candidate interface information from the plurality of configuration interface information based on the configuration information, wherein the candidate interface information is information matched with the configuration information in the plurality of configuration interface information;
and determining the initial message conversion code corresponding to the candidate interface information as the target message conversion code.
In some embodiments of the present application, the target message conversion code includes encryption information of the external system, and the first determining unit 703 is specifically configured to:
acquiring a plurality of initial algorithm identifications corresponding to a plurality of pre-injected initial encryption algorithms respectively;
screening a target algorithm identifier from the plurality of initial algorithm identifiers based on the encryption information, wherein the target algorithm identifier is an identifier matched with the encryption information in the plurality of initial algorithm identifiers;
And determining the initial encryption algorithm corresponding to the target algorithm identifier as a target encryption algorithm.
In some embodiments of the present application, the message transmission apparatus 700 further includes:
And the message receiving unit is used for receiving an initial response message returned by the external system based on the target request message.
In some embodiments of the present application, the message conversion unit 702 is further configured to:
And performing format conversion on the initial response message based on the target message conversion code to obtain a target response message.
In some embodiments of the present application, the message transmission unit 705 is further configured to:
And sending the target response message to the logistics platform.
In some embodiments of the present application, the first request message includes a plurality of initial message parameter names and a plurality of initial message parameter values corresponding to the plurality of initial message parameter names, and the message transmission apparatus 700 further includes:
A second determining unit, configured to determine, based on the plurality of initial message parameter values, whether a candidate message parameter name exists in the plurality of initial message parameter names, where the candidate message parameter name is a parameter name in which no corresponding initial message parameter value exists in the plurality of initial message parameter names;
The parameter acquisition unit is used for calling a pre-injected parameter acquisition function to acquire candidate message parameter values corresponding to the candidate message parameter names from the logistics platform when the candidate message parameter names exist in the plurality of initial message parameter names;
and the parameter filling unit is used for filling the plurality of initial message parameter values based on the candidate message parameter values.
In some embodiments of the present application, the message transmission apparatus 700 further includes:
The initialization unit is used for injecting the target message conversion codes, the plurality of initial encryption algorithms and the parameter acquisition function into a preset execution environment to initialize the execution environment, wherein the execution environment is a preset running environment of the target message conversion codes.
The embodiment of the application also provides a computer device, which integrates any one of the message transmission devices provided by the embodiment of the application, and the computer device comprises:
One or more processors;
A memory; and
One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to perform the steps of the message transmission method described in any of the above-described message transmission method embodiments.
The embodiment of the application also provides computer equipment which integrates any one of the message transmission devices provided by the embodiment of the application. As shown in fig. 5, a schematic structural diagram of a computer device according to an embodiment of the present application is shown, specifically:
The computer device may include one or more processors 901 of a processing core, one or more memories 902 of a computer readable storage medium, a power supply 903, and an input unit 904, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 5 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
Processor 901 is the control center of the computer device, connecting the various parts of the entire computer device using various interfaces and lines, performing various functions of the computer device and processing data by running or executing software programs and/or modules stored in memory 902, and invoking data stored in memory 902, thereby performing overall monitoring of the computer device. Optionally, processor 901 may include one or more processing cores; preferably, the processor 901 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 901.
The memory 902 may be used to store software programs and modules, and the processor 901 performs various functional applications and data processing by executing the software programs and modules stored in the memory 902. The memory 902 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 902 may also include a memory controller to provide access to the memory 902 by the processor 901.
The computer device further comprises a power supply 903 for powering the various components, preferably the power supply 903 is logically connected to the processor 901 via a power management system, whereby the functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 903 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 904, which input unit 904 may be used to receive input numeric or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 901 in the computer device loads executable files corresponding to the processes of one or more application programs into the memory 902 according to the following instructions, and the processor 901 executes the application programs stored in the memory 902, so as to implement various functions as follows:
Acquiring request data for an external system sent by a logistics platform, wherein the request data comprises a first request message and configuration information of the external system;
Performing format conversion on the first request message based on the configuration information to obtain a second request message;
determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with the external system in the plurality of initial encryption algorithms;
encrypting the second request message based on the target encryption algorithm to obtain a target request message;
And sending the target request message to the external system.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like. The computer program is stored thereon and loaded by a processor to perform the steps of any one of the message transmission methods provided by the embodiments of the present application. For example, the loading of the computer program by the processor may perform the steps of:
Acquiring request data for an external system sent by a logistics platform, wherein the request data comprises a first request message and configuration information of the external system;
Performing format conversion on the first request message based on the configuration information to obtain a second request message;
determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with the external system in the plurality of initial encryption algorithms;
encrypting the second request message based on the target encryption algorithm to obtain a target request message;
And sending the target request message to the external system.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of one embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of other embodiments, which are not described herein again.
In the implementation, each unit or structure may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each unit or structure may be referred to the foregoing method embodiments and will not be repeated herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The foregoing describes in detail a message transmission method, apparatus, computer device and storage medium provided by the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (10)

1. The message transmission method is characterized in that the message transmission method is applied to a message transmission device, the message transmission device is respectively in communication connection with a logistics platform and an external system, and the message transmission method comprises the following steps:
acquiring request data for the external system, which is sent by the logistics platform, wherein the request data comprises a first request message and configuration information of the external system;
Performing format conversion on the first request message based on the configuration information to obtain a second request message;
determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms, wherein the target encryption algorithm is an algorithm matched with the external system in the plurality of initial encryption algorithms;
encrypting the second request message based on the target encryption algorithm to obtain a target request message;
And sending the target request message to the external system.
2. The method for transmitting a message according to claim 1, wherein the performing format conversion on the first request message based on the configuration information to obtain a second request message includes:
Determining a target message conversion code from a plurality of initial message conversion codes which are generated in advance based on the configuration information;
and performing format conversion on the first request message based on the target message conversion code to obtain a second request message.
3. The message transmission method according to claim 2, wherein determining a target message conversion code from a plurality of initial message conversion codes generated in advance based on the configuration information includes:
Acquiring a plurality of configuration interface information corresponding to a plurality of initial message conversion codes generated in advance respectively;
screening candidate interface information from the plurality of configuration interface information based on the configuration information, wherein the candidate interface information is information matched with the configuration information in the plurality of configuration interface information;
and determining the initial message conversion code corresponding to the candidate interface information as the target message conversion code.
4. The method for transmitting a message according to claim 2, wherein the target message conversion code includes encryption information of the external system, and the determining a target encryption algorithm from a plurality of pre-injected initial encryption algorithms includes:
acquiring a plurality of initial algorithm identifications corresponding to a plurality of pre-injected initial encryption algorithms respectively;
screening a target algorithm identifier from the plurality of initial algorithm identifiers based on the encryption information, wherein the target algorithm identifier is an identifier matched with the encryption information in the plurality of initial algorithm identifiers;
And determining the initial encryption algorithm corresponding to the target algorithm identifier as a target encryption algorithm.
5. The method for transmitting a message according to claim 2, wherein after the target request message is sent to the external system, the method further comprises:
Receiving an initial response message returned by the external system based on the target request message;
Performing format conversion on the initial response message based on the target message conversion code to obtain a target response message;
And sending the target response message to the logistics platform.
6. The method according to claim 2, wherein the first request message includes a plurality of initial message parameter names and a plurality of initial message parameter values corresponding to the plurality of initial message parameter names, and the method further includes, before performing format conversion on the first request message based on the configuration information to obtain the second request message:
Determining whether candidate message parameter names exist in the initial message parameter names based on the initial message parameter values, wherein the candidate message parameter names are parameter names in which the corresponding initial message parameter values do not exist;
when candidate message parameter names exist in the plurality of initial message parameter names, invoking a pre-injected parameter acquisition function to acquire candidate message parameter values corresponding to the candidate message parameter names from the logistics platform;
and based on the candidate message parameter values, filling in the plurality of initial message parameter values.
7. The method for transmitting a message according to claim 6, wherein before the format conversion is performed on the first request message based on the target message conversion code to obtain the second request message, the method further comprises:
And injecting the target message conversion code, the plurality of initial encryption algorithms and the parameter acquisition function into a preset execution environment to initialize the execution environment, wherein the execution environment is a preset running environment of the target message conversion code.
8. The utility model provides a message transmission device, its characterized in that, message transmission device and logistics platform and external system communication connection respectively, message transmission device includes:
The data acquisition unit is used for acquiring request data which are sent by the logistics platform and are aimed at the external system, wherein the request data comprise a first request message and configuration information of the external system;
the message conversion unit is used for carrying out format conversion on the first request message based on the configuration information to obtain a second request message;
A first determining unit configured to determine a target encryption algorithm from a plurality of initial encryption algorithms injected in advance, the target encryption algorithm being an algorithm matching with the external system among the plurality of initial encryption algorithms;
the message encryption unit is used for encrypting the second request message based on the target encryption algorithm to obtain a target request message;
and the message transmission unit is used for sending the target request message to the external system.
9. A computer device, the computer device comprising:
One or more processors;
A memory; and
One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the message transmission method of any of claims 1 to 7.
10. A computer readable storage medium, having stored thereon a computer program, the computer program being loaded by a processor to perform the steps of the message transmission method of any of claims 1 to 7.
CN202211338995.3A 2022-10-28 2022-10-28 Message transmission method, device, computer equipment and storage medium Pending CN117997978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211338995.3A CN117997978A (en) 2022-10-28 2022-10-28 Message transmission method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211338995.3A CN117997978A (en) 2022-10-28 2022-10-28 Message transmission method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117997978A true CN117997978A (en) 2024-05-07

Family

ID=90900006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211338995.3A Pending CN117997978A (en) 2022-10-28 2022-10-28 Message transmission method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117997978A (en)

Similar Documents

Publication Publication Date Title
EP3639465B1 (en) Improved hardware security module management
US20210174425A1 (en) Method for registering customized device, server, and terminal
WO2018177124A1 (en) Service processing method and device, data sharing system and storage medium
CN109976667B (en) Mirror image management method, device and system
CN103038788B (en) Providing multiple network resources
CN105900466B (en) Message processing method and device
CN102255887B (en) Method and system for providing online services corresponding to multiple mobile devices
US10050899B2 (en) Data processing method, apparatus, client, server and system
US20150113113A1 (en) Application takeover method and system, mobile terminal, and server
CN103095824B (en) Files passe control method and system
US20140105399A1 (en) Method for providing application service
CN112346751B (en) Application program installation method and device, electronic equipment and storage medium
CN104580177A (en) Resource supplying method, device and system
CN115052041B (en) Channel identifier allocation method, device, equipment and storage medium
CN112995239A (en) Data processing method and device
WO2009102114A2 (en) Terminal and method for identifying contents
CN117997978A (en) Message transmission method, device, computer equipment and storage medium
CN114422586B (en) Event notification method, event notification device, computer equipment and storage medium
CN112995932B (en) Short message link monitoring method, device, equipment and medium based on Hash algorithm
CN116070290A (en) Device connection method, apparatus, electronic device, and computer-readable storage medium
CN114428691A (en) Application calling method and device, electronic equipment and computer-readable storage medium
CN113746909A (en) Network connection method, device, electronic equipment and computer readable storage medium
CN113642948A (en) Model management method, device and storage medium
CN114513307B (en) New client verification method, device, equipment and storage medium
CN113806801B (en) Transaction information uplink method, device, computer equipment and storage medium

Legal Events

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