Data processing method and device, electronic equipment, computer readable storage medium and computer program product
By parsing communication data through a non-IP communication protocol model and promiscuous mode, the network communication problem under the condition of no master device is solved, and flexible network connection between multiple electronic devices is realized.
Patent Information
- Application Number
- CN202410307622.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-09-16
Smart Images

Figure CN120658809A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a data processing method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] Typically, in data processing systems, electronic devices are cascaded to allow them to work together and share data streams. This is widely used in conference rooms, classrooms, lecture halls, and other places. In these scenarios, a single electronic device may not be able to cover the entire area or meet the needs of all participants. Therefore, it is necessary to rationally arrange multiple cascaded electronic devices to achieve network communication between them.
[0003] However, in the related art, a prerequisite for achieving network communication between multiple cascaded electronic devices is the presence of a master device. When there is no master device in the data processing system, network communication between multiple cascaded electronic devices cannot be performed. Summary of the Invention
[0004] Embodiments of the present application provide a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can solve the network communication problem of multiple cascaded electronic devices when there is no master device.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] An embodiment of the present application provides a data processing method, which is applied to any target electronic device in a data processing system, wherein the data processing system includes multiple electronic devices cascaded with each other; the method includes: obtaining multiple communication data sent by other electronic devices in the data processing system except the target electronic device; parsing and processing the communication data according to a preset frame format to obtain a protocol type of each communication data and parsed data of each communication data; based on the protocol type of each communication data, screening out at least one target parsed data from the multiple communication data; and performing data processing on the at least one target parsed data in the target electronic device.
[0007] An embodiment of the present application provides a data processing device, including: an acquisition module, used to acquire multiple communication data sent by electronic devices other than the target electronic device in the data processing system; a parsing module, used to parse and process the communication data according to a preset frame format to obtain the protocol type of each communication data and the parsed data of each communication data; a screening module, used to screen out at least one target parsed data from the multiple communication data based on the protocol type of each communication data; and a data processing module, used to perform data processing on the at least one target parsed data in the target electronic device.
[0008] In some embodiments, the multiple cascaded electronic devices are electronic devices that support a non-IP communication protocol model; wherein the non-IP communication protocol model includes an application layer that supports a preset protocol type, a transport layer that supports raw sockets, a network layer that does not support the IP protocol, and a data link layer and physical layer that support promiscuous mode.
[0009] In some embodiments, the target electronic device includes multiple network devices corresponding to the non-IP communication protocol model; the acquisition module is also used to: switch the working mode of the network device corresponding to the data link layer in the target electronic device to the promiscuous mode; based on the promiscuous mode, obtain the multiple communication data sent by the other electronic devices through the network device corresponding to the data link layer, the network device corresponding to the network layer, the network device corresponding to the transport layer and the network device corresponding to the application layer in sequence.
[0010] In some embodiments, the acquisition module is also used to: based on the promiscuous mode, receive the multiple communication data sent by the other electronic devices through the network device corresponding to the data link layer; transmit the multiple communication data to the network device corresponding to the transport layer through the network device corresponding to the network layer; in the network device corresponding to the transport layer, receive the multiple communication data through the specific interface bound to the original socket; and obtain the multiple communication data through the network device corresponding to the application layer.
[0011] In some embodiments, the parsing module is also used to: in the network device corresponding to the application layer, parse and process the communication data according to a preset frame format to obtain a parsing result; determine the protocol type of each communication data and the parsing data of each communication data from the parsing result.
[0012] In some embodiments, the screening module is used to: obtain the preset protocol type; and when the protocol type of any communication data is consistent with the preset protocol type, determine the parsed data of the corresponding communication data as the target parsed data.
[0013] In some embodiments, the network device corresponding to the application layer is also used to: determine a data filtering mechanism for the multiple communication data; based on the data filtering mechanism, perform data filtering processing on the multiple communication data to obtain multiple filtered communication data; based on the multiple filtered communication data, determine the at least one target parsing data.
[0014] In some embodiments, the device further includes a determination module, which is configured to: parse each filtered communication data to obtain parsed data of the filtered communication data; and determine the parsed data as the target parsed data.
[0015] An embodiment of the present application provides an electronic device, comprising: a memory for storing computer-executable instructions; and a processor for implementing the data processing method provided in the embodiment of the present application when executing the computer-executable instructions stored in the memory.
[0016] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for implementing the data processing method provided in the embodiment of the present application when executed by a processor.
[0017] An embodiment of the present application provides a computer program product, which includes computer-executable instructions, which are stored in a computer-readable storage medium; wherein, when a processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, the data processing method provided in the embodiment of the present application is implemented.
[0018] The embodiments of the present application have the following beneficial effects:
[0019] The embodiment of the present application can be applied to any target electronic device in a data processing system, wherein the data processing system includes multiple cascaded electronic devices. First, multiple communication data sent by electronic devices other than the target electronic device in the data processing system are obtained; then, the communication data are parsed and processed according to a preset frame format to obtain the protocol type of each communication data and the parsed data of each communication data; based on the protocol type of each communication data, at least one target parsed data is filtered out from the multiple communication data; finally, data processing is performed on the at least one target parsed data in the target electronic device. In this way, the target electronic device not only receives the communication data sent to itself, but also receives all communication data sent by electronic devices other than the target electronic device, and parses to obtain the protocol type and parsed data of each communication data. Based on the protocol type of each communication data and the protocol type in the preset frame format, the communication data is filtered, and then the filtered target parsed data is processed, thereby realizing network communication between multiple cascaded electronic devices in the absence of a master device. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a schematic diagram of the structure of the data processing system architecture provided by the embodiment of the present application;
[0021] Figure 2 is a structural diagram of a data processing device provided in an embodiment of the present application;
[0022] Figure 3 This is an optional flowchart of the data processing method provided in the embodiment of the present application;
[0023] Figure 4 This is another optional flowchart of the data processing method provided in the embodiment of the present application;
[0024] Figure 5 This is a schematic diagram of the structure of the PoE system provided in an embodiment of the present application;
[0025] Figure 6 This is a schematic diagram of the architecture of a multi-microphone speaker cascade system provided in an embodiment of the present application;
[0026] Figure 7 This is a schematic diagram of the structure of the non-IP communication protocol model provided in an embodiment of the present application;
[0027] Figure 8 This is a schematic diagram of the structure of the TCP / IP communication model provided in the embodiment of the present application;
[0028] Figure 9 This is a schematic diagram of the workflow of the common network mode provided in the embodiment of the present application;
[0029] Figure 10 Schematic diagram of the structure of the communication frame format provided in the embodiment of the present application;
[0030] Figure 11 This is a flow chart of the frame format packaging and parsing of communication frames in the application layer provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0032] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will 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.
[0033] If similar descriptions of "first / second" appear in the application documents, the following explanation is added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific order for 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 application described herein can be implemented in an order other than that illustrated or described herein.
[0034] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0035] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0036] 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, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0037] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0038] 1) Power over Ethernet (PoE): This technology allows for the simultaneous transmission of data and power over Ethernet cables (typically Cat5e or Cat6). PoE offers the advantages of simplifying network device wiring, reducing costs, and increasing flexibility. A PoE system primarily consists of the following components: a power source (PSE), responsible for providing power to connected devices; a powered device (PD), which receives power supplied via the Ethernet cable; and an Ethernet cable, which transmits data and power between the PSE and PD.
[0039] 2) Promiscuous Mode: When a network device (such as a network card) receives data packets, it not only receives data packets sent to itself, but also receives data packets from all networks to which it is connected.
[0040] Regarding related technologies, in one solution, the upper computer and the lower computer need to obtain IP addresses through the Dynamic Host Configuration Protocol (DHCP) service and then conduct network communication between cascaded devices based on the IP addresses. However, this solution relies on the DHCP service. If there is no DHCP service, IP allocation cannot be completed; in another solution, after the only DHCP service is determined through communication negotiation, IP addresses are allocated to other cascaded devices through the DHCP service, which solves the problem of network communication failure due to the lack of a gateway device when multiple devices are cascaded. However, the prerequisite for this solution is that there must be a master device to initiate communication negotiation for the DHCP service.
[0041] However, when multiple electronic devices are cascaded with each other, the selection of the master device needs to go through communication negotiation, but the communication negotiation requires the master device to start the DHCP service to allocate an IP address. The two are interdependent. Therefore, based on at least one of the above technical problems existing in the above-mentioned related technologies, an embodiment of the present application proposes an IP-free communication protocol that does not rely on the DHCP service to solve the network communication problem of cascaded devices when there is no master device.
[0042] The following describes exemplary applications of the data processing device (i.e., electronic device) provided in the embodiments of the present application. The device provided in the embodiments of the present application can be implemented as a laptop computer, tablet computer, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), smart phone, smart speaker, smart watch, smart TV, vehicle-mounted terminal, and other types of other electronic devices capable of data processing, and can also be implemented as target electronic devices. The following describes exemplary applications when the data processing device is implemented as a target electronic device.
[0043] See also Figure 1 , Figure 1 It is a structural diagram of the data processing system 100 architecture provided in an embodiment of the present application. In order to support a data processing application, the data processing application is run on other electronic devices 400, and the other electronic devices 400 are connected to the target electronic device 200 through a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0044] The other electronic device 400 is used to send a data processing request to the target electronic device 200. The target electronic device 200 constitutes a data processing device in an embodiment of the present application, that is, any target electronic device in a data processing system, wherein the data processing system includes multiple cascaded electronic devices, and the target electronic device 200 is used to obtain multiple communication data sent by other electronic devices in the data processing system, except the target electronic device; according to a preset frame format, the communication data is parsed and processed to obtain the protocol type of each communication data and the parsed data of each communication data; based on the protocol type of each communication data, at least one target parsed data is filtered out from the multiple communication data; in the target electronic device, data processing is performed on the at least one target parsed data to obtain a data processing result. After obtaining the data processing result, the target electronic device 200 returns the data processing result to the other electronic device 400, so that the other electronic device 400 can output the data processing result or continue to perform the next business processing based on the data processing result.
[0045] In some embodiments, the target electronic device 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms. Other electronic devices can be smart phones, tablet computers, laptops, desktop computers, smart speakers, smart watches, car terminals, etc., but are not limited to these. Other electronic devices and target electronic devices can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0046] See also Figure 2 , Figure 2 is a schematic structural diagram of a target electronic device 200 provided in an embodiment of the present application, Figure 2 The target electronic device 200 shown may be a data processing device, which includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the data processing device are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .
[0047] The processor 410 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.
[0048] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0049] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0050] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0051] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0052] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;
[0053] A network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wi-Fi, and Universal Serial Bus (USB);
[0054] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripheral devices and displaying content and information);
[0055] The input processing module 454 is configured to detect one or more user inputs or interactions from one of the one or more input devices 432 and to translate the detected inputs or interactions.
[0056] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2 The data processing device 455 stored in the memory 450 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: an acquisition module 4551, a parsing module 4552, a screening module 4553, and a data processing module 4554. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.
[0057] In other embodiments, the apparatus provided in the embodiments of the present application may be implemented in hardware. As an example, the apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0058] In some embodiments, other electronic devices or target electronic devices can implement the data processing method provided by the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. A computer program can be a native program or software module in an operating system; it can be a local (Native) application (Application, APP), that is, a program that needs to be installed in the operating system to run, or it can be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded to a browser environment to run. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.
[0059] The data processing methods provided in each embodiment of the present application can be executed by an electronic device, wherein the electronic device can be a target electronic device or other electronic device, that is, the data processing methods provided in each embodiment of the present application can be executed by the target electronic device or other electronic device, or can be executed through interaction between the target electronic device and other electronic devices.
[0060] See also Figure 3 , Figure 3 This is an optional flow chart of the data processing method provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are described below, and the execution subject of the data processing method is taken as an example of a target electronic device. The method includes the following steps S101 to S104:
[0061] Step S101: Acquire a plurality of communication data sent by electronic devices other than the target electronic device in a data processing system.
[0062] In an embodiment of the present application, a data processing system includes multiple mutually cascaded electronic devices, that is, multiple mutually cascaded target electronic devices and other electronic devices, and the target electronic device can be any electronic device in the data processing system. The multiple mutually cascaded electronic devices realize network communication between the cascaded devices by receiving and sending communication data. Any electronic device in the data processing system can be the sender and receiver of communication data. Regardless of whether the target MAC address in the received communication data matches its own MAC address, there is no distinction between master and slave devices. That is, any electronic device in the data processing system can obtain multiple communication data sent by other electronic devices in the data processing system except itself.
[0063] For example, a data processing system includes four cascaded electronic devices: electronic device A, electronic device B, electronic device C, and electronic device D. Each of electronic devices A, B, C, and D can be a target electronic device. Assume that electronic device B is the target electronic device and the receiver of communication data, and electronic devices A, C, and D are the senders of communication data. Regardless of whether the target MAC addresses in the multiple communication data sent by electronic devices A, C, and D match their own MAC addresses, multiple communication data sent by electronic devices A, C, and D are obtained.
[0064] Here, a plurality of communication data in the data processing system is acquired so that network communication between a plurality of mutually cascaded devices in the data processing system can be realized through a subsequent data processing process on the plurality of communication data.
[0065] Step S102: parsing the communication data according to a preset frame format to obtain the protocol type of each communication data and parsed data of each communication data.
[0066] In the embodiment of the present application, the preset frame format refers to the frame format of the communication data that is preset, and the preset frame format includes the target MAC address, the source MAC address, the preset protocol type, the frame header, the communication count, the ACK, the parsed data length, the parsed data, and the check code. After obtaining multiple communication data, the actual format of each communication data corresponds to the preset frame format. Therefore, the communication data can be parsed according to the preset frame format to obtain the parsing result of the communication data, wherein the parsing result is the data content in each communication data corresponding to the above-mentioned preset frame format, that is, including the protocol type of each communication data and the parsed data of each communication data. The parsing processing method is not specifically limited here.
[0067] Here, the protocol type and parsed data of each communication data are obtained through the parsing process of the communication data, so that the target parsed data can be determined from multiple parsed data based on the protocol type of each communication data and used for data processing.
[0068] Step S103 : based on the protocol type of each communication data, at least one target parsed data is screened out from the plurality of communication data.
[0069] In an embodiment of the present application, the target parsed data is parsed data that can be processed in a data processing system. After determining the protocol type of each communication data, the protocol type of each communication data is compared with the preset protocol type in the preset frame format. If the protocol type of the communication data is consistent with the preset protocol type in the preset frame format, the parsed data of the communication data is determined as the target parsed data; if the protocol type of the communication data is inconsistent with the preset protocol type in the preset frame format, the communication data is discarded. For example, the preset protocol type can be 0x88FF, and when the protocol type of the communication data is 0x66FF, the protocol type of the communication data is inconsistent with the preset protocol type, and the communication data is discarded and not used in the subsequent data processing process.
[0070] Here, through the screening process of the target parsed data, only when the protocol type of the communication data meets the preset protocol type, the parsed data of the communication data is used in the subsequent data processing process, thereby realizing the filtering of the communication data in the network communication process.
[0071] Step S104: performing data processing on at least one target parsed data in the target electronic device.
[0072] In the embodiments of the present application, in the target electronic device, different application services are implemented based on the protocol type of the communication data corresponding to the target parsed data, that is, data processing is implemented for at least one target parsed data. For example, the application service may be email transmission, file transfer, web browsing, remote login, etc., and the data processing may be operations such as decryption, decoding, storage and forwarding.
[0073] Here, through the data processing process of parsing data for at least one target, the correct transmission and interpretation of communication data in the data processing system is ensured, thereby successfully achieving network communication between multiple cascaded electronic devices.
[0074] The data processing method provided in the embodiment of the present application can be applied to any target electronic device in a data processing system, wherein the data processing system includes multiple cascaded electronic devices. First, multiple communication data sent by other electronic devices other than the target electronic device in the data processing system are obtained; then, the communication data are parsed and processed according to a preset frame format to obtain the protocol type of each communication data and the parsed data of each communication data; based on the protocol type of each communication data, at least one target parsed data is filtered out from the multiple communication data; finally, data processing is performed on the at least one target parsed data in the target electronic device. In this way, the target electronic device not only receives the communication data sent to itself, but also receives all communication data sent by other electronic devices other than the target electronic device, and parses to obtain the protocol type and parsed data of each communication data, completes the communication data screening based on the protocol type of each communication data and the protocol type in the preset frame format, and then performs data processing on the filtered target parsed data, thereby realizing network communication between multiple cascaded electronic devices when there is no master device.
[0075] The following will describe the data processing method in the embodiment of the present application in conjunction with the interaction between the target electronic device and other electronic devices in the data processing system. It should be noted that the data processing method here is a data processing method implemented by the target electronic device interacting with other electronic devices, which is essentially the same as the data processing method performed by the target electronic device in the above embodiment. The only difference is that the embodiment of the present application also describes the actions performed by other electronic devices during the execution of the data processing method, and some steps can be performed by other electronic devices as well as by the target electronic device. Therefore, for the steps in this embodiment that are the same as those in the above embodiment but have different execution subjects, this embodiment is only an illustrative description. In the process of implementation, they can be performed by any execution subject, and the embodiment of the present application does not limit this.
[0076] Figure 4 This is another optional flow chart of the data processing method provided in the embodiment of the present application, such as Figure 4 As shown, the method includes the following steps S201 to S212:
[0077] Step S201: other electronic devices receive data processing operations input by the user.
[0078] In an embodiment of the present application, a user can input data processing operations on the client of a data processing application. In the data processing application, a data processing function can be provided. The user can input data processing operations on the data processing function page to trigger a data processing request.
[0079] In some embodiments, when the user inputs the data processing operation, he or she may also input the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer at the same time. When other electronic devices receive the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer, a confirmation data processing window will pop up on the data processing function page. After the other electronic devices detect that the user clicks the confirm data processing button, they will perform further data processing according to the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer, thereby determining the data processing result. Alternatively, in other embodiments, the user may directly input the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer on the data processing function page. When other electronic devices receive the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer, they can directly trigger the data processing function, perform further data processing according to the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer, and determine the data processing result.
[0080] Step S202: Other electronic devices generate data processing requests in response to the data processing operation.
[0081] In an embodiment of the present application, the data input by the user can be encapsulated into a data processing request. For example, on the display interface of the data processing application, the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer are displayed. The user can select the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer according to actual needs, and then encapsulate the preset frame format and the working mode switching instruction of the network device corresponding to the data link layer input by the user into the data processing request.
[0082] Step S203: The other electronic devices send a data processing request to the target electronic device.
[0083] In step S204 , the target electronic device switches the working mode of the network device corresponding to the data link layer in the target electronic device to the promiscuous mode in response to the data processing request.
[0084] In an embodiment of the present application, the target electronic device can be any electronic device in a plurality of mutually cascaded electronic devices in a data processing system, and the plurality of mutually cascaded electronic devices are electronic devices that support a non-IP communication protocol model; wherein the non-IP communication protocol model includes an application layer that supports a preset protocol type, a transport layer that supports raw sockets, a network layer that does not support the IP protocol, a data link layer that supports promiscuous mode, and a physical layer. That is, the protocol type of the application layer in the non-IP communication protocol model is a custom protocol type, for example, the protocol type can be 0x88FF, and the preset protocol type is used to encapsulate and decapsulate data. The transport layer does not use the TCP / UDP protocol, but uses the basic Socket interface to create a raw socket (Raw Socket), and binds the raw socket to the eth0 network interface, using the raw socket to directly process communication data below the network layer. The network layer does not rely on the IP (IPV4 / IPV6) protocol, and the transport layer can directly send or obtain data packets. The promiscuous mode can be enabled at the data link layer through a working mode switching instruction (for example, ifconfig eth0 promisc). When receiving communication data, all communication data in the data processing system can be captured through the network device corresponding to the data link layer. The physical layer is set up in accordance with the TCP / IP model.
[0085] Each layer in the No-IP communication protocol model corresponds to a corresponding network device for decapsulating and transmitting communication data. The decapsulation process is the process of determining the target data for parsing. The target electronic device includes multiple network devices corresponding to the No-IP communication protocol model. For example, the network devices corresponding to the physical layer may be repeaters and hubs, the network devices corresponding to the data link layer may be bridges and switches, the network layer may be routers, the network devices corresponding to the transport layer may be gateways, and the network devices corresponding to the application layer may be computers, servers, and applications.
[0086] In response to a data processing request, if the data processing request encapsulates an operating mode switching instruction for a network device corresponding to the data link layer, the operating mode switching instruction for the network device corresponding to the data link layer can be directly parsed and obtained. Furthermore, in response to the operating mode switching instruction, the operating mode of the network device corresponding to the data link layer in the target electronic device is switched to promiscuous mode, thereby implementing the conversion of the operating mode of the network device corresponding to the data link layer, allowing the target electronic device to receive communication data sent by other electronic devices.
[0087] In step S205, the target electronic device obtains multiple communication data sent by other electronic devices based on the promiscuous mode through the network device corresponding to the data link layer, the network device corresponding to the network layer, the network device corresponding to the transport layer and the network device corresponding to the application layer.
[0088] In an embodiment of the present application, based on the promiscuous mode, multiple communication data sent by other electronic devices are obtained in sequence through the network device corresponding to the data link layer, the network device corresponding to the network layer, the network device corresponding to the transport layer, and the network device corresponding to the application layer. This can be achieved in the following way: first, based on the promiscuous mode, multiple communication data sent by other electronic devices are received through the network device corresponding to the data link layer; the multiple communication data are transmitted to the network device corresponding to the transport layer through the network device corresponding to the network layer; then, in the network device corresponding to the transport layer, the multiple communication data are received through the specific interface bound to the original socket; finally, the multiple communication data are obtained through the network device corresponding to the application layer.
[0089] That is, when the network device corresponding to the data link layer is in promiscuous mode, the target electronic device not only receives communication data whose target MAC address matches its own MAC address, but also receives multiple communication data sent by other electronic devices. Through the network device corresponding to the network layer that does not rely on the IP (IPV4 / IPV6) protocol, the multiple communication data are directly transmitted to the network device corresponding to the transport layer without the need to perform the IP protocol decapsulation process. In the network device corresponding to the transport layer, the original socket is bound to a specific interface, and the multiple communication data are received through the specific interface. After the multiple communication data are received, the multiple communication data are directly transmitted to the network device corresponding to the application layer without the need to perform the TCP / UDP protocol decapsulation process, and the multiple communication data are obtained through the network device corresponding to the application layer.
[0090] Here, through the communication data transmission process of the network devices corresponding to each layer in the non-IP communication protocol model, the target electronic device can obtain multiple communication data sent by other electronic devices other than itself in the data processing system, so as to subsequently realize the data processing of the target parsed data in the multiple communication data.
[0091] In step S206 , the target electronic device parses the communication data in a network device corresponding to the application layer according to a preset frame format to obtain a parsing result.
[0092] In an embodiment of the present application, in response to a data processing request, if a preset frame format is encapsulated in the data processing request, the preset frame format can be directly parsed to obtain the preset frame format. The preset frame format refers to the frame format of the preset communication data, and the preset frame format includes the target MAC address, source MAC address, preset protocol type, frame header, communication count, ACK, parsed data length, parsed data and check code. The parsing result is the data content contained in the communication data corresponding to the preset frame format. Usually, for different communication data, the target MAC address, source MAC address, parsed data and other data contents of each communication data are different, that is, the parsing results are not the same. Therefore, when the network device corresponding to the application layer receives multiple communication data, the network device corresponding to the application layer needs to parse and process each communication data according to the preset frame format to obtain the parsing result of each communication data.
[0093] In some embodiments, in addition to being applied to the above-mentioned analysis and processing process of communication data, the network equipment corresponding to the application layer is also used to: determine a data filtering mechanism for multiple communication data; based on the data filtering mechanism, perform data filtering processing on multiple communication data to obtain multiple filtered communication data; based on the multiple filtered communication data, determine at least one target analysis data.
[0094] That is to say, when the network device corresponding to the application layer receives multiple communication data obtained by the network device corresponding to the network layer through the specific interface bound to the original socket, based on the preset protocol type, a data filtering mechanism is determined to implement data filtering processing, for example, the Berkeley packet capture filter, which directly filters out the communication data whose protocol type is not the preset protocol type, and retains the communication data whose protocol type is not the preset protocol type, that is, the filtered communication data.
[0095] Furthermore, determining at least one target parsed data based on the plurality of filtered communication data can be achieved by: parsing each filtered communication data to obtain parsed data of the filtered communication data; and determining the parsed data as the target parsed data. Specifically, if the filtered communication data is communication data whose protocol type is not a preset protocol type, the parsed data obtained after parsing each filtered communication data is the target parsed data.
[0096] Here, applying the data filtering mechanism to the screening process of target parsing data can achieve rapid positioning of target parsing data and improve the processing rate of the entire data processing process.
[0097] Step S207 : The target electronic device determines the protocol type of each communication data and the parsed data of each communication data from the parsing result.
[0098] In an embodiment of the present application, the parsing result includes the target MAC address, source MAC address, protocol type, frame header, communication count, ACK, parsed data length, parsed data and check code of each communication data, that is, the parsing result of each communication data includes the protocol type of each communication data and the parsed data of each communication data.
[0099] Step S208: The target electronic device obtains a preset protocol type.
[0100] In the embodiment of the present application, the preset protocol type is included in the preset frame format, and the target electronic device can directly extract the preset protocol type from the preset frame format. Here, by obtaining the preset protocol type, the target parsed data for data processing can be accurately determined based on the preset protocol type and the protocol type of each communication data.
[0101] Step S209 : When the protocol type of any communication data is consistent with the preset protocol type, the target electronic device determines the parsed data of the corresponding communication data as the target parsed data.
[0102] In an embodiment of the present application, after obtaining the preset protocol type, the protocol type of each communication data is compared with the preset protocol type. If the protocol type of any communication data is consistent with the preset protocol type, the parsed data of the corresponding communication data is determined as the target parsed data. Otherwise, the communication data whose protocol type is consistent with the preset protocol type is discarded and no subsequent data processing is performed.
[0103] In step S210 , the target electronic device processes at least one target parsed data to obtain a data processing result.
[0104] In the embodiments of the present application, different application services are implemented using a preset protocol type through a network device corresponding to an application layer in a target electronic device, that is, data processing is performed on at least one target parsed data to obtain a data processing result. For example, the application service may be email transmission, file transfer, web browsing, remote login, etc., the data processing may be operations such as decryption, decoding, storage and forwarding, and the corresponding data processing result may be a data processing completion table identifier, email transmission results, file transfer results, web browsing results, etc.
[0105] Here, through the data processing process of parsing data for at least one target, the correct transmission and interpretation of communication data in the data processing system is ensured, thereby successfully achieving network communication between multiple cascaded electronic devices.
[0106] Step S211: The target electronic device sends the data processing result to other electronic devices.
[0107] Step S212: other electronic devices output data processing results.
[0108] In an embodiment of the present application, first, based on the promiscuous mode of the network device corresponding to the data link layer, a plurality of communication data sent by other electronic devices to the target electronic device in the data processing system is obtained through the network devices corresponding to each level of the non-IP communication protocol model; then, based on the preset frame format, the communication data is parsed and processed to obtain the protocol type and parsed data of each communication data, and then at least one target parsed data is determined from the parsed data according to the preset protocol type in the preset frame format; finally, the target parsed data is processed. In this way, when the target electronic device obtains multiple communication data sent by other electronic devices through the network devices corresponding to each level of the non-IP communication protocol model, it does not need to rely on the IP protocol, and only needs to use the preset protocol type in the preset frame format to complete the screening of the target parsed data, that is, to obtain the target parsed data whose protocol type corresponds to the preset protocol type in the multiple communication data. There is no need to determine the master device in advance, assign the IP address through the master device, and then perform network communication between multiple cascaded devices, which solves the network communication problem of multiple cascaded electronic devices when there is no master device.
[0109] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0110] The embodiment of the present application provides a data processing method, which involves a non-IP communication protocol model. The communication protocol model does not rely on the IP protocol and does not require a specific master device to provide DHCP services, so that network communication can be carried out between multiple cascade devices. The method is applicable to all network cascade devices and has no additional constraints or regulations on the GUI layout and its interaction method. For example, the method can be applied to a multi-microphone speaker cascade system, in which multiple microphone speaker devices are connected together via PoE, that is, the connection method between each two microphone speaker devices is as follows: Figure 5 As shown, one of the microphone-speaker devices serves as a power supply end 10, and the other microphone-speaker device serves as a power receiving end 11. The two microphone-speaker devices are connected via an Ethernet cable 12 so that multiple microphone-speaker devices can work together and share audio signals. They are mainly used in conference rooms, classrooms, lecture halls and other places. In scenarios in these places, a single microphone and speaker may not be able to cover the entire area or meet the needs of all participants. By properly arranging cascaded microphones and speakers and using acoustic echo cancellation (AEC) technology, the risk of echo and howling can be reduced and audio quality can be improved. Figure 6As shown in the figure, the architecture diagram of the multi-microphone speaker cascade system mainly includes the following roles: host computer 01, which is generally a PC or a large conference screen, and the system can be Windows or Linux; master device 02, which is a speaker connected to the host computer via USB, and there is only one master device; slave devices 03 and 04, which are speakers cascaded with other devices through the PoE powered PD port and can support multiple slave devices; and DC power supply 05.
[0111] The embodiment of this application includes three key technologies, namely, the non-IP communication protocol model, the frame format of the communication frame (i.e., the above-mentioned preset frame format), and the frame format packaging and parsing of the communication frame. Among them, the first part, for the non-IP communication protocol model, can be specifically divided into 5 levels, such as Figure 7 1) Physical layer, as shown in Figure 8 The TCP / IP network model shown in the figure is consistent; 2) Data link layer, turn on the promiscuous mode. When receiving data packets, usually, such as Figure 9 As shown, in normal network mode, the network device will only receive data packets sent to itself, that is, data packets whose destination MAC address matches its own MAC address. However, in promiscuous mode, it not only receives data packets sent to itself, but also receives all data packets passing through the network to which it is connected, which enables the network device to capture all data packets in the network. 3) Network layer, does not rely on the IP (IPV4 / IPV6) protocol, and the transport layer directly sends or obtains data packets. 4) Transport layer, using the basic Socket interface, creates a raw socket (Raw Socket) and binds it to the eth0 network interface (that is, the specific interface mentioned above), and uses the raw socket to directly process data packets below the network layer. 5) Application layer, the sender packages and sends communication frames with a protocol type of 0x88FF, and applies the Berkeley Packet Filter (BPF) to the raw socket. BPF is an efficient packet filtering mechanism that only captures data frames with a protocol type of 0x88FF. It can filter data packets at the kernel level, thereby reducing the burden on the application.
[0112] The second part, regarding the frame format of the communication frame, can be divided into 9 parts, such as Figure 10As shown, 1) Destination MAC Address: 6 bytes; 2) Source MAC Address: 6 bytes; 3) Protocol Type: Custom 0x88FF (i.e., the preset protocol type mentioned above); 4) Frame Header: 2 bytes, fixed at 0x5A and 0xA5; 5) Sequence Number (i.e., the communication count mentioned above): 1 byte. Each time a new communication is initiated, the sequence number increments by 1. If it exceeds 255, it rolls over to 0 and the count restarts. If the message request is 0x02, the corresponding ACK is also 0x02; 6) ACK: 1 byte; 7) Data Length: The data length sent by the business layer (i.e., the parsed data length mentioned above); 8) Data: The data carried by the business layer (i.e., the parsed data mentioned above). 9) Checksum: The checksum from the start address to the end address of the data.
[0113] The third part is about the packaging and parsing of the communication frame format, which can be divided into two sub-steps: Figure 11 As shown, in sub-step 1, device A packages the communication frame into a format containing the protocol type 0x88FF at the application layer and broadcasts it through the network port. Sub-step 2: Device B's application layer receives the communication frame sent by device A and parses it according to the frame format. If the parsed protocol type is 0x88FF, the data is processed; otherwise, the data is discarded.
[0114] The present embodiment provides an IP-free communication protocol model that is independent of the IP protocol and does not require the designation of a specific master device to provide DHCP services, thereby enabling network communication between multiple cascaded devices. Furthermore, based on the method proposed in the present embodiment, in subsequent operations, network communication between multiple cascaded devices can be used to negotiate the master device among the cascaded devices. The master device can then initiate DHCP services and assign IP addresses to the other cascaded devices.
[0115] It is understandable that in the embodiments of the present application, if the content involves user information, such as communication data, preset frame format and target parsing data, and if it involves data related to user information or enterprise information, when the embodiments of the present application are applied to specific products or technologies, it is necessary to obtain user permission or consent, or to blur this information to eliminate the correspondence between this information and the user; and the relevant data collection and processing should be strictly in accordance with the requirements of relevant national laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained, and subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0116] The following continues to describe the exemplary structure of the data processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2As shown, the software modules stored in the data processing device 455 of the memory 450 may include: an acquisition module 4551, used to acquire multiple communication data sent by other electronic devices except the target electronic device in the data processing system; a parsing module 4552, used to parse and process the communication data according to a preset frame format to obtain the protocol type of each communication data and the parsed data of each communication data; a screening module 4553, used to screen out at least one target parsed data from the multiple communication data based on the protocol type of each communication data; and a data processing module 4554, used to perform data processing on the at least one target parsed data in the target electronic device.
[0117] In some embodiments, the multiple cascaded electronic devices are electronic devices that support a non-IP communication protocol model; wherein the non-IP communication protocol model includes an application layer that supports a preset protocol type, a transport layer that supports raw sockets, a network layer that does not support the IP protocol, and a data link layer and physical layer that support promiscuous mode.
[0118] In some embodiments, the target electronic device includes multiple network devices corresponding to the non-IP communication protocol model; the acquisition module 4551 is also used to: switch the working mode of the network device corresponding to the data link layer in the target electronic device to the promiscuous mode; based on the promiscuous mode, obtain the multiple communication data sent by the other electronic devices through the network device corresponding to the data link layer, the network device corresponding to the network layer, the network device corresponding to the transport layer and the network device corresponding to the application layer in sequence.
[0119] In some embodiments, the acquisition module 4551 is also used to: based on the promiscuous mode, receive the multiple communication data sent by the other electronic devices through the network device corresponding to the data link layer; transmit the multiple communication data to the network device corresponding to the transport layer through the network device corresponding to the network layer; in the network device corresponding to the transport layer, receive the multiple communication data through the specific interface bound to the original socket; and obtain the multiple communication data through the network device corresponding to the application layer.
[0120] In some embodiments, the parsing module 4552 is also used to: in the network device corresponding to the application layer, parse and process the communication data according to a preset frame format to obtain a parsing result; determine the protocol type of each communication data and the parsing data of each communication data from the parsing result.
[0121] In some embodiments, the screening module 4553 is used to: obtain the preset protocol type; and when the protocol type of any communication data is consistent with the preset protocol type, determine the parsed data of the corresponding communication data as the target parsed data.
[0122] In some embodiments, the network device corresponding to the application layer is also used to: determine a data filtering mechanism for the multiple communication data; based on the data filtering mechanism, perform data filtering processing on the multiple communication data to obtain multiple filtered communication data; based on the multiple filtered communication data, determine the at least one target parsing data.
[0123] In some embodiments, the device 455 further includes a determination module, which is used to: parse and process each filtered communication data to obtain parsed data of the filtered communication data; and determine the parsed data as the target parsed data.
[0124] It should be noted that the description of the device embodiment of the present application is similar to the description of the method embodiment described above, and has similar beneficial effects as the method embodiment, so it will not be repeated. For technical details not disclosed in the device embodiment, please refer to the description of the method embodiment of the present application for understanding.
[0125] The embodiment of the present application provides a computer-readable storage medium in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the data processing method provided by the embodiment of the present application, for example, Figure 3 The data processing method is shown.
[0126] An embodiment of the present application provides a computer program product, which includes computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the data processing method described in the embodiment of the present application.
[0127] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0128] In some embodiments, computer-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.
[0129] As an example, computer-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 coordinating files (e.g., files storing one or more modules, subroutines, or code portions).
[0130] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0131] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: The method is applied to any target electronic device in a data processing system, wherein the data processing system includes a plurality of electronic devices cascaded to each other; the method includes: Acquiring a plurality of communication data sent by other electronic devices other than the target electronic device in the data processing system; Parsing the communication data according to a preset frame format to obtain a protocol type of each communication data and parsed data of each communication data; Based on the protocol type of each communication data, filter out at least one target parsed data from the plurality of communication data; In the target electronic device, data processing is performed on the at least one target parsed data.
2. The method according to claim 1, characterized in that The multiple cascaded electronic devices are electronic devices that support a non-IP communication protocol model; wherein the non-IP communication protocol model includes an application layer that supports a preset protocol type, a transport layer that supports raw sockets, a network layer that does not support the IP protocol, and a data link layer and a physical layer that support promiscuous mode.
3. The method according to claim 2, characterized in that The target electronic device includes a plurality of network devices corresponding to the non-IP communication protocol model; and obtaining a plurality of communication data sent by electronic devices other than the target electronic device in the data processing system includes: Switching the working mode of the network device corresponding to the data link layer in the target electronic device to the promiscuous mode; Based on the promiscuous mode, the multiple communication data sent by the other electronic devices are obtained in sequence through the network device corresponding to the data link layer, the network device corresponding to the network layer, the network device corresponding to the transport layer and the network device corresponding to the application layer.
4. The method according to claim 3, characterized in that The acquiring, based on the promiscuous mode, the plurality of communication data sent by the other electronic device through, in sequence, the network device corresponding to the data link layer, the network device corresponding to the network layer, the network device corresponding to the transport layer, and the network device corresponding to the application layer, comprises: Based on the promiscuous mode, receiving the plurality of communication data sent by the other electronic devices through the network device corresponding to the data link layer; Transmitting the plurality of communication data to the network device corresponding to the transport layer through the network device corresponding to the network layer; In the network device corresponding to the transport layer, receiving the plurality of communication data through the specific interface bound to the original socket; The plurality of communication data are obtained through a network device corresponding to the application layer.
5. The method according to claim 4, characterized in that The step of parsing the communication data according to a preset frame format to obtain a protocol type of each communication data and parsed data of each communication data includes: In the network device corresponding to the application layer, the communication data is parsed according to a preset frame format to obtain a parsing result; The protocol type of each communication data and the parsed data of each communication data are determined from the parsing result.
6. The method according to claim 2, characterized in that The step of filtering out at least one target parsed data from the plurality of communication data based on the protocol type of each communication data comprises: Obtaining the preset protocol type; In a case where the protocol type of any of the communication data is consistent with the preset protocol type, the parsed data of the corresponding communication data is determined as the target parsed data.
7. The method according to claim 3, characterized in that The network device corresponding to the application layer is also used for: determining a data filtering mechanism for the plurality of communication data; Based on the data filtering mechanism, performing data filtering processing on the plurality of communication data to obtain a plurality of filtered communication data; The at least one target parsed data is determined based on the plurality of filtered communication data.
8. The method according to claim 7, characterized in that The determining, based on the plurality of filtered communication data, the at least one target parsed data comprises: For each of the filtered communication data, performing parsing processing on the filtered communication data to obtain parsed data of the filtered communication data; The parsed data is determined as the target parsed data.
9. A data processing device, characterized in that: include: an acquisition module, configured to acquire a plurality of communication data sent by electronic devices other than the target electronic device in the data processing system; a parsing module, configured to parse the communication data according to a preset frame format to obtain a protocol type of each communication data and parsed data of each communication data; a screening module, configured to screen out at least one target parsed data from the plurality of communication data based on a protocol type of each of the communication data; A data processing module is used to process the at least one target parsed data in the target electronic device.
10. An electronic device, characterized in that: include: a memory for storing computer-executable instructions; A processor, configured to implement the data processing method according to any one of claims 1 to 8 when executing the computer-executable instructions stored in the memory.
11. A computer-readable storage medium, characterized in that Computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the data processing method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that The computer program product includes computer-executable instructions stored in a computer-readable storage medium; Wherein, when the processor of the electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, the data processing method according to any one of claims 1 to 8 is implemented.