CN112468544B - Express data transmission method based on middleware and middleware - Google Patents

Express data transmission method based on middleware and middleware Download PDF

Info

Publication number
CN112468544B
CN112468544B CN202011258980.7A CN202011258980A CN112468544B CN 112468544 B CN112468544 B CN 112468544B CN 202011258980 A CN202011258980 A CN 202011258980A CN 112468544 B CN112468544 B CN 112468544B
Authority
CN
China
Prior art keywords
middleware
baton
gun
express data
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011258980.7A
Other languages
Chinese (zh)
Other versions
CN112468544A (en
Inventor
张阁
李培吉
李建泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongpu Software Co Ltd
Original Assignee
Dongpu Software 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 Dongpu Software Co Ltd filed Critical Dongpu Software Co Ltd
Priority to CN202011258980.7A priority Critical patent/CN112468544B/en
Publication of CN112468544A publication Critical patent/CN112468544A/en
Application granted granted Critical
Publication of CN112468544B publication Critical patent/CN112468544B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The application provides an express data transmission method and a middleware based on middleware, wherein the middleware comprises a middleware gun end installed on each gun and a middleware server end installed on a server, and the method comprises the following steps: the method comprises the steps that a middleware baton end generates unique identifiers of each baton and sends the unique identifiers to a middleware server end, a private key and a public key of each baton are generated and the public key of each baton is sent to the middleware server end, when the baton is used for uploading data, whether baton equipment is legal or not is verified by comparing the identifiers to be verified generated in real time with the unique identifiers, data safety transmission between the middleware baton end and the middleware server end is guaranteed through private key encryption and public key decryption, and data interaction is conducted between the baton and the middleware server end in a mode of calling middleware, so that functions of legal authentication and express data safety transmission of the baton equipment are provided, and unauthorized baton equipment is prevented from uploading express data.

Description

Express data transmission method based on middleware and middleware
Technical Field
The application relates to the technical field of logistics express data security, in particular to an express data transmission method based on middleware, the middleware, electronic equipment and a computer readable storage medium.
Background
With the development of the mobile internet and the progress of communication technology, the intelligent terminal gun equipment in the express logistics has become an indispensable part in the collection and delivery, and the communication security between the gun equipment and the server is more and more paid attention. On one hand, the vulnerable characteristic of the intelligent terminal makes the intelligent terminal become a source of leakage of user data and private information, and on the other hand, part of large-client fake Bagun equipment is used for uploading illegal profit of express data, so that normal operation of an express company is disturbed.
It is therefore necessary to establish a secure method of communication between the gun and the server to enhance the legitimacy and security of the data upload.
Disclosure of Invention
The utility model aims at providing an express delivery data transmission method, middleware, electronic equipment and computer readable storage medium based on middleware, prevent big customer forge express delivery rifle information, guarantee the legitimacy of rifle equipment, realize the safe uploading of express delivery data.
The purpose of the application is realized by adopting the following technical scheme:
in a first aspect, the present application provides a method for transmitting express data based on middleware, where the middleware includes a middleware gun end installed on each gun and a middleware server end installed on a server, and the method includes: the middleware gun end respectively generates a unique identifier of each gun and sends the unique identifier to the middleware server end, and respectively generates a private key and a public key of each gun and sends the public key of each gun to the middleware server end; receiving a data uploading request sent by a first barker, generating a to-be-verified identifier of the first barker in real time, encrypting the to-be-verified identifier by using a private key of the first barker, and sending the encrypted to-be-verified identifier to the middleware server; the middleware server decrypts the encrypted identification to be verified by using the public key of the first baton; if decryption is successful, detecting whether unique identifiers consistent with the identifier to be verified exist in all the unique identifiers; if so, prompting that the first gun at the gun end of the middleware is legal; the middleware baton end receives express data sent by the first baton and sends the express data to the middleware server end; and the middleware server side stores the express data to the server. The technical scheme has the advantages that the unique identifiers and public keys of all legal baton equipment are stored in the middleware server, when the baton equipment is used for uploading data, whether the baton equipment is legal or not is verified by comparing the to-be-verified identifiers generated in real time with the unique identifiers, data safety transmission between the middleware baton end and the middleware server end is ensured by encrypting the private keys and decrypting the public keys, data interaction is not directly carried out between the baton and the server, but is carried out in a mode of calling the middleware, thereby the functions of legal authentication and safe data transmission of express delivery of the baton equipment are provided, the fact that the allied suppliers in a supply chain use unauthorized baton equipment for uploading express delivery data and illegal muelle is avoided, a safe and effective data environment is provided for a data warehouse of an express company, and the middleware is used as a bottom integration technology of the baton equipment and the data transmission, and good cooperation relations among large clients, network points and express companies are ensured.
In some optional embodiments, the middleware baton end generates a unique identifier of each baton and sends the unique identifier to the middleware server end, generates a private key and a public key of each baton and sends the public key of each baton to the middleware server end, including: the middleware gun end respectively reads the equipment code, the MAC address and the CPU serial number of each gun, respectively generates a unique identifier of each gun according to the read equipment code, MAC address and CPU serial number of each gun and sends the unique identifier to the middleware server end; the middleware baton end respectively reads the equipment code, the MAC address, the IP address and the time stamp of each baton, respectively generates a private key and a public key of each baton according to the read equipment code, the MAC address, the IP address and the time stamp of each baton, and sends the public key of each baton to the middleware server end; the real-time generation of the identification to be verified of the first gun comprises the following steps: and the middleware gun end reads the equipment code, the MAC address and the CPU serial number of the first gun and generates the identification to be verified of the first gun in real time according to the read equipment code, MAC address and CPU serial number of the first gun. The technical scheme has the beneficial effects that the unique identifier of the gun is generated by using the equipment code, the MAC address and the CPU serial number of the gun, and the private key and the public key pair of the gun are generated by using the equipment code, the MAC address, the IP address and the timestamp of the gun, so that the gun equipment is prevented from being forged by a large customer, and the normal operation of an express company is disturbed.
In some optional embodiments, the middleware baton end receives the express data sent by the first baton and sends the express data to the middleware server end, including: the middleware baton end receives the express data sent by the first baton, encrypts the express data by using a private key of the first baton, and sends the encrypted express data to the middleware server end; the middleware server side stores the express data to the server, and the method comprises the following steps: the middleware server decrypts the encrypted express data by using the public key of the first baton; and if the decryption is successful, storing the express data to the server. The technical scheme has the beneficial effects that the secure transmission of the express data between the middleware baton end and the middleware server end is ensured through private key encryption and public key decryption.
In some alternative embodiments, the method further comprises: if the decryption is unsuccessful, the middleware server marks the encrypted identification to be verified as abnormal data, and prompts the middleware gun end that the first gun is illegal. The technical scheme has the beneficial effects that when decryption is unsuccessful, the public key stored in the middleware server side is not matched with the private key of the encrypted data of the middleware gun side, and the possibility of forging gun equipment exists.
In some alternative embodiments, the method further comprises: if the first bar gun is not legal, the middleware server marks the mark to be verified as abnormal data, and prompts the middleware bar gun end that the first bar gun is illegal. The technical scheme has the beneficial effects that if the unique identifier which is consistent with the identifier to be verified of the first gun does not exist in the unique identifier stored in the middleware server side, the first gun is not in the list of legal gun equipment, and the possibility of forging the gun equipment exists.
In some optional embodiments, the middleware baton end receives the express data sent by the first baton and sends the express data to the middleware server end, including: and the middleware baton end detects whether the updating is needed, if so, the updating is carried out, and if not, the express data sent by the first baton is received and sent to the middleware server end. The technical scheme has the advantages that the middleware has the characteristics of easy use and expandability, and can be automatically updated on line after the new version is released.
In a second aspect, the present application provides a middleware comprising a middleware gun end mounted on each gun and a middleware server end mounted on a server; the middleware gun end is configured to generate a unique identifier of each gun and send the unique identifier to the middleware server end, generate a private key and a public key of each gun and send the public key of each gun to the middleware server end; receiving a data uploading request sent by a first barker, generating a to-be-verified identifier of the first barker in real time, encrypting the to-be-verified identifier by using a private key of the first barker, and sending the encrypted to-be-verified identifier to the middleware server; the middleware server side is configured to decrypt the encrypted identifier to be verified by using the public key of the first baton; if decryption is successful, detecting whether unique identifiers consistent with the identifier to be verified exist in all the unique identifiers; if so, prompting that the first gun at the gun end of the middleware is legal; the middleware baton end is further configured to receive express data sent by the first baton and send the express data to the middleware server end; the middleware server side is further configured to store the express data to the server.
In some optional embodiments, the middleware baton end is further configured to respectively read the equipment code, the MAC address and the CPU serial number of each baton, respectively generate a unique identifier of each baton according to the read equipment code, MAC address and CPU serial number of each baton, and send the unique identifier to the middleware server end; the middleware baton end is further configured to respectively read the equipment code, the MAC address, the IP address and the time stamp of each baton, respectively generate a private key and a public key of each baton according to the read equipment code, the MAC address, the IP address and the time stamp of each baton, and send the public key of each baton to the middleware server end; the middleware gun end is further configured to read the equipment code, the MAC address and the CPU serial number of the first gun, and generate the identification to be verified of the first gun in real time according to the read equipment code, MAC address and CPU serial number of the first gun.
In some optional embodiments, the middleware server is further configured to mark the encrypted identifier to be verified as abnormal data if decryption is unsuccessful, and prompt that the first baton is illegal at the middleware baton end.
In some optional embodiments, the middleware server is further configured to mark the identifier to be verified as abnormal data if the identifier does not exist, and prompt the middleware gun end that the first gun is illegal.
In some optional embodiments, the middleware baton end is further configured to receive the express data sent by the first baton, encrypt the express data using a private key of the first baton, and send the encrypted express data to the middleware server end; the middleware server side is further configured to decrypt the encrypted express data by using the public key of the first baton; and if the decryption is successful, storing the express data to the server.
In some optional embodiments, the middleware baton end is further configured to establish a long connection between the middleware baton end and the middleware server end, and send the encrypted express data to the middleware server end through the long connection. The technical scheme has the beneficial effects that when the first gun is verified to be legal, long connection can be established for subsequent express data transmission, and data transmission efficiency is improved.
In some alternative embodiments, the middleware baton end or the middleware server end is further configured to perform heartbeat detection that a time interval between the middleware baton end and the middleware server end is T, and if a receiving party in the middleware baton end and the middleware server end does not receive a heartbeat packet within the T time interval, disconnect the long connection between the middleware baton end and the middleware server end. The technical scheme has the beneficial effects that the heartbeat detection is carried out on the long connection, if the heartbeat packet is not received at the time-out time, the connection is disconnected, and legal verification is required to be carried out again when the data uploading is carried out by using the bar gun, so that the data uploading by forging the bar gun is prevented.
In some optional embodiments, the middleware baton end is further configured to send the express data to the middleware server end using WebSocket technology protocol. The technical scheme has the advantages that according to the requirements of safety and communication performance, the WebSocket technical protocol is adopted to conduct data information interaction of both parties, the WebSocket is bidirectional, the full duplex protocol is used in the scene of communication between the middleware baton end and the middleware server end, the connection between the middleware baton end and the middleware server end is kept in an active state until the connection is terminated by any party (the middleware baton end or the middleware server end), and after the connection is closed by any party of the middleware baton end and the middleware server end, the connection is terminated from both ends.
In some optional embodiments, the middleware baton end is further configured to detect whether an upgrade is required, if so, upgrade is performed, and if not, the express data sent by the first baton is received and sent to the middleware server end.
In a third aspect, the present application provides an electronic device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of any of the methods described above.
Drawings
The present application is further described below with reference to the drawings and examples.
Fig. 1 is a schematic flow chart of a method for transmitting express data based on middleware according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a method for automatically upgrading a gun end of a middleware according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a method for transmitting express data based on middleware according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a method for transmitting express data based on middleware according to an embodiment of the present application;
Fig. 5 is a schematic flow chart of an express data transmission method of a middleware gun end provided in an embodiment of the present application;
FIG. 6 is a schematic diagram of a middleware according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a program product for implementing a middleware-based express data transmission method according to an embodiment of the present application.
Detailed Description
The present application will be further described with reference to the drawings and detailed description, which should be understood that, on the premise of no conflict, the following embodiments or technical features may be arbitrarily combined to form new embodiments.
Referring to fig. 1, an embodiment of the present application provides an express data transmission method based on middleware, where the middleware includes a middleware gun end installed on each gun and a middleware server end installed on a server, and the method includes steps S101 to S111. The middleware baton end and the middleware server end can be Applications (APP) installed on the baton or the server, can be webpages or applets accessed by the baton and the server, and can also be processes running on the baton or the server.
Step S101: and the middleware gun end respectively generates a unique identifier of each gun and sends the unique identifier to the middleware server end. Specifically, step S101 may include: the middleware gun end respectively reads the equipment code, the MAC address and the CPU serial number of each gun, and respectively generates a unique identifier of each gun according to the read equipment code, MAC address and CPU serial number of each gun and sends the unique identifier to the middleware server end. The device code is a built-in code of the gun device, is a self-contained identification of the device, and generally does not change. The MAC address is used to identify the local area network address of the gun device, which is the device's own identity. The CPU serial number is used for confirming the processor number of the gun equipment and is the self-contained identification of the equipment. Therefore, the unique identifier is used for verifying the data information of the data uploading equipment, ensuring that the data information is transmitted in legal equipment and equipment information cannot be forged, preventing large clients from forging the gun equipment and disturbing the normal operation of an express company. The large client refers to a large client of an express company, and is generally an online store or other clients with larger express delivery requirements.
In a specific implementation, step S101 may include: the middleware gun end respectively reads the equipment code, the MAC address and the CPU serial number of each gun, respectively generates a random number according to the read equipment code, the MAC address and the CPU serial number of each gun, generates a unique identifier of each gun by using an MD5 algorithm according to the random number corresponding to each gun, and sends the unique identifier to the middleware server end. That is, an MD5 digital signature of the gun device is generated by applying an MD5 algorithm as a unique identification of the gun device. Therefore, the unique identifier of each gun device is generated through the MD5 algorithm, and the method has the advantages of universality, stability and rapidness.
Step S102: and the middleware baton end respectively generates a private key and a public key of each baton and sends the public key of each baton to the middleware server end. The private key and the public key of each baton form a key pair, the key pair is respectively saved in half at a middleware baton end and a middleware server end, the private key is saved at the middleware baton end, the public key is saved at the middleware server end, that is, the public key list of all baton devices of the express network is saved at the middleware server end.
Specifically, step S102 may include: the middleware baton end reads the equipment code, the MAC address, the IP address and the time stamp of each baton respectively, generates a private key and a public key of each baton respectively according to the read equipment code, the MAC address, the IP address and the time stamp of each baton, and sends the public key of each baton to the middleware server end. An IP address is a logical address that can mask differences in physical addresses. The timestamp can confirm the actual generation time of the private key, public key pair.
In a specific implementation, step S102 may include: the middleware baton end reads the equipment code, the MAC address, the IP address and the time stamp of each baton respectively, generates a random number according to the read equipment code, the MAC address, the IP address and the time stamp of each baton respectively, generates a private key and a public key of each baton according to the random number corresponding to each baton, and sends the public key of each baton to the middleware server end. The algorithm for generating the private key and the public key is, for example, an RSA algorithm or an SM2 algorithm.
Step S103: and the middleware bar gun receives a data uploading request sent by the first bar gun.
Step S104: and the middleware gun end generates the mark to be verified of the first gun in real time. Specifically, step S104 may include: and the middleware gun end reads the equipment code, the MAC address and the CPU serial number of the first gun and generates the identification to be verified of the first gun in real time according to the read equipment code, MAC address and CPU serial number of the first gun.
Step S105: and the middleware bar gun end encrypts the identification to be verified by using the private key of the first bar gun.
Step S106: and the middleware gun end sends the encrypted identification to be verified to the middleware server end.
Step S107: and the middleware server decrypts the encrypted identification to be verified by using the public key of the first baton. If the public key of the first baton stored in the middleware server is matched with the private key used for encrypting the data, the decryption is successful, otherwise, the decryption is unsuccessful.
Step S108: if the decryption is successful, the middleware server detects whether the unique identification consistent with the identification to be verified exists in all the unique identifications. The middleware server stores the unique identifiers of all legal gun devices, so that if the unique identifiers consistent with the identifier to be verified exist, the first gun is proved to be legal, and if the unique identifiers are not exist, the first gun is proved to be illegal, and the possibility of forging exists.
In some alternative embodiments, with continued reference to fig. 1, the method may further include step S112: if the decryption is unsuccessful, the middleware server marks the encrypted identification to be verified as abnormal data, and prompts the middleware gun end that the first gun is illegal. When the decryption is unsuccessful, the public key stored in the middleware server is not matched with the private key of the encrypted data of the middleware gun end, and the possibility of forging gun equipment exists. For abnormal data, an alarm mechanism can be triggered to prompt personnel of an express company to strengthen audit investigation.
Step S109: if so, the middleware server side prompts the middleware gun side that the first gun is legal.
In some alternative embodiments, with continued reference to fig. 1, the method may further include step S113: if the first bar gun is not legal, the middleware server marks the mark to be verified as abnormal data, and prompts the middleware bar gun end that the first bar gun is illegal. If the unique identifier which is consistent with the identifier to be verified of the first gun does not exist in the unique identifier stored in the middleware server side, the first gun is not in the legal gun equipment, and the possibility of forging the gun equipment exists.
Step S110: and the middleware baton end receives the express data sent by the first baton and sends the express data to the middleware server end. All scanning acquisition equipment (such as the gun equipment of an express delivery network) sequentially call the middleware gun end to upload data, and each application equipment calls the middleware gun end or the middleware server end when uploading and downloading data.
Specifically, step S110 may include: the middleware baton end receives the express data sent by the first baton, encrypts the express data by using the private key of the first baton, and sends the encrypted express data to the middleware server end.
In some alternative embodiments, referring to FIG. 2, step S110 may include steps S1101-S1104.
Step S1101: and detecting whether the intermediate piece gun end needs to be upgraded or not.
Step S1102: if the middleware gun end needs to be upgraded, the middleware gun end is upgraded. In a specific implementation, if the upgrade is successful, the middleware gun end may be initialized.
Step S1103: if the updating is not needed, the middleware baton end receives the express data sent by the first baton and sends the express data to the middleware server end.
Therefore, the middleware has the characteristics of easy use and expandability, and can be automatically updated on line after the new version is released.
Step S111: and the middleware server side stores the express data to the server. Specifically, step S111 may include: the middleware server decrypts the encrypted express data by using the public key of the first baton; and if the decryption is successful, storing the express data to the server. Therefore, secure transmission of express data between the middleware baton end and the middleware server end is ensured through private key encryption and public key decryption.
In some alternative embodiments, the method may further comprise: and the middleware server side carries out log record on the data sent by the middleware gun side.
According to the embodiment of the application, the unique identifiers and public keys of all legal baton equipment are stored in the middleware server, when the baton equipment is used for uploading data, whether the baton equipment is legal or not is verified by comparing the real-time generated identifier to be verified with the unique identifiers, data safety transmission between the middleware baton end and the middleware server end is ensured by encrypting the private keys and decrypting the public keys, data interaction is not directly carried out between the baton and the server, but is carried out in a mode of calling the middleware, thereby the functions of legal authentication and express data safety transmission of the baton equipment are provided, the fact that the allied provider network point in a supply chain uses unauthorized baton equipment for uploading express data and illegally obtaining benefits is avoided, a safe and effective data environment is provided for an express company data warehouse, and the middleware is used as a bottom layer integration technology of the baton equipment and the data transmission, so that good cooperation relations of large clients, network point companies and express companies are ensured.
Referring to fig. 3, the embodiment of the application further provides a middleware-based express data transmission method, which includes steps S201 to S203.
Step S201: and the gun end of the middleware carries out gun registration. The method comprises the steps that a middleware gun end generates a unique identifier of a gun, a private key and a public key pair of the gun, the unique identifier of the gun is sent to a middleware server end to be registered, and the public key of the gun is sent to the middleware server end to be stored.
Step S202: and the intermediate gun end performs validity verification on the gun for uploading data. Specifically, the middleware gun end generates an identification to be verified in real time, encrypts the identification by using a private key and then sends the identification to the middleware server end, the middleware server end decrypts the identification by using a public key, if the identification is decrypted successfully, whether a unique identification consistent with the identification to be verified exists is detected, and if the unique identification consistent with the identification to be verified exists, the middleware gun end is prompted that the gun is legal equipment.
Step S203: and for the baton equipment passing the validity verification, establishing long connection through a middleware baton end and a middleware server end, and uploading express data from the baton to the server. The middleware gun end can send the express data to the middleware server end by using a WebSocket technical protocol.
Referring to fig. 4, the embodiment of the application further provides a middleware-based express data transmission method, which includes steps S301 to S306.
Step S301: the middleware gun end reads the equipment code, the MAC address and the CPU serial number of the gun in real time.
Step S302: and the middleware gun end generates a dynamic random number according to the read equipment code, the MAC address and the CPU serial number.
Step S303: and the middleware gun end generates a dynamic signature according to the random number, namely the mark to be verified of the gun.
Step S304: the middleware bar gun end encrypts the uploaded data (the mark to be verified at the moment).
Step S305: and uploading the encrypted data by the middleware gun end.
Step S306: the middleware server verifies whether unique identifiers consistent with the identifier to be verified exist in the stored unique identifiers of all legal baton guns; if the data is available, the middleware gun end is prompted that the gun is legal equipment, and subsequent data uploading can be performed. And the middleware gun end encrypts the express data during uploading, and the middleware server end decrypts and stores the express data.
Referring to fig. 5, the embodiment of the application further provides a method for transmitting express data of the middleware gun end, and the method includes steps S401 to S415.
Step S401: the user clicks on the middleware gun endpoint.
Step S402: and initializing the gun end of the middleware.
Step S403: the middleware gun end detects whether the gun is registered, namely, whether the mark to be verified is generated in real time, if so, the step S406 is executed, otherwise, the step S404 is executed.
Step S404: and the middleware gun end starts to register, namely, the mark to be verified is generated in real time, and the step S405 is executed.
Step S405: the middleware gun end detects whether the registration is successful, and if so, step S406 is executed.
Step S406: the middleware gun end starts to log in, namely performs validity verification, and executes step S407.
Step S407: the middleware gun end detects whether the login is successful, and if so, step S408 is executed.
Step S408: the middleware gun end starts to detect the upgrade.
Step S409: the middleware gun end detects whether the upgrade is needed, if so, the step S410 is executed, otherwise, the step S412 is executed.
Step S410: the middleware gun end starts to upgrade, and step S411 is performed.
Step S411: the middleware gun end is successfully upgraded, and step S402 is executed.
Step S412: the middleware gun end login is completed, and step S413 is performed.
Step S413: and uploading data by the middleware gun end.
Step S414: the middleware gun end detects whether the uploading is successful, and if so, step S415 is executed.
Step S415: and (5) ending.
Referring to fig. 6, the embodiment of the present application further provides a middleware including a middleware gun end 101 installed on each gun and a middleware server end 102 installed on a server.
The middleware baton end 101 is configured to generate a unique identifier of each baton and send the unique identifier to the middleware server end 102, generate a private key and a public key of each baton and send the public key of each baton to the middleware server end 102; and receiving a data uploading request sent by a first barker, generating a to-be-verified identifier of the first barker in real time, encrypting the to-be-verified identifier by using a private key of the first barker, and sending the encrypted to-be-verified identifier to the middleware server side 102.
The middleware server 102 is configured to decrypt the encrypted identifier to be verified by using the public key of the first baton; if decryption is successful, detecting whether unique identifiers consistent with the identifier to be verified exist in all the unique identifiers; if so, the middleware gun end 101 is prompted that the first gun is legal.
The middleware baton end 101 is further configured to receive the express data sent by the first baton and send the express data to the middleware server end 102.
The middleware server 102 is further configured to store the express data to the server.
In some optional embodiments, the middleware baton end 101 may be further configured to read the device code, the MAC address and the CPU serial number of each baton, and generate, according to the read device code, the MAC address and the CPU serial number of each baton, a unique identifier of each baton and send the unique identifier to the middleware server end 102; the middleware baton end 101 may be further configured to respectively read the device code, the MAC address, the IP address and the timestamp of each baton, respectively generate a private key and a public key of each baton according to the read device code, MAC address, IP address and timestamp of each baton, and send the public key of each baton to the middleware server end 102; the middleware baton end 101 may be further configured to read the equipment code, the MAC address and the CPU serial number of the first baton, and generate, in real time, the identifier to be verified of the first baton according to the read equipment code, the MAC address and the CPU serial number of the first baton.
In some optional embodiments, the middleware server 102 may be further configured to mark the encrypted identifier to be verified as abnormal class data if decryption is unsuccessful, and prompt the middleware gun end 101 that the first gun is illegal.
In some optional embodiments, the middleware server 102 may be further configured to mark the identifier to be verified as abnormal class data if the identifier does not exist, and prompt that the first baton is illegal at the middleware baton end 101.
In some optional embodiments, the middleware baton end 101 may be further configured to receive the express data sent by the first baton, encrypt the express data using a private key of the first baton, and send the encrypted express data to the middleware server end 102; the middleware server 102 is further configured to decrypt the encrypted express data by using the public key of the first baton; and if the decryption is successful, storing the express data to the server.
In some alternative embodiments, the middleware baton end 101 may be further configured to establish a long connection between the middleware baton end 101 and the middleware server end 102, and send the encrypted express data to the middleware server end 102 through the long connection. When the first gun is verified to be legal, long connection can be established for subsequent express data transmission, and data transmission efficiency is improved.
In some alternative embodiments, the middleware baton end 101 or the middleware server end 102 may be further configured to perform heartbeat detection that the time interval between the middleware baton end 101 and the middleware server end 102 is T, and disconnect the long connection between the middleware baton end 101 and the middleware server end 102 if a packet receiving party in the middleware baton end 101 and the middleware server end 102 does not receive a heartbeat packet within the T time interval. Wherein T is, for example, 2 minutes, 3 minutes or 10 minutes. Therefore, heartbeat detection is carried out on the long connection, if no heartbeat packet is received after timeout, the connection is disconnected, and legal verification is needed to be carried out again when the data uploading is carried out by using the bar gun, so that the data uploading by forging the bar gun is prevented.
In some alternative embodiments, the middleware bar gun terminal 101 is further configured to send the express data to the middleware server terminal 102 using WebSocket technology protocol. According to the requirements of safety and communication performance, the WebSocket technical protocol is adopted to conduct data information interaction between two parties, the WebSocket is bidirectional, a full duplex protocol is used in the scene of communication between the middleware baton end 101 and the middleware server end 102, the connection between the middleware baton end 101 and the middleware server end 102 is kept in an active state until the connection is terminated by any party (the middleware baton end 101 or the middleware server end 102), and after the connection is closed by any party of the middleware baton end 101 and the middleware server end 102, the connection is terminated from two ends.
Referring to fig. 7, an embodiment of the present application also provides an electronic device 200, the electronic device 200 comprising at least one memory 210, at least one processor 220, and a bus 230 connecting the different platform systems.
Memory 210 may include readable media in the form of volatile memory, such as Random Access Memory (RAM) 211 and/or cache memory 212, and may further include Read Only Memory (ROM) 213.
The memory 210 further stores a computer program, which may be executed by the processor 220, so that the processor 220 executes the steps of the middleware-based express data transmission method in the embodiment of the present application (as shown in fig. 1). Memory 210 may also include a program/utility 214 having a set (at least one) of program modules 215 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Accordingly, the processor 220 may execute the computer programs described above, as well as the program/utility 214.
Bus 230 may be a local bus representing one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or using any of a variety of bus architectures.
The electronic device 200 may also communicate with one or more external devices 240, such as a keyboard, pointing device, bluetooth device, etc., as well as one or more devices capable of interacting with the electronic device 200 and/or with any device (e.g., router, modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 250. Also, the electronic device 200 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through a network adapter 260. Network adapter 260 may communicate with other modules of electronic device 200 via bus 230. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 200, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, data backup storage platforms, and the like.
The embodiment of the application also provides a computer readable storage medium, which is used for storing a computer program, and the computer program is executed to implement the steps of the express delivery data transmission method based on the middleware in the embodiment of the application (as shown in fig. 1). Fig. 8 shows a program product 300 provided by the present embodiment for implementing the above method, which may employ a portable compact disc read-only memory (CD-ROM) and comprise program code, and may be run on a terminal device, such as a personal computer. However, the program product 300 of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Program product 300 may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing. Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The present application describes functional improvements and usage elements that are emphasized by the patent laws, and the above description and drawings are merely preferred embodiments of the present application and not limiting the present application, and therefore, all structures, devices, features, etc. that are similar and identical to those of the present application, i.e. all equivalents and modifications made by the patent application are intended to be within the scope of protection of the patent application of the present application.

Claims (10)

1. The express data transmission method based on the middleware is characterized in that the middleware comprises a middleware gun end installed on each gun and a middleware server end installed on a server, and the method comprises the following steps:
the middleware gun end respectively generates a unique identifier of each gun and sends the unique identifier to the middleware server end, and respectively generates a private key and a public key of each gun and sends the public key of each gun to the middleware server end; receiving a data uploading request sent by a first barker, generating a to-be-verified identifier of the first barker in real time, encrypting the to-be-verified identifier by using a private key of the first barker, and sending the encrypted to-be-verified identifier to the middleware server;
The middleware server decrypts the encrypted identification to be verified by using the public key of the first baton; if decryption is successful, detecting whether unique identifiers consistent with the identifier to be verified exist in all the unique identifiers; if so, prompting that the first gun at the gun end of the middleware is legal;
the middleware baton end receives express data sent by the first baton and sends the express data to the middleware server end;
and the middleware server side stores the express data to the server.
2. The method for transmitting express data based on middleware according to claim 1, wherein the middleware baton end generates a unique identifier of each baton and sends the unique identifier to the middleware server end, generates a private key and a public key of each baton and sends the public key of each baton to the middleware server end, respectively, and includes:
the middleware gun end respectively reads the equipment code, the MAC address and the CPU serial number of each gun, respectively generates a unique identifier of each gun according to the read equipment code, MAC address and CPU serial number of each gun and sends the unique identifier to the middleware server end;
The middleware baton end respectively reads the equipment code, the MAC address, the IP address and the time stamp of each baton, respectively generates a private key and a public key of each baton according to the read equipment code, the MAC address, the IP address and the time stamp of each baton, and sends the public key of each baton to the middleware server end;
the real-time generation of the identification to be verified of the first gun comprises the following steps:
and the middleware gun end reads the equipment code, the MAC address and the CPU serial number of the first gun and generates the identification to be verified of the first gun in real time according to the read equipment code, MAC address and CPU serial number of the first gun.
3. The middleware-based express data transmission method according to claim 1, wherein the middleware gun end receives express data sent by the first gun and sends the express data to the middleware server end, and the method comprises the following steps:
the middleware baton end receives the express data sent by the first baton, encrypts the express data by using a private key of the first baton, and sends the encrypted express data to the middleware server end;
The middleware server side stores the express data to the server, and the method comprises the following steps:
the middleware server decrypts the encrypted express data by using the public key of the first baton; and if the decryption is successful, storing the express data to the server.
4. The middleware-based express data transmission method according to claim 1, further comprising:
if the decryption is unsuccessful, the middleware server marks the encrypted identification to be verified as abnormal data, and prompts the middleware gun end that the first gun is illegal.
5. The middleware-based express data transmission method according to claim 1, further comprising:
if the first bar gun is not legal, the middleware server marks the mark to be verified as abnormal data, and prompts the middleware bar gun end that the first bar gun is illegal.
6. The middleware-based express data transmission method according to claim 1, wherein the middleware gun end receives express data sent by the first gun and sends the express data to the middleware server end, and the method comprises the following steps:
And the middleware baton end detects whether the updating is needed, if so, the updating is carried out, and if not, the express data sent by the first baton is received and sent to the middleware server end.
7. A middleware, characterized in that the middleware comprises a middleware gun end installed on each gun and a middleware server end installed on a server;
the middleware gun end is configured to generate a unique identifier of each gun and send the unique identifier to the middleware server end, generate a private key and a public key of each gun and send the public key of each gun to the middleware server end; receiving a data uploading request sent by a first barker, generating a to-be-verified identifier of the first barker in real time, encrypting the to-be-verified identifier by using a private key of the first barker, and sending the encrypted to-be-verified identifier to the middleware server;
the middleware server side is configured to decrypt the encrypted identifier to be verified by using the public key of the first baton; if decryption is successful, detecting whether unique identifiers consistent with the identifier to be verified exist in all the unique identifiers; if so, prompting that the first gun at the gun end of the middleware is legal;
The middleware baton end is further configured to receive express data sent by the first baton and send the express data to the middleware server end;
the middleware server side is further configured to store the express data to the server.
8. The middleware of claim 7, wherein the middleware baton end is further configured to receive the express data sent by the first baton, encrypt the express data using a private key of the first baton, and send the encrypted express data to the middleware server end;
the middleware server side is further configured to decrypt the encrypted express data by using the public key of the first baton; and if the decryption is successful, storing the express data to the server.
9. The middleware of claim 8, wherein the middleware baton end is further configured to establish a long connection between the middleware baton end and the middleware server end, and send the encrypted express data to the middleware server end through the long connection.
10. The middleware of claim 9, wherein the middleware baton end or the middleware server end is further configured to perform heartbeat detection that a time interval between the middleware baton end and the middleware server end is T, and disconnect the long connection between the middleware baton end and the middleware server end if a heartbeat packet is not received by a receiving party in the middleware baton end and the middleware server end within the T time interval.
CN202011258980.7A 2020-11-12 2020-11-12 Express data transmission method based on middleware and middleware Active CN112468544B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011258980.7A CN112468544B (en) 2020-11-12 2020-11-12 Express data transmission method based on middleware and middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011258980.7A CN112468544B (en) 2020-11-12 2020-11-12 Express data transmission method based on middleware and middleware

Publications (2)

Publication Number Publication Date
CN112468544A CN112468544A (en) 2021-03-09
CN112468544B true CN112468544B (en) 2024-02-27

Family

ID=74825059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011258980.7A Active CN112468544B (en) 2020-11-12 2020-11-12 Express data transmission method based on middleware and middleware

Country Status (1)

Country Link
CN (1) CN112468544B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023876A (en) * 2012-11-22 2013-04-03 中国科学院声学研究所 Network terminal, security certification and registration activation methods thereof and server
CN104735065A (en) * 2015-03-16 2015-06-24 联想(北京)有限公司 Data processing method, electronic device and server
CN108989325A (en) * 2018-08-03 2018-12-11 华数传媒网络有限公司 Encryption communication method, apparatus and system
CN111181723A (en) * 2019-09-09 2020-05-19 腾讯科技(深圳)有限公司 Method and device for offline security authentication between Internet of things devices
CN111614619A (en) * 2020-04-17 2020-09-01 深圳市芯链科技有限公司 Block chain code scanning input method, code scanning gun and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070074027A1 (en) * 2005-09-26 2007-03-29 Tien-Chun Tung Methods of verifying, signing, encrypting, and decrypting data and file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023876A (en) * 2012-11-22 2013-04-03 中国科学院声学研究所 Network terminal, security certification and registration activation methods thereof and server
CN104735065A (en) * 2015-03-16 2015-06-24 联想(北京)有限公司 Data processing method, electronic device and server
CN108989325A (en) * 2018-08-03 2018-12-11 华数传媒网络有限公司 Encryption communication method, apparatus and system
CN111181723A (en) * 2019-09-09 2020-05-19 腾讯科技(深圳)有限公司 Method and device for offline security authentication between Internet of things devices
CN111614619A (en) * 2020-04-17 2020-09-01 深圳市芯链科技有限公司 Block chain code scanning input method, code scanning gun and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
适合物联网环境的混合双向匿名认证协议;汪礼臻;张龙军;;计算机应用研究(01);全文 *

Also Published As

Publication number Publication date
CN112468544A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
US8612773B2 (en) Method and system for software installation
US11258792B2 (en) Method, device, system for authenticating an accessing terminal by server, server and computer readable storage medium
CN101258505B (en) Secure software updates
CN110519309B (en) Data transmission method, device, terminal, server and storage medium
US8874922B2 (en) Systems and methods for multi-layered authentication/verification of trusted platform updates
CN103095457A (en) Login and verification method for application program
EP2095288B1 (en) Method for the secure storing of program state data in an electronic device
CN105207774A (en) Key negotiation method and device of verification information
JP2015532054A (en) Secure app ecosystem with key and data exchange according to corporate information management policy
CN104412273A (en) Method and system for activation
CN112039826B (en) Login method and device applied to applet end, electronic equipment and readable medium
CN111130798B (en) Request authentication method and related equipment
CN111131416A (en) Business service providing method and device, storage medium and electronic device
CN105516135A (en) Method and device used for account login
CN111614686B (en) Key management method, controller and system
US20110154436A1 (en) Provider Management Methods and Systems for a Portable Device Running Android Platform
CN112765626A (en) Authorization signature method, device and system based on escrow key and storage medium
CN113553572A (en) Resource information acquisition method and device, computer equipment and storage medium
CN104463584A (en) Method for achieving mobile terminal App safety payment
CN112865965B (en) Train service data processing method and system based on quantum key
CN101057447B (en) Method and device for re-dispatching specifically coded access objects from a server to a mobile terminal device
CN115473655B (en) Terminal authentication method, device and storage medium for access network
JP7079528B2 (en) Service provision system and service provision method
KR20100019165A (en) System and method for providing internet banking service
CN109842600B (en) Method for realizing mobile office, terminal equipment and MDM equipment

Legal Events

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