Data message transmission method and device
By including service fingerprints in the data packet and matching them with the fingerprint library, the service priority is determined, and the router cannot identify data packets without standard port numbers is solved, improving network transmission performance and QoS effect.
Patent Information
- Application Number
- CN202010248690.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-01
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-04-01
AI Technical Summary
When a router realizes quality of service (QoS), it cannot identify data packets carrying non-standard port numbers, resulting in the inability to determine its service type and forwarding service method, affecting network transmission performance.
By including the client's service fingerprint in the message header of the data packet and matching it with the fingerprint library, the service priority is determined, and then forwarding is carried out. The method includes receiving data packets, identifying the packet header to obtain fingerprints, matching with the fingerprint library, determining service priority, and forwarding data packets based on priority.
It realizes rational network resource allocation for various service data packets, improves network transmission performance, and ensures that high-priority services are not affected by delays when network congestion is achieved.
Smart Images

Figure CN113497762B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of communication technology and blockchain technology, and in particular to a data message transmission method, device, electronic device and storage medium. Background Art
[0002] In the related art, when a router implements the Quality of Service (QoS) effect, it usually determines how to forward services by the destination port number carried in the data message. For example, when the router recognizes that the five-tuple information carried in the received data message includes TCP port 80, it directly determines that the data message is web page service traffic, and thus adopts the corresponding forwarding service mode for web page services. However, in actual applications, since some clients use private protocols for data message transmission, the port is generally an unconventional port number (i.e., the port number>1024); in this case, the router cannot identify which type of service traffic the received data message belongs to, and it is even more impossible to determine which forwarding service to adopt to achieve the QOS effect on the router. Summary of the invention
[0003] The embodiments of the present invention provide a data message transmission method, device, electronic device and storage medium, which can allocate reasonable network resources to data messages of various services and improve network transmission performance.
[0004] The technical solution of the embodiment of the present invention is achieved as follows:
[0005] An embodiment of the present invention provides a method for transmitting a data message, comprising:
[0006] Receive a data message sent by a client, wherein the message header of the data message includes a fingerprint for indicating a service corresponding to the client;
[0007] Identify the message header of the data message to obtain the fingerprint;
[0008] Matching the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result;
[0009] Based on the matching result, determining the service priority corresponding to the data message;
[0010] The data message is forwarded based on the service priority corresponding to the data message.
[0011] The embodiment of the present invention further provides a data message transmission device, comprising:
[0012] A receiving module, used for receiving a data message sent by a client, wherein the message header of the data message includes a fingerprint indicating a service corresponding to the client;
[0013] An identification module, used to identify the message header of the data message to obtain the fingerprint;
[0014] A matching module, used to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result;
[0015] A determination module, used to determine the service priority corresponding to the data message based on the matching result;
[0016] A forwarding module is used to forward the data message based on the service priority corresponding to the data message.
[0017] In the above solution, the identification module is also used to identify the message header of the data message;
[0018] The target offset bit data of the message header is read to determine that the content carried by the target field in the message header is the fingerprint.
[0019] In the above scheme, the determination module is further used to determine that the service priority corresponding to the data message is a high priority when the matching result indicates that there is a fingerprint in the fingerprint library that matches the fingerprint of the service corresponding to the client;
[0020] Correspondingly, the forwarding module is also used to preferentially forward the data messages corresponding to the high priority.
[0021] In the above scheme, the determination module is further used to determine that the service priority corresponding to the data message is a low priority when the matching result indicates that there is no fingerprint matching the fingerprint of the service corresponding to the client in the fingerprint library;
[0022] Correspondingly, the forwarding module is further used to add the data message to a first-in-first-out forwarding buffer queue;
[0023] The data message is forwarded according to the order of the data message in the forwarding buffer queue.
[0024] In the above scheme, the forwarding module is also used to obtain the five-tuple information of the data message;
[0025] Extract the destination port number and destination IP address from the five-tuple information;
[0026] The data message is forwarded based on the extracted destination port number and destination IP address.
[0027] In the above solution, the device further comprises:
[0028] An update module, used to periodically obtain fingerprints of each service from the cloud server;
[0029] The fingerprint database is updated based on the acquired fingerprints of the services.
[0030] In the above solution, the matching module is further used to send a fingerprint matching request corresponding to the data message to the cloud server;
[0031] The fingerprint matching request is used by the cloud server to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result;
[0032] Receive the matching result returned by the cloud server.
[0033] In the above solution, the receiving module is further used to receive the data message obtained after the client performs protocol filling on the fingerprint based on the message protocol format;
[0034] The fingerprint is obtained by performing hash processing on at least one of a service identifier of the service and a destination IP address of the data message by the client.
[0035] In the above scheme, the update module is also used to generate and send a transaction for obtaining the fingerprint of each business in the blockchain network;
[0036] Receiving fingerprints of each business returned by the blockchain network based on the transaction;
[0037] The fingerprint database is updated based on the returned fingerprints of the services.
[0038] An embodiment of the present invention further provides an electronic device, including:
[0039] A memory for storing executable instructions;
[0040] The processor is used to implement the data message transmission method provided by the embodiment of the present invention when executing the executable instructions stored in the memory.
[0041] An embodiment of the present invention further provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implements the data message transmission method provided by the embodiment of the present invention.
[0042] The embodiments of the present invention have the following beneficial effects:
[0043] By identifying the received data message, a fingerprint indicating the service corresponding to the client sending the data message is obtained, the fingerprint of the data message is matched with each fingerprint in the fingerprint library respectively to obtain a matching result, and the service priority corresponding to the data message is determined based on the matching result, and then the data message is forwarded based on the service priority corresponding to the data message; here, the fingerprint of the data message is used to indicate the service corresponding to the client, and in the process of fingerprint matching, the service type of the data message and the service priority corresponding to the data message can be determined, so that the data message is forwarded based on the service priority, so that reasonable network resources can be allocated to data messages of various services, thereby improving network transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of an implementation scenario of the data message transmission method provided by an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0046] Figure 3 It is a flow chart of a data message transmission method provided by an embodiment of the present invention;
[0047] Figure 4 This is a schematic diagram of the application architecture of the blockchain network provided by an embodiment of the present invention;
[0048] Figure 5 It is a schematic diagram of the structure of a blockchain in a blockchain network 400 provided in an embodiment of the present invention;
[0049] Figure 6 It is a functional architecture diagram of the blockchain network 400 provided in an embodiment of the present invention;
[0050] Figure 7 It is a flow chart of a data message transmission method provided by an embodiment of the present invention;
[0051] Figure 8 It is a structural schematic diagram of a data message transmission device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0053] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0054] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.
[0055] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0057] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0058] 1) Signature, also known as digital signature, is a string of numbers that can only be generated by the sender of the information and cannot be forged by others. It is also an effective proof of the authenticity of the information sent by the sender. Digital signatures usually define two complementary operations, one for signing and the other for verification. It is the application of asymmetric key encryption technology and digital summary technology.
[0059] 2) Transaction, which is equivalent to the computer term "transaction". Transaction includes operations that need to be submitted to the blockchain network for execution, and does not refer only to transactions in a business context. In view of the conventional use of the term "transaction" in blockchain technology, the embodiments of the present invention follow this convention.
[0060] For example, the Deploy transaction is used to install the specified smart contract to the nodes in the blockchain network and prepare it to be called; the Invoke transaction is used to append transaction records to the blockchain by calling the smart contract and perform operations on the blockchain's state database, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e. querying key-value pairs in the state database).
[0061] 3) Blockchain is an encrypted, chained transaction storage structure formed by blocks.
[0062] 4) Blockchain Network: A collection of nodes that incorporate new blocks into the blockchain through consensus.
[0063] 5) Ledger is a general term for blockchain (also called ledger data) and the state database synchronized with the blockchain. The blockchain records transactions in the form of files in the file system; the state database records transactions in the blockchain in the form of different types of key-value pairs, which is used to support fast query of transactions in the blockchain.
[0064] 6) Smart Contracts, also known as chaincode or application code, are programs deployed in the nodes of the blockchain network. The nodes execute the smart contracts called in the received transactions to update or query the key-value data in the state database.
[0065] 7) Consensus is a process in the blockchain network used to reach agreement on transactions in a block among multiple nodes involved. The agreed blocks will be appended to the end of the blockchain. The mechanisms for achieving consensus include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.
[0066] 8) Quintuple information: is a communication term, usually referring to a set of five quantities: source IP address, source port, destination IP address, destination port and transport layer protocol.
[0067] 9) Quality of Service (QoS): refers to a network's ability to use various basic technologies to provide better service capabilities for specified network communications. It is a network security mechanism and a technology used to solve problems such as network delays and congestion. Under normal circumstances, if the network is only used for specific time-independent application systems, QoS is not required, such as Web applications or E-mail settings. However, it is very necessary for critical applications and multimedia applications. When the network is overloaded or congested, QoS can ensure that important business volumes are not delayed or discarded, while ensuring the efficient operation of the network.
[0068] 10) Data message is the data unit exchanged and transmitted in the network, that is, the data block that a station wants to send at one time, mainly in protocol format.
[0069] Based on the above explanations of the nouns and terms involved in the embodiments of the present invention, the following describes an implementation scenario of the data message transmission method provided by the embodiments of the present invention. Figure 1 , Figure 1 It is a schematic diagram of an implementation scenario of the data message transmission method provided in an embodiment of the present invention. To support an exemplary application, a terminal (such as terminal 200-1, which is provided with a client) transmits data messages with a server 100 (a server corresponding to the client) through a router 300. The router 300 obtains the fingerprint of the service corresponding to each client from the cloud server 400 to update and maintain the local fingerprint library.
[0070] A terminal (such as terminal 200-1), used to send a data message containing a fingerprint indicating a service corresponding to the client;
[0071] The router 300 is used to receive a data message sent by a client; identify a message header of the data message to obtain a fingerprint; match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result; determine a service priority corresponding to the data message based on the matching result; and forward the data message based on the service priority corresponding to the data message;
[0072] The server 100 is used to receive data packets forwarded by the router.
[0073] In actual applications, the server 100 can be a single server configured to support various services, or can be configured as a server cluster; the terminal (such as terminal 200-1) can be various types of user terminals such as smart phones, tablet computers, laptop computers, etc., and can also be wearable computing devices, personal digital assistants (PDAs), desktop computers, cellular phones, media players, navigation devices, game consoles, televisions, or a combination of any two or more of these data processing devices or other data processing devices.
[0074] The hardware structure of the electronic device of the data message transmission method provided by the embodiment of the present invention is described in detail below. The electronic device includes but is not limited to a server or a terminal. Figure 2 , Figure 2 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, Figure 2The electronic device 200 shown includes: at least one processor 210, a memory 250, at least one network interface 220 and a user interface 230. The various components in the electronic device 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2 Various buses are labeled as bus system 240 .
[0075] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0076] The user interface 230 includes one or more output devices 231 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0077] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.
[0078] The memory 250 includes a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiment of the present invention is intended to include any suitable type of memory.
[0079] In some embodiments, memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0080] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0081] A network communication module 252, used to reach other computing devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB);
[0082] a presentation module 253 for enabling presentation of information via one or more output devices 231 (e.g., display screen, speaker, etc.) associated with the user interface 230 (e.g., a user interface for operating peripherals and displaying content and information);
[0083] The input processing module 254 is used to detect one or more user inputs or interactions from one of the one or more input devices 232 and translate the detected inputs or interactions.
[0084] In some embodiments, the data message transmission device provided in the embodiments of the present invention can be implemented in a software manner. Figure 2 A transmission device 255 for data packets stored in the memory 250 is shown, which can be software in the form of programs and plug-ins, including the following software modules: a receiving module 2551, an identification module 2552, a matching module 2553, a determination module 2554 and a forwarding module 2555. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.
[0085] In other embodiments, the data message transmission device provided by the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the data message transmission device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the data message transmission method provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0086] Based on the above description of the implementation scenario and electronic device of the data message transmission method of the embodiment of the present invention, the data message transmission method provided by the embodiment of the present invention is described below. Figure 3, Figure 3 1 is a flow chart of a method for transmitting a data message provided by an embodiment of the present invention. The method for transmitting a data message provided by an embodiment of the present invention includes:
[0087] Step 301: The router receives a data message sent by the client.
[0088] Here, the message header of the data message includes a fingerprint for indicating the service corresponding to the client.
[0089] In actual applications, the router receives data packets sent by the client, which can be a mobile game client, an instant messaging client, etc. When the client needs to transmit data with the corresponding server, it needs to send a data packet to the corresponding router first. Here, the server corresponding to the client refers to the background server that provides data support for the client, such as the mobile game server corresponding to the mobile game client that sends the data packet.
[0090] In actual implementation, the router receives a data message obtained after the client fills the fingerprint with the protocol based on the message protocol format; wherein the fingerprint is obtained by hashing at least one of the service identifier of the service by the client and the destination IP address of the data message.
[0091] In actual applications, different service clients are assigned their own corresponding service identifiers, which are used to indicate the services supported by the corresponding clients, such as the service identifier of XX competitive mobile games, the service identifier of XX shooting mobile games, etc. In order to make the data message sent by the client contain the identifier (i.e., fingerprint) used to indicate the service corresponding to the client, the client performs hash processing on the service identifier of the client and at least one of the destination IP address of the data message through a hash algorithm to obtain the fingerprint corresponding to the data message.
[0092] After obtaining the fingerprint corresponding to the data message, the client fills the fingerprint with the protocol based on the message protocol format so that the fingerprint is included in the sent data message. Specifically, it is necessary to set the message protocol format of the data message, and reserve the target byte (such as 4 bytes or 8 bytes) of the protocol header field in the protocol header of the message protocol as a reserved field to fill the fingerprint corresponding to the data message. After the client obtains the fingerprint corresponding to the data message based on the hash algorithm, the obtained fingerprint is filled in the reserved field of the protocol header based on the set message protocol format. Exemplarily, in the application layer protocol header of the mobile game client and the mobile game server communication, an 8-byte protocol header field is reserved as a reserved field. When the fingerprint of the data message of the mobile game client is obtained, the fingerprint is filled in the position of the 8-byte protocol header reserved field.
[0093] After obtaining the data message containing the fingerprint, the client sends the data message to the router; thus, the router receives the data message containing the fingerprint indicating the service corresponding to the client.
[0094] Step 302: Identify the message header of the data message to obtain a fingerprint.
[0095] After receiving the data message, the router identifies the message header of the data message. In some embodiments, the message header of the data message can be identified in the following manner: identifying the message header of the data message; reading the target offset bit data of the message header to determine that the content carried by the target field in the message header is a fingerprint.
[0096] In actual applications, the router can directly identify the message header of the received data message; then read the data of the target offset bit of the message header, such as reading the data of the 8-byte offset bit, and determine that the content carried by the target field in the message header is the fingerprint of the data message.
[0097] Step 303: Match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result.
[0098] In actual applications, the router obtains the fingerprint of the service corresponding to each client from the cloud server to maintain the local fingerprint library. Here, the cloud server can be a fingerprint server deployed in the computer room, which locally stores the service identifier of the supported service and the IP address of the server corresponding to the client of the supported service; illustratively, the supported service is XX mobile game service, then the cloud server stores the service identifier of XX mobile game service and the IP address of the mobile game server of XX mobile game service. The cloud server uses the same hash algorithm as the client to hash the service identifier of the service corresponding to each client and the IP address of the server corresponding to the client, obtains the fingerprint of the service corresponding to each client and saves it to form a cloud fingerprint library.
[0099] In some embodiments, the fingerprint library may be updated in the following manner: periodically obtaining the fingerprint of each service from the cloud server; and updating the fingerprint library based on the obtained fingerprint of each service.
[0100] In actual applications, the router updates and maintains the local fingerprint database by periodically acquiring the fingerprint of each service to ensure the completeness and accuracy of the fingerprint database.
[0101] Based on this, after the router identifies the fingerprint of the data message, it matches the fingerprint of the data message with each fingerprint contained in the fingerprint library to obtain a matching result.
[0102] In some embodiments, the matching result may also be obtained in the following manner: sending a fingerprint matching request corresponding to the data message to a cloud server; and receiving the matching result returned by the cloud server.
[0103] Here, the fingerprint matching request is used for the cloud server to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result.
[0104] In actual applications, in addition to completing fingerprint matching alone to obtain matching results, the router can also complete it in collaboration with the cloud server. Specifically, the router sends a fingerprint matching request corresponding to the data message to the cloud server; after receiving the fingerprint matching request, the cloud server matches the fingerprint of the data message with each fingerprint contained in the fingerprint library to obtain a matching result, and then returns the obtained matching result to the router; the router receives the matching result returned by the cloud server.
[0105] Step 304: Based on the matching result, determine the service priority corresponding to the data message.
[0106] Step 305: Forward the data message based on the service priority corresponding to the data message.
[0107] In some embodiments, the service priority corresponding to the data message can be determined in the following manner: when the matching result indicates that there is a fingerprint in the fingerprint library that matches the fingerprint of the service corresponding to the client, the service priority corresponding to the data message is determined to be a high priority; when the matching result indicates that there is no fingerprint in the fingerprint library that matches the fingerprint of the service corresponding to the client, the service priority corresponding to the data message is determined to be a low priority.
[0108] Here, high-priority services have higher requirements on the transmission time limit of data packets, such as mobile games. Low-priority services refer to services that have no time limit on the transmission of data packets, such as Web applications and E-mail settings.
[0109] In some embodiments, based on the service priority corresponding to the data message, the data message may be forwarded in the following manner: when it is determined that the service priority corresponding to the data message is high priority, the data message corresponding to the high priority is forwarded first. When it is determined that the service priority corresponding to the data message is low priority, the data message is added to a first-in-first-out forwarding buffer queue; and the data message is forwarded according to the order of the data message in the forwarding buffer queue.
[0110] Here, the router gives priority to forwarding high-priority data packets to ensure that the data packets of high-priority services are not affected by network delays when the network is congested. When it is determined that the service priority corresponding to the data packet is low priority, the data packet is forwarded according to the normal priority. Specifically, the corresponding low-priority data packet is added to the first-in-first-out forwarding buffer queue. When it is determined that the corresponding high-priority data packet is forwarded, the data packet is forwarded according to the order of the low-priority data packet in the forwarding buffer queue.
[0111] In some embodiments, the data message may be forwarded in the following manner: obtaining five-tuple information of the data message; extracting the destination port number and the destination IP address in the five-tuple information; and forwarding the data message based on the extracted destination port number and the destination IP address.
[0112] In actual applications, when forwarding a data message, the router needs to obtain the five-tuple information corresponding to the data message; according to the destination port number and destination IP address extracted from the five-tuple information, the data message is forwarded to achieve accurate transmission of the client's data message.
[0113] By applying the above-mentioned embodiment of the present invention, a fingerprint for indicating the service corresponding to the client that sends the data message is obtained by identifying the received data message, and the fingerprint of the data message is matched with each fingerprint in the fingerprint library respectively to obtain a matching result, and the service priority corresponding to the data message is determined based on the matching result, and then the data message is forwarded based on the service priority corresponding to the data message; here, the fingerprint of the data message is used to indicate the service corresponding to the client, and in the process of fingerprint matching, the service type of the data message and the service priority corresponding to the data message can be determined, so that the data message is forwarded based on the service priority, so that reasonable network resources can be allocated to data messages of various services, thereby improving network transmission performance.
[0114] In some embodiments, blockchain technology can also be combined to store the fingerprints generated by the cloud server for each client's business in the blockchain network, so that when the router updates the fingerprint library based on the fingerprints of each business obtained, the fingerprints of each business can be directly obtained from the blockchain network.
[0115] Here, after the cloud server generates a fingerprint for the business of each client, it generates a transaction for storing the fingerprint and sends the generated transaction to the node of the blockchain network so that the node can store the fingerprint in the blockchain network after reaching a consensus on the transaction; before storing it in the blockchain network, the cloud server can also obtain the summary information of the key corresponding to the fingerprint; and store the obtained summary information of the key in the blockchain network.
[0116] Next, the blockchain network in the embodiment of the present invention is described. Figure 4The application architecture diagram of the blockchain network provided for the embodiment of the present invention includes a blockchain network 400 (consensus nodes 410-1 to consensus nodes 410-3 are shown as an example), an authentication center 500, and a business entity 600, which are described below respectively.
[0117] The types of blockchain network 400 are flexible and diverse, for example, it can be any one of public chain, private chain or alliance chain. Taking the public chain as an example, any electronic device (such as terminal / server) of any business subject can access the blockchain network 400 without authorization; taking the alliance chain as an example, the electronic devices under the jurisdiction of the business subject can access the blockchain network 400 after obtaining authorization. In this way, it becomes a client node in the blockchain network 400.
[0118] In some embodiments, the client node can only be used as an observer of the blockchain network 400, that is, to provide support for business entities to initiate transactions (for example, for storing data on the chain or querying data on the chain). For the functions of the consensus node 410 of the blockchain network 400, such as sorting function, consensus service and account book function, the client node can implement them by default or selectively (for example, depending on the specific business needs of the business entity). Thus, the data and business processing logic of the business entity can be migrated to the blockchain network 400 to the greatest extent, and the credibility and traceability of the data and business processing process can be achieved through the blockchain network 400.
[0119] The consensus nodes in the blockchain network 400 receive transactions submitted by client nodes (such as client node 610 belonging to business entity 600) from different business entities (such as business entity 600), execute transactions to update the ledger or query the ledger, and various intermediate results or final results of the executed transactions can be returned to the client node of the business entity for display.
[0120] The following is an example of a business entity accessing a blockchain network to obtain fingerprints for each business to illustrate an exemplary application of blockchain.
[0121] See also Figure 4The business subject 600 involved in the data message transmission method registers with the authentication center 500 to obtain a digital certificate. The digital certificate includes the public key of the business subject and the digital signature signed by the authentication center 500 on the public key and identity information of the business subject, which is used to attach to the transaction together with the digital signature of the business subject for the transaction, and is sent to the blockchain network for the blockchain network to take out the digital certificate and signature from the transaction, verify the reliability of the message (i.e., whether it has not been tampered with) and the identity information of the business subject who sent the message. The blockchain network will verify based on the identity, such as whether it has the authority to initiate a transaction. The client running on the electronic device (such as a terminal or server) under the jurisdiction of the business subject can request access to the blockchain network 400 and become a client node.
[0122] First, when the client node 610 of the business entity 600 obtains the fingerprint generated for each business of the client, it generates a transaction for obtaining the fingerprint stored in the blockchain. The transaction specifies the smart contract that needs to be called to implement the fingerprint acquisition operation of each business, and the parameters passed to the smart contract. The transaction also carries the digital certificate of the client node 610, the signed digital signature (for example, the summary of the transaction is encrypted using the private key in the digital certificate of the client node 610), and broadcasts the transaction to the consensus node in the blockchain network 400.
[0123] Then, when the consensus node 410 of the blockchain network 400 receives the transaction, it verifies the digital certificate and digital signature carried in the transaction. After successful verification, it confirms whether the business subject 600 has the transaction authority based on the identity of the business subject 600 carried in the transaction. Any verification judgment in the digital signature and authority verification will cause the transaction to fail. After successful verification, the consensus node 410 signs its own digital signature (for example, using the private key of node 410-1 to encrypt the summary of the transaction) and continues to broadcast in the blockchain network 400.
[0124] Finally, after receiving the successfully verified transaction, the consensus node 410 in the blockchain network 400 fills the transaction into a new block and broadcasts it. When broadcasting a new block, the consensus node 410 in the blockchain network 400 will perform a consensus process on the new block. If the consensus is successful, the new block will be appended to the end of the blockchain stored by itself, and the state database will be updated according to the result of the transaction, and the transaction in the new block will be executed: for the submitted transaction to obtain the fingerprint of each business, the key-value pair corresponding to the fingerprint of each business will be queried from the state database, and the transaction result will be returned.
[0125] As an example of blockchain, see Figure 5 , Figure 5It is a structural diagram of the blockchain in the blockchain network 400 provided in an embodiment of the present invention. The header of each block can include the hash value of all transactions in the block, and also includes the hash value of all transactions in the previous block. The newly generated transaction records are filled into the block and after the consensus of the nodes in the blockchain network, they will be appended to the end of the blockchain to form a chain growth. The chain structure based on hash values between blocks ensures the anti-tampering and anti-counterfeiting of transactions in the block.
[0126] The following describes an exemplary functional architecture of a blockchain network provided by an embodiment of the present invention. Figure 6 , Figure 6 It is a functional architecture diagram of the blockchain network 400 provided in an embodiment of the present invention, including an application layer 1, a consensus layer 2, a network layer 3, a data layer 4 and a resource layer 5, which are described below respectively.
[0127] The resource layer 5 encapsulates the computing resources, storage resources, and communication resources of each node 410 in the blockchain network 400.
[0128] Data layer 4 encapsulates various data structures that implement the ledger, including blockchain implemented as files in the file system, key-value state databases, and existence proofs (such as hash trees of transactions in blocks).
[0129] Network layer 3 encapsulates the functions of point-to-point (P2P) network protocol, data transmission mechanism and data verification mechanism, access authentication mechanism and business subject identity management.
[0130] Among them, the P2P network protocol realizes the communication between the nodes 410 in the blockchain network 400, the data propagation mechanism ensures the propagation of transactions in the blockchain network 400, and the data verification mechanism is used to realize the reliability of data transmission between the nodes 410 based on cryptographic methods (such as digital certificates, digital signatures, public / private key pairs); the access authentication mechanism is used to authenticate the identity of the business subject joining the blockchain network 400 according to the actual business scenario, and grant the business subject the right to access the blockchain network 400 when the authentication is passed; the business subject identity management is used to store the identity of the business subject allowed to access the blockchain network 400, and the authority (such as the type of transaction that can be initiated).
[0131] The consensus layer 2 encapsulates the mechanism (i.e., consensus mechanism) for the nodes 410 in the blockchain network 400 to reach a consensus on the blocks, transaction management, and account management functions. The consensus mechanism includes consensus algorithms such as POS, POW, and DPOS, and supports pluggable consensus algorithms.
[0132] Transaction management is used to verify the digital signature carried in the transaction received by the verification node 410, verify the identity information of the business subject, and determine whether it has the authority to conduct transactions based on the identity information (read relevant information from the business subject identity management); for business subjects that have obtained authorization to access the blockchain network 400, they all have digital certificates issued by the certification center. The business subject uses the private key in its own digital certificate to sign the submitted transaction, thereby declaring its legal identity.
[0133] Ledger management is used to maintain the blockchain and state database. For the blocks that have reached consensus, they are appended to the end of the blockchain; the transactions in the blocks that have reached consensus are executed, and when the transaction includes an update operation, the key-value pairs in the state database are updated; when the transaction includes a query operation, the key-value pairs in the state database are queried and the query results are returned to the client node of the business subject. Supports query operations on the state database in multiple dimensions, including: querying blocks based on block serial numbers (such as transaction hash values); querying blocks based on block hash values; querying blocks based on transaction serial numbers; querying transactions based on transaction serial numbers; querying business subject account data based on business subject account numbers (serial numbers); querying blockchains in channels based on channel names.
[0134] Application layer 1 encapsulates various services that can be implemented in the blockchain network, including transaction traceability, evidence storage, and verification.
[0135] Next, taking the example of a router receiving and forwarding a data packet sent by a mobile game client, the data packet transmission method provided by an embodiment of the present invention is further explained. In the related art, when a router implements a QOS effect, it usually determines how to perform a forwarding service by the destination port number carried in the data packet. For example, when the router recognizes that the five-tuple information carried in the received data packet includes a TCP80 port, it directly determines that the data packet is a web page service flow, and thus adopts a corresponding forwarding service method for web page services. However, in actual applications, since the data packet transmission of clients such as mobile games adopts a private protocol, the port is generally an unconventional port number (i.e., the port number>1024); in this case, the router cannot identify which type of service flow the received data packet belongs to, and it is even more impossible to implement a QOS effect on the router for clients such as mobile games.
[0136] Based on this, an embodiment of the present invention provides a method for transmitting a data message, see Figure 7 , Figure 7 1 is a flow chart of a method for transmitting a data message provided by an embodiment of the present invention. The method for transmitting a data message provided by an embodiment of the present invention includes:
[0137] Step 701: The client performs hash processing on the service identifier and the destination IP address of the data message to be sent to obtain a fingerprint corresponding to the data message to be sent.
[0138] Here, in actual application, the terminal is provided with a client, such as a mobile game client. Different service clients are assigned corresponding service identifiers, which are used to indicate the services supported by the corresponding client, such as the service identifier of XX competitive mobile game, the service identifier of XX shooting mobile game, etc. The service identifier is stored in a local configuration file, and the service identifier can be obtained during the client initialization process.
[0139] In order to make the data message sent by the client carry an identifier indicating the service corresponding to the client, in actual applications, the service identifier of the client and the destination IP address of the data message to be sent can be hashed through a hash algorithm to obtain a fingerprint corresponding to the data message to be sent.
[0140] Step 702: Based on the message protocol format, the fingerprint is filled with the protocol to obtain a data message containing the fingerprint for indicating the service corresponding to the client.
[0141] In practical applications, it is necessary to set the message protocol format for the data message. For example, a protocol header field of target bytes (such as 4 bytes or 8 bytes) can be reserved in the protocol header of the message protocol as a reserved field to fill in the fingerprint corresponding to the data message. For example, in the application layer protocol header of the mobile game client and the mobile game server, a protocol header field of 8 bytes is reserved as a reserved field to fill in the fingerprint corresponding to the data message sent by the mobile game client.
[0142] After the client obtains the fingerprint corresponding to the data message based on the hash algorithm, the client fills the obtained fingerprint in the reserved field based on the set message protocol format to obtain a data message containing a fingerprint indicating the service corresponding to the client. Exemplarily, the obtained fingerprint can be filled in the message header of the data message transmitted at the application layer.
[0143] Step 703: Send the data message filled with the fingerprint to the router.
[0144] Step 704: the router receives the data message, identifies the message header of the data message, and reads the target offset data of the message header to determine the fingerprint contained in the message header.
[0145] In actual applications, after the router is started, it is initialized and periodically obtains the fingerprint of the service corresponding to each client from the cloud server, so as to maintain and update the local fingerprint library based on the obtained fingerprint.
[0146] Here, the cloud server can be a fingerprint server deployed in the computer room, which locally stores the business identifier of the business corresponding to the client and the IP address of the business server corresponding to the client; for example, if the supported business is XX mobile game business, then the cloud server stores the business identifier of XX mobile game business and the IP address of the mobile game server of XX mobile game business. The cloud server uses the same hash algorithm as the client to hash the business identifier of the business corresponding to each client and the IP address of the business server corresponding to the client, obtains the fingerprint of the business corresponding to each client and saves it to form a cloud fingerprint library. Then, in the logic that the router obtains regularly, the fingerprint of each business is directly sent to the router as a configuration file, so that the router updates and maintains the local fingerprint library.
[0147] After receiving the data message sent by the client, the router identifies the message header of the data message, reads the data of the target offset bit of the message header, such as reading the data of the 8-byte offset bit, and determines the fingerprint contained in the data message.
[0148] Step 705: Match the fingerprint with each fingerprint in the fingerprint database to obtain a matching result.
[0149] Step 706: When the matching result indicates that there is a fingerprint in the fingerprint database that matches the fingerprint of the service corresponding to the client, it is determined that the service priority corresponding to the data message is a high priority.
[0150] When the fingerprint of the data message successfully matches the fingerprint in the fingerprint library, the service priority corresponding to the data message is determined to be high priority. Here, high-priority services have higher requirements for the transmission time limit of data messages. For example, mobile game services are high-priority services. In order to ensure that the gaming experience of mobile game users is not affected by network delays and congestion, when it is determined that the fingerprint of the data message matches the fingerprint of the mobile game service, the service priority of the data message is determined to be high priority.
[0151] Step 707: When the service priority corresponding to the data message is high, the data message is forwarded preferentially.
[0152] Here, the router preferentially forwards high-priority data packets to ensure that the data packets of high-priority services are not affected by network delays when the network is congested.
[0153] Step 708: When the matching result indicates that there is no fingerprint in the fingerprint database that matches the fingerprint of the service corresponding to the client, it is determined that the service priority corresponding to the data message is a low priority.
[0154] When the fingerprint of the data message fails to match the fingerprint in the fingerprint database, the service priority corresponding to the data message is determined as a low priority.
[0155] Step 709: When the service priority corresponding to the data message is low priority, the data message is added to a first-in-first-out forwarding buffer queue; and the data message is forwarded according to the order in which the data message is located in the forwarding buffer queue.
[0156] Here, when it is determined that the service priority corresponding to the data message is low priority, the data message is forwarded according to the normal priority. Specifically, the corresponding low priority data message is added to the first-in-first-out forwarding buffer queue, and when it is determined that the corresponding high priority data message is forwarded, the data message is forwarded according to the order of the low priority data message in the forwarding buffer queue.
[0157] In actual applications, when forwarding a data message, the router needs to obtain the five-tuple information corresponding to the data message, and forward the data message according to the destination port number and the destination IP address extracted from the five-tuple information.
[0158] Step 710: The server receives the client data message forwarded by the router.
[0159] Here, the server is a background server corresponding to the client that sends the data message, such as a mobile game server corresponding to the data message sent by the mobile game client.
[0160] By applying the above embodiment, by filling the protocol fingerprint in the data message to identify the service type corresponding to the client sending the data message, the router matches the fingerprint of the data message and the fingerprint in the fingerprint library, and when the match is successful, the data message is forwarded preferentially. Since the fingerprint of the data message can identify the corresponding service type, the router can quickly determine the service type of the received data message based on the fingerprint library, and then determine the service priority corresponding to the data message, so as to ensure the priority forwarding of data messages of high-priority services, reduce the impact of network congestion on the transmission of data messages of high-priority services, and thus achieve the QOS effect on the router for business traffic such as mobile games.
[0161] The following is a description of the data message transmission device 255 provided in the embodiment of the present invention. In some embodiments, the data message transmission device can be implemented in the form of a software module. Figure 8 , Figure 8 2 is a schematic diagram of the structure of a data message transmission device 255 provided in an embodiment of the present invention. The data message transmission device 255 provided in an embodiment of the present invention includes:
[0162] The receiving module 2551 is used to receive a data message sent by a client, wherein the message header of the data message includes a fingerprint indicating a service corresponding to the client;
[0163] An identification module 2552, configured to identify the message header of the data message to obtain the fingerprint;
[0164] The matching module 2553 is used to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result;
[0165] A determination module 2554, configured to determine a service priority corresponding to the data message based on the matching result;
[0166] The forwarding module 2555 is used to forward the data message based on the service priority corresponding to the data message.
[0167] In some embodiments, the identification module 2552 is further used to identify the message header of the data message;
[0168] The target offset bit data of the message header is read to determine that the content carried by the target field in the message header is the fingerprint.
[0169] In some embodiments, the determination module 2554 is further configured to determine that the service priority corresponding to the data message is a high priority when the matching result indicates that there is a fingerprint in the fingerprint library that matches the fingerprint of the service corresponding to the client;
[0170] Correspondingly, the forwarding module 2555 is also used to preferentially forward the data messages corresponding to the high priority.
[0171] In some embodiments, the determination module 2554 is further configured to determine that the service priority corresponding to the data message is a low priority when the matching result indicates that there is no fingerprint matching the fingerprint of the service corresponding to the client in the fingerprint library;
[0172] Correspondingly, the forwarding module 2555 is also used to add the data message to a first-in-first-out forwarding buffer queue;
[0173] The data message is forwarded according to the order of the data message in the forwarding buffer queue.
[0174] In some embodiments, the forwarding module 2555 is further used to obtain the five-tuple information of the data message;
[0175] Extract the destination port number and destination IP address from the five-tuple information;
[0176] The data message is forwarded based on the extracted destination port number and destination IP address.
[0177] In some embodiments, the apparatus further comprises:
[0178] An update module, used to periodically obtain fingerprints of each service from the cloud server;
[0179] The fingerprint database is updated based on the acquired fingerprints of the services.
[0180] In some embodiments, the matching module 2553 is further used to send a fingerprint matching request corresponding to the data message to a cloud server;
[0181] The fingerprint matching request is used by the cloud server to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result;
[0182] Receive the matching result returned by the cloud server.
[0183] In some embodiments, the receiving module 2551 is further used to receive the data message obtained after the client performs protocol filling on the fingerprint based on the message protocol format;
[0184] The fingerprint is obtained by performing hash processing on at least one of a service identifier of the service and a destination IP address of the data message by the client.
[0185] In some embodiments, the update module is further used to generate and send a transaction for obtaining fingerprints of each business in the blockchain network;
[0186] Receiving fingerprints of each business returned by the blockchain network based on the transaction;
[0187] The fingerprint database is updated based on the returned fingerprints of the services.
[0188] An embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0189] A memory for storing executable instructions;
[0190] The processor is used to implement the data message transmission method provided by the embodiment of the present invention when executing the executable instructions stored in the memory.
[0191] An embodiment of the present invention further provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implements the data message transmission method provided by the embodiment of the present invention.
[0192] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.
[0193] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0194] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0195] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0196] The above description is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.
Claims
1. A method for transmitting a data message, characterized in that: Applied to a router, the method comprises: Receive a data message sent by a client, wherein the data message includes a fingerprint filled based on a message protocol format and used to indicate a service corresponding to the client, wherein the message protocol format indicates that a target field in a message header of the data message is used to fill in the fingerprint; The fingerprint is obtained by performing hash processing on at least one of the service identifier of the service and the destination Internet Protocol address of the data message by the client; Identify the message header of the data message, and read the data of the target offset bit of the message header to obtain the fingerprint filled in the target field; Matching the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result; Based on the matching result, determining the service priority corresponding to the data message; Based on the service priority corresponding to the data message, the data message is forwarded to the server corresponding to the client.
2. The method according to claim 1, characterized in that The determining, based on the matching result, the service priority corresponding to the data message includes: When the matching result indicates that there is a fingerprint in the fingerprint database that matches the fingerprint of the service corresponding to the client, determining that the service priority corresponding to the data message is a high priority; Accordingly, forwarding the data message to the server corresponding to the client based on the service priority corresponding to the data message includes: The data message corresponding to the high priority is preferentially forwarded to the server corresponding to the client.
3. The method according to claim 1, characterized in that The determining, based on the matching result, the service priority corresponding to the data message includes: When the matching result indicates that there is no fingerprint in the fingerprint database that matches the fingerprint of the service corresponding to the client, determining that the service priority corresponding to the data message is a low priority; Accordingly, forwarding the data message to the server corresponding to the client based on the service priority corresponding to the data message includes: Adding the data message to a first-in-first-out forwarding buffer queue; According to the order of the data message in the forwarding buffer queue, the data message is forwarded to the server corresponding to the client.
4. The method according to claim 1, characterized in that The forwarding the data message to the server corresponding to the client based on the service priority corresponding to the data message includes: Obtaining five-tuple information of the data message; Extract the destination port number and destination IP address from the five-tuple information; Based on the extracted destination port number and destination IP address, the data message is forwarded to the server corresponding to the client.
5. The method according to claim 1, characterized in that The method further comprises: Periodically obtain the fingerprint of each business from the cloud server; The fingerprint database is updated based on the acquired fingerprints of the services.
6. The method according to claim 1, characterized in that The fingerprint is matched with each fingerprint contained in the fingerprint library to obtain a matching result, including: Sending a fingerprint matching request corresponding to the data message to a cloud server; The fingerprint matching request is used by the cloud server to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result; Receive the matching result returned by the cloud server.
7. The method according to claim 1, characterized in that the method further comprises: Generate and send transactions for obtaining fingerprints of each business in the blockchain network; Receiving fingerprints of each business returned by the blockchain network based on the transaction; The fingerprint database is updated based on the returned fingerprints of the services.
8. A data message transmission device, characterized in that: Applied to a router, the device comprises: A receiving module, used to receive a data message sent by a client, wherein the data message includes a fingerprint filled based on a message protocol format and used to indicate a service corresponding to the client, wherein the message protocol format indicates that a target field in a message header of the data message is used to fill in the fingerprint; The fingerprint is obtained by performing hash processing on at least one of the service identifier of the service and the destination Internet Protocol address of the data message by the client; An identification module, used for identifying a message header of the data message, and reading data of a target offset bit of the message header to obtain the fingerprint filled in the target field; A matching module, used to match the fingerprint with each fingerprint contained in the fingerprint library to obtain a matching result; A determination module, used to determine the service priority corresponding to the data message based on the matching result; A forwarding module is used to forward the data message to the server corresponding to the client based on the service priority corresponding to the data message.
9. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, configured to implement the data message transmission method according to any one of claims 1 to 7 when executing the executable instructions stored in the memory.
10. A computer-readable storage medium, characterized in that: Executable instructions are stored, and when the executable instructions are executed by a processor, the data message transmission method described in any one of claims 1 to 7 is implemented.
