Distributed cross-platform communication method and device, electronic equipment and storage medium
By obtaining the operating system type and connection information of the receiver node, establishing a communication connection based on the corresponding communication protocol, and allocating thread resources to each receiver node for encrypted data transmission, it solves the inconsistent protocol and low efficiency in the cross-platform communication method. , the problems of insufficient security and poor scalability have achieved efficient and secure data transmission and resource allocation.
Patent Information
- Application Number
- CN202411343215.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-17
AI Technical Summary
The existing cross-platform communication methods have problems such as inconsistent protocols, low communication efficiency, insufficient security, unreasonable thread resource allocation and poor scalability when dealing with different operating systems, especially in the high load environment of the graphics engine. User experience.
By obtaining the operating system type and connection information of the receiver node, a communication connection based on the corresponding communication protocol is established, and thread resources are allocated to each receiver node for data encryption transmission, and cross-platform operations are used to realize the dynamics of thread resources. Allocation and redistribution, record log information during communication.
It reduces development complexity and cost, improves communication compatibility, efficiency and security, supports more efficient data encryption transmission and scalability, and ensures reasonable allocation of thread resources and user experience.
Smart Images

Figure CN119155298A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed communication technology, and in particular to a distributed cross-platform communication method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of computer graphics and network communication technologies, graphics engines are playing an increasingly important role in the digital transformation of the steel industry. The efficient operation of graphics engines depends on stable and efficient data communication capabilities, especially in distributed systems, where communication between nodes is crucial for real-time rendering and data processing.
[0003] Existing communication methods face some problems when dealing with cross-platform data transmission. First, the communication protocols between different operating system platforms are not unified. For example, the Windows platform tends to use Input / Output Completion Ports (IOCP) as its network communication model, while the Linux platform usually uses Event Polling (Epoll) as the network communication mechanism. This difference causes the graphics engine to need to adapt to the communication mechanisms of different platforms during development, which increases the complexity and development cost of the system. Secondly, traditional communication methods often lack efficient data processing mechanisms, especially in data encryption, integrity verification, and error retransmission. This not only affects the efficiency of communication, but also reduces the security of data transmission. Under the high load environment of the graphics engine, rendering delays or data loss may occur, affecting the user experience. In addition, with the popularity of multi-core processors, how to make full use of multi-threading technology to improve communication performance while ensuring thread safety and reasonable resource allocation is also a problem that the existing technology needs to solve. When dealing with a large number of concurrent connections, the existing multi-threading model may encounter problems such as resource competition and frequent context switching, thereby affecting the overall communication performance. Finally, as the scale expands and production needs change, the communication system needs to have good later scalability and maintainability. The existing communication technology is not flexible and efficient enough in terms of expansion. The current communication solution of the graphics engine in the distributed system still has many shortcomings. There is an urgent need for a communication method that can solve the problems of platform differences, inefficient and unsafe communication, poor scalability, and unreasonable thread resource allocation. Summary of the invention
[0004] The present invention provides a distributed cross-platform communication method, device, electronic device and storage medium to solve the technical problems in the cross-platform communication process of the above-mentioned distributed system, such as inability to adapt to different platforms, low communication efficiency, low security, unreasonable thread resource allocation and poor scalability.
[0005] In one embodiment of the present application, the present application provides a distributed cross-platform communication method, including: obtaining the initial data of the sender node and the connection information of the central server, the connection information including the operating system type, address information and encryption public key of multiple receiving nodes; establishing a communication connection between the sender node and each receiving node according to the communication protocol corresponding to each address information and each operating system type; allocating sending thread resources to each receiving node, and encrypting the initial data and transmitting it to the corresponding receiving node according to the encryption public key and each sending thread resource.
[0006] In one embodiment of the present application, sending thread resources are allocated to each of the receiving nodes, including: establishing multiple sending task threads; allocating each of the sending task threads to a corresponding receiving node; if it is monitored that an allocated sending task thread is in an idle state, then reallocating the allocated sending task thread to another receiving node that needs sending thread resources.
[0007] In one embodiment of the present application, the initial data is encrypted and transmitted to the corresponding receiving node according to the encryption public key and the sending thread resources, including: reading the first data required by the receiving node in the initial data by the sending task thread; encrypting the first data according to the encryption public key by the sending task thread to obtain encrypted data to be sent; performing hash calculation on the encrypted data to be sent by the sending task thread to obtain a hash value to be sent; constructing the data to be sent based on the encrypted data to be sent and the hash value to be sent by the sending task thread, and sending it to the corresponding receiving node.
[0008] In one embodiment of the present application, establishing a communication connection between the sending node and each of the receiving nodes includes: establishing a communication connection between the sending node and each of the receiving nodes; if a communication connection is successfully established, recording the successful establishment information to a log system; if a communication connection fails to be established, recording the failed establishment information to a log system, and re-establishing the communication connection.
[0009] In one embodiment of the present application, the log system is used to record events of each client node during the communication process according to a preset format; the preset format includes occurrence time, occurrence node, occurrence event and event level.
[0010] In one embodiment of the present application, the present application provides a distributed cross-platform communication method, including: obtaining connection information and a decryption private key of a receiving node, and sending the connection information to a central server, so that multiple sending nodes can obtain the connection information through the central server, the connection information including an operating system type, address information and an encryption public key; establishing a communication connection between the receiving node and each of the sending nodes according to the communication protocol corresponding to the address information and the operating system type; receiving target data sent by each of the sending nodes, and allocating receiving thread resources to each of the sending nodes; performing integrity verification and decryption on each of the target data according to the decryption private key and each of the receiving thread resources, and storing all decrypted target data.
[0011] In one embodiment of the present application, integrity check and decryption are performed on each target data according to the decryption private key and the receiving thread resources, including: calculating the current hash value of the received encrypted data through the receiving thread resources; if the current hash value is the same as the received hash value, and the current length of the received encrypted data is the same as the received length, the integrity check is passed; if the current hash value is different from the received hash value, and / or the current length of the received encrypted data is different from the received length, the integrity check is not passed; if the integrity check is passed, the received encrypted data is decrypted by the receiving thread resources according to the decryption private key corresponding to the received encryption algorithm flag; if the integrity check is not passed, the preset data retransmission mechanism or the preset error handling process is triggered by the receiving thread resources; wherein, the target data includes the received encrypted data and the received hash value, the received length, and the received encryption algorithm flag corresponding to the received encrypted data.
[0012] In one embodiment of the present application, the present application provides a distributed cross-platform communication device, including: an acquisition module, used to obtain the initial data of the sender node and the connection information of the central server, the connection information including the operating system type, address information and encryption public key of multiple receiving nodes; a connection establishment module, used to establish a communication connection between the sender node and each receiving node according to the communication protocol corresponding to each address information and each operating system type; a data sending module, used to allocate sending thread resources to each receiving node, and encrypt and transmit the initial data to the corresponding receiving node according to the encryption public key and each sending thread resource.
[0013] In one embodiment of the present application, the present application provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the distributed cross-platform communication method as described in any of the above embodiments.
[0014] In one embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the distributed cross-platform communication method described in any of the above embodiments.
[0015] Beneficial effects of the embodiments of the present invention: The present invention provides a distributed cross-platform communication method, device, electronic device and storage medium. The embodiments of the present invention obtain the operating system type of each receiving node through a central server, and establish a communication connection through a corresponding communication protocol. The complexity of communication and development costs are reduced and compatibility is improved through cross-platform operations. By allocating corresponding thread resources to each receiving node to perform encrypted data transmission, the security of data transmission, communication efficiency and rationality of thread resource allocation are improved. Thread resource support can also be used to scalably provide data encryption transmission services for more receiving nodes and perform encrypted data transmission.
[0016] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0018] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0019] Figure 2 A schematic diagram of a distributed cross-platform communication method according to an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of a network topology of a distributed cross-platform communication method according to an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram showing the structure of data to be sent in a distributed cross-platform communication method according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of a distributed cross-platform communication method according to another embodiment of the present application is shown;
[0023] Figure 6A schematic diagram of an implementation process of a distributed cross-platform communication method according to an embodiment of the present application is shown;
[0024] Figure 7 A block diagram of a distributed cross-platform communication device according to an embodiment of the present application is shown;
[0025] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0027] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0028] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0029] See also Figure 1 , Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture may include a sender node 101, a central server 102, and a receiver node 103. There are multiple receiver nodes; the central server 102 is used to transmit the connection information of the receiver node 103 to the sender node 101, and to encrypt and transmit the initial data of the sender node 102 to the receiver node 103.
[0030] Exemplarily, the initial data of the sender node and the connection information of the central server are obtained, the connection information including the operating system types and task information of multiple receiving nodes; a communication connection is established between the sender node and each receiving node, the communication connection is established based on the communication protocol corresponding to each operating system type; at least one thread resource is allocated to each receiving node according to each task information, and the initial data is encrypted and transmitted to the corresponding receiving node according to the at least one thread resource.
[0031] In the related technologies, there are technical problems in the cross-platform communication process of distributed systems, such as inability to adapt to different platforms, low communication efficiency, low security, unreasonable thread resource allocation, and poor scalability.
[0032] In order to solve the above technical problems, the present application provides a distributed cross-platform communication method, device, electronic device and storage medium. The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below.
[0033] See also Figure 2 , Figure 2 FIG. 1 shows a flow chart of a distributed cross-platform communication method according to an embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the distributed cross-platform communication method includes at least steps S210 to S230, which are applied to the sending node and are described in detail as follows:
[0034] Step S210, obtaining the initial data of the sender node and the connection information of the central server.
[0035] The connection information includes the operating system type, address information and encryption public key of multiple receiving nodes.
[0036] In one embodiment of the present application, see Figure 3 , Figure 3 FIG. 1 is a schematic diagram showing a network topology of a distributed cross-platform communication method according to an embodiment of the present application. Figure 3 As shown, the network structure consists of a central server and client nodes. At least one client node can obtain the required connection information from the same central server, and each client node communicates with each other through the central server.
[0037] In one embodiment of the present application, each client node can be both a receiving node and a sending node corresponding to the data.
[0038] In one embodiment of the present application, one sending node may provide data sending services to multiple receiving nodes.
[0039] In one embodiment of the present application, a receiving node may establish a communication connection with only one sending node.
[0040] In one embodiment of the present application, the address information includes a network address and a port number.
[0041] In one embodiment of the present application, in the process of obtaining connection information of multiple receiving nodes stored in the central server, the accuracy of the information and the security of communication are ensured through a security authentication mechanism, and conversion into a recognizable format is performed to establish a foundation for subsequent communications.
[0042] In one embodiment of the present application, the distributed cross-platform communication method of the present application is applied to scenarios with large data transmission volume and high real-time requirements, such as graphics engines.
[0043] In one embodiment of the present application, the distributed cross-platform communication method of the present application can also be applied to scenarios with various types of data transmission volume and various types of real-time requirements.
[0044] Step S220: establishing a communication connection between the sender node and each receiver node according to each address information and the communication protocol corresponding to each operating system type.
[0045] In one embodiment of the present application, establishing a communication connection between a sending node and each receiving node includes: establishing a communication connection between the sending node and each receiving node; if a communication connection is successfully established, recording the successful establishment information to the system log; if a communication connection fails to be established, recording the failed establishment information to the system log, and re-establishing the communication connection.
[0046] In one embodiment of the present application, if the operating system type is a Windows operating system, the communication protocol is an Input / Output Completion Ports (IOCP) protocol; if the operating system type is a Linux operating system, the communication protocol is an event polling (Epoll).
[0047] In one embodiment of the present application, the present application can also handle compatibility issues between different protocols through a protocol adaptation layer to ensure smooth communication.
[0048] In one embodiment of the present application, the system log is used to record events of each client node during the communication process according to a preset format; the preset format includes occurrence time, occurrence node, occurrence event and event level.
[0049] Step S230, allocating a sending thread resource to each receiving node, and encrypting and transmitting the initial data to the corresponding receiving node according to the encryption public key and each sending thread resource.
[0050] In one embodiment of the present application, sending thread resources are allocated to each receiving node, including: establishing multiple sending task threads; allocating each sending task thread to a corresponding receiving node; if it is monitored that an allocated sending task thread is in an idle state, then reallocating an allocated sending task thread to another receiving node that needs sending thread resources.
[0051] In one embodiment of the present application, the initial data is encrypted and transmitted to the corresponding receiving node according to the encryption public key and the sending thread resources, including: reading the first data required by the receiving node in the initial data by the sending task thread; encrypting the first data according to the encryption public key by the sending task thread to obtain the encrypted data to be sent; performing hash calculation on the encrypted data to be sent by the sending task thread to obtain the hash value to be sent; constructing the data to be sent based on the encrypted data to be sent and the hash value to be sent by the sending task thread, and sending it to the corresponding receiving node.
[0052] In one embodiment of the application, the application utilizes the advantages of modern multi-core processors to create a separate sending task thread for each receiving node to realize parallel data processing. Each sending task thread is responsible for the reading, encryption, hash value (HASH) calculation and length encapsulation of the execution data. The encryption process is based on the encryption algorithm selected by the user, and the corresponding encryption public key is used to encrypt the data. In this way, data can be sent to the corresponding receiving node quickly and safely, and the burden of the main thread is reduced, and the response speed of the sending node is improved.
[0053] In one embodiment of the present application, the sending node sends the data to be sent to the central server, and the central server forwards the data to be sent to the receiving node.
[0054] In one embodiment of the present application, the sending node may directly send the data to be sent to the receiving node.
[0055] In one embodiment of the present application, see Figure 4 , Figure 4 FIG. 1 shows a schematic diagram of the structure of data to be sent in a distributed cross-platform communication method according to an embodiment of the present application. Figure 4As shown, the structure of the data to be sent includes the encrypted content, encryption algorithm flag, length value, HASH value, and Transmission Control Protocol (TCP) conventional request header content. Among them, the TCP conventional request header content includes but is not limited to the source port number, destination port number, sequence number, confirmation number, data offset, reserved bit, control bit, window size, checksum, urgent pointer, option bit, and padding bit; the HASH value is calculated based on the encrypted content; the length value is calculated based on the encrypted content; the encryption algorithm flag is used to characterize the encryption algorithm used when encrypting data.
[0056] See also Figure 5 , Figure 5 FIG. 2 shows a flow chart of a distributed cross-platform communication method according to another embodiment of the present application. Figure 5 As shown, in an exemplary embodiment, the distributed cross-platform communication method includes at least steps S510 to S540, which are applied to the receiving node and are described in detail as follows:
[0057] Step S510, obtaining connection information and a decryption private key of a receiving node, and sending the connection information to a central server, so that multiple sending nodes obtain the connection information through the central server.
[0058] The connection information includes the operating system type, address information and encryption public key.
[0059] In one embodiment of the present application, one receiving node may provide data receiving services for multiple sending nodes.
[0060] In one embodiment of the present application, a sending node may establish a communication connection with only one receiving node.
[0061] Step S520: establishing a communication connection between the receiving node and each sending node according to the communication protocol corresponding to the address information and the operating system type.
[0062] Step S530, receiving target data sent by each sending node, and allocating receiving thread resources to each sending node.
[0063] Step S540: perform integrity check and decryption on each target data according to the decryption private key and each receiving thread resource, and store all the decrypted target data.
[0064] In one embodiment of the present application, each target data is integrity checked and decrypted according to a decryption private key and a receiving thread resource, including: calculating a current hash value of the received encrypted data through the receiving thread resource; if the current hash value is the same as the received hash value, and the current length of the received encrypted data is the same as the received length, the integrity check is passed; if the current hash value is different from the received hash value, and / or the current length of the received encrypted data is different from the received length, the integrity check is not passed; if the integrity check is passed, the received encrypted data is decrypted according to the decryption private key corresponding to the received encryption algorithm flag through the receiving thread resource; if the integrity check is not passed, the preset data retransmission mechanism or the preset error handling process is triggered through the receiving thread resource; wherein, the target data includes the received encrypted data and the received hash value, received length, and received encryption algorithm flag corresponding to the received encrypted data.
[0065] In one embodiment of the present application, the receiving end HASH value corresponding to the data packet is calculated by a verification algorithm, and the receiving end HASH value is compared with the sending end HASH value to see if they are consistent, and then the length of the encrypted content is compared to see if they are consistent, thereby achieving integrity verification. If the integrity verification fails, a retransmission mechanism or error handling process will be triggered to ensure the accuracy and reliability of the data.
[0066] In one embodiment of the present application, according to the received encryption algorithm flag in the request, the corresponding decryption algorithm and decryption private key are selected for decryption to obtain the original data. After decryption, the original data is written to the specified memory address or persistent storage medium according to the preset storage strategy.
[0067] In one embodiment of the present application, the present application tracks all key operations and events through a log system, including but not limited to the establishment of communication connections, data transmission, integrity verification, decryption operations, and any system-level warnings or errors. The log information includes the start and end time of each communication session, the amount of data transmitted, the identification information of the participating transceiver nodes, and a description of the communication status.
[0068] In one embodiment of the present application, see Figure 6 , Figure 6 FIG. 1 shows a schematic diagram of an implementation process of a distributed cross-platform communication method according to an embodiment of the present application. Figure 6As shown, the sender node obtains the necessary connection information from the central server at startup, and after matching the corresponding communication protocol, it establishes a communication connection with multiple receiving nodes; using multi-threading technology, the sender node creates a separate sub-thread for each receiving node, reads, encrypts, calculates the hash value and length of the initial information in the local memory, and encapsulates the above content in the request header and sends it; after receiving the message, the receiving node can perform data integrity verification, data decryption operations, and data storage through the assigned sub-thread. In addition, each key step integrates the logging function to ensure that all communication activities have detailed log records for monitoring, troubleshooting and system maintenance. This application not only improves communication efficiency, but also enhances the security of data transmission, and supports cross-platform operations, providing an efficient and reliable communication solution for the graphics engine, and effectively solving the efficiency and security problems existing in traditional communication methods.
[0069] See also Figure 7 , Figure 7 A block diagram of a distributed cross-platform communication device according to an embodiment of the present application is shown. The device can be applied to Figure 1 The implementation environment shown is specifically configured in the sender node 101. The device may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0070] like Figure 7 As shown, a distributed cross-platform communication device 700 according to an embodiment of the present application includes: an acquisition module 701 , a connection establishment module 702 and a data sending module 703 .
[0071] The acquisition module 701 is used to acquire the initial data of the sender node and the connection information of the central server, where the connection information includes the operating system type, address information and encryption public key of multiple receiver nodes;
[0072] A connection establishment module 702, used to establish a communication connection between the sender node and each receiver node according to each address information and the communication protocol corresponding to each operating system type;
[0073] The data sending module 703 is used to allocate sending thread resources to each receiving node, and encrypt and transmit the initial data to the corresponding receiving node according to the encryption public key and each sending thread resource.
[0074] It should be noted that the distributed cross-platform communication device provided in the above embodiment and the distributed cross-platform communication method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the distributed cross-platform communication device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0075] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the distributed cross-platform communication method provided in the above-mentioned embodiments.
[0076] See also Figure 8 , Figure 8 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0077] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0078] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0079] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.
[0080] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0081] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0082] The units involved in the embodiments described in the present application can be implemented by software or by hardware, and the units described can also be set in a processor. Among them, the names of these units do not constitute a limitation on the units themselves under certain circumstances. Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.
[0083] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, enables the computer to execute the distributed cross-platform communication method provided in each of the above embodiments. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being assembled into the electronic device.
[0084] In the above embodiments, unless otherwise specified, by using serial numbers such as "first" and "second" to describe common objects, it only means that they refer to different instances of the same object, rather than indicating that the objects being described must adopt a given order, whether in time, space, sorting or any other way.
[0085] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A distributed cross-platform communication method, It is characterized in that The method comprises: Acquire the initial data of the sender node and the connection information of the central server, wherein the connection information includes the operating system type, address information and encryption public key of multiple receiver nodes; Establishing a communication connection between the sender node and each of the receiver nodes according to the communication protocols corresponding to each of the address information and each of the operating system types; A sending thread resource is allocated to each of the receiving nodes, and the initial data is encrypted and transmitted to the corresponding receiving node according to the encryption public key and each of the sending thread resources.
2. The distributed cross-platform communication method according to claim 1, It is characterized in that Allocating sending thread resources to each of the receiving nodes includes: Establish multiple sending task threads; Allocate each of the sending task threads to a corresponding receiving node; If it is monitored that an allocated sending task thread is in an idle state, the allocated sending task thread is reallocated to another receiving node that needs sending thread resources.
3. The distributed cross-platform communication method according to claim 2, It is characterized in that The method further comprises: encrypting and transmitting the initial data to a corresponding receiving node according to the encryption public key and the sending thread resource, comprising: Reading the first data required by the receiving node in the initial data through the sending task thread; Encrypting the first data according to the encryption public key through the sending task thread to obtain encrypted data to be sent; Performing hash calculation on the encrypted data to be sent by the sending task thread to obtain a hash value to be sent; The sending task thread constructs the data to be sent based on the encrypted data to be sent and the hash value to be sent, and sends it to the corresponding receiving node.
4. The distributed cross-platform communication method according to any one of claims 1 to 3, It is characterized in that Establishing a communication connection between the sender node and each of the receiver nodes includes: Establishing a communication connection between the sender node and each of the receiver nodes; If a communication connection is successfully established, the successful establishment information is recorded in the log system; If a communication connection fails to be established, the establishment failure information will be recorded in the log system, and the communication connection will be re-established.
5. The distributed cross-platform communication method according to claim 4, It is characterized in that The log system is used to record the events of each client node during the communication process according to a preset format; The preset format includes occurrence time, occurrence node, occurrence event and event level.
6. A distributed cross-platform communication method, It is characterized in that The method comprises: Obtaining connection information and a decryption private key of a receiving node, and sending the connection information to a central server so that multiple sending nodes can obtain the connection information through the central server, wherein the connection information includes an operating system type, address information, and an encryption public key; Establishing a communication connection between the receiving node and each of the sending nodes according to the address information and a communication protocol corresponding to the operating system type; Receiving target data sent by each of the sending nodes, and allocating receiving thread resources to each of the sending nodes; Integrity verification and decryption are performed on each of the target data according to the decryption private key and each of the receiving thread resources, and all the decrypted target data are stored.
7. The distributed cross-platform communication method according to claim 6, It is characterized in that Performing integrity verification and decryption on each of the target data according to the decryption private key and the receiving thread resource, including: Calculate the current hash value of the received encrypted data through the receiving thread resource; If the current hash value is the same as the received hash value, and the current length of the received encrypted data is the same as the received length, the integrity check passes; If the current hash value is different from the received hash value, and / or the current length of the received encrypted data is different from the received length, the integrity check fails; If the integrity check passes, the received encrypted data is decrypted by the receiving thread resource according to the decryption private key corresponding to the received encryption algorithm flag bit; If the integrity check fails, a preset data retransmission mechanism or a preset error handling process is triggered through the receiving thread resources; The target data includes the received encrypted data and the received hash value, the received length, and the received encryption algorithm flag corresponding to the received encrypted data.
8. A distributed cross-platform communication device, It is characterized in that The device comprises: An acquisition module, used to acquire the initial data of the sender node and the connection information of the central server, wherein the connection information includes the operating system type, address information and encryption public key of multiple receiver nodes; A connection establishing module, used to establish a communication connection between the sender node and each of the receiver nodes according to each of the address information and the communication protocol corresponding to each of the operating system types; The data sending module is used to allocate sending thread resources to each of the receiving nodes, and encrypt and transmit the initial data to the corresponding receiving node according to the encryption public key and each of the sending thread resources.
9. An electronic device, It is characterized in that The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the distributed cross-platform communication method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the distributed cross-platform communication method according to any one of claims 1 to 7.
