Data processing method and device, electronic equipment and medium
By introducing forwarding devices into the dual-machine hot standby system and using data mirroring technology, the problem of data synchronization failure caused by abnormal master equipment is solved, and the real-time and success rate of data synchronization is improved.
Patent Information
- Application Number
- CN202311523367.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-05-16
AI Technical Summary
In dual-machine hot standby applications, when the master device is abnormal, some data may not be synchronized to the slave device, and the data sent to the master device cannot be processed normally, resulting in data synchronization failure.
By introducing forwarding devices between the master and slave devices, data mirroring technology is used to mirror data traffic between the master and forwarding devices to the slave devices, data synchronization between the master and slave devices is realized, and synchronization is avoided by relying on the master device for synchronization.
Improves the real-time and success rate of data synchronization, ensuring that even if there is an abnormality in the master device, data can be forwarded to the slave device through data mirroring, avoiding data loss or synchronization failure.
Smart Images

Figure CN120017232A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and medium. Background Art
[0002] Hot standby is a solution to improve network reliability. The master device synchronizes the session to the slave device. The slave device senses the status of the master device through the heartbeat line. When the master device fails, the slave device can sense the failure in time and take over the master device to forward traffic.
[0003] In current dual-machine hot standby applications, data synchronization between the master and slave devices is generally performed through a heartbeat line. However, in this solution, if the master device fails, some data may not be synchronized in time, resulting in the inability to synchronize this data to the slave device. In addition, when the master device fails, some data that has been sent to the master device cannot be processed normally. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, device, electronic device and medium, so as to perform data synchronization independently of a master device, thereby improving the real-time performance and success rate of data synchronization.
[0005] According to one aspect of the present application, a data processing method is provided, which is executed by a master device, wherein the master device and the slave device are respectively connected to a forwarding device, and the method includes:
[0006] Notify the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device;
[0007] The first port is set as a source port of data mirroring, and the second port is set as a destination port of data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends the target data to the slave device;
[0008] The second port is a port on the forwarding device connected to the slave device.
[0009] According to one aspect of the present application, a data processing device is provided, which is configured in a master device, wherein the master device and the slave device are respectively connected to a forwarding device, and the device includes:
[0010] a notification module, used for notifying the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device;
[0011] A setting module, used to set the first port as a source port of data mirroring and the second port as a destination port of data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends the target data to the slave device;
[0012] The second port is a port on the forwarding device connected to the slave device.
[0013] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the data processing method of any embodiment of the present application.
[0017] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the data processing method of any embodiment of the present application when executed by a processor.
[0018] The technical solution of the embodiment of the present application is executed by the master device, and the master device and the slave device are respectively connected to the forwarding device. The method includes: notifying the forwarding device to use the master device as the destination device for sending target data, so that the forwarding device sends the target data to the master device through the first port connected to the master device; setting the first port as the source port of data mirroring, and setting the second port as the destination port of data mirroring, so that the forwarding device mirrors the target data sent through the first port to the second port and sends it to the slave device; wherein the second port is the port on the forwarding device connected to the slave device. The above scheme sets the data mirroring from the first port to the second port, so that the target data sent by the forwarding device to the master device through the first port can be mirrored to the second port and sent to the slave device through the second port, thereby realizing data synchronization between the master device and the slave device, solving the problem of data synchronization failure caused by abnormality of the master device in the scheme that relies on the master device for data synchronization, thereby improving the real-time performance and success rate of data synchronization.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a flow chart of a data processing method provided according to Embodiment 1 of the present application;
[0022] Figure 2 This is a network diagram provided according to Embodiment 1 of the present application;
[0023] Figure 3 is a flow chart of a data processing method provided according to Embodiment 2 of the present application;
[0024] Figure 4 This is a network diagram provided according to Embodiment 2 of the present application;
[0025] Figure 5 is a flow chart of a data processing method provided according to Embodiment 3 of the present application;
[0026] Figure 6 is a structural schematic diagram of a data processing device provided according to Embodiment 4 of the present application;
[0027] Figure 7 It is a structural schematic diagram of an electronic device provided according to Embodiment 5 of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", "third", "fourth", "actual", "preset", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 A flowchart of a data processing method provided in the first embodiment of the present application, the embodiment of the present application can be applied to the case of processing data. Typically, it can be applied to the case of processing data sent by a forwarding device. The method can be executed by a data processing device, and the data processing device can be implemented in the form of hardware and / or software. The data processing device can be configured in an electronic device, and the electronic device can be a master device in a dual-machine hot standby application scenario. The master device is connected to the slave device, and the master device and the slave device are respectively connected to the forwarding device to process the target data sent by the forwarding device. Figure 1 As shown, the method includes:
[0032] S110, informing the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device.
[0033] Among them, the master device can be a master device in a dual-machine hot standby application scenario, or a master device in a distributed application scenario, and the slave device is a slave device in the above scenario. The master device and the slave device are selected from at least two electronic devices. In some scenarios, the master device can also be a slave device, and the slave device can also be a master device. The forwarding device can be a device for connecting the master device and the slave device for forwarding data, such as a switch, a router, etc. The terminal can send the target data to the forwarding device, and the forwarding device then sends the target data to the master device for processing. The forwarding device includes a port for data communication, and the port connected to the master device is the first port.
[0034] Exemplarily, the embodiment of the present application is a process executed after the slave device is converted to the master device. Before the conversion, the forwarding device sends the target data to the original master device. After the conversion, it is necessary to notify the forwarding device to use the master device as the destination device for sending the target data, so that the forwarding device sends the target data to the current master device. The port connected to the master device by the forwarding device is the first port. After the forwarding device determines that the destination device for sending the target data is the master device, it will send the target data to the master device through the first port.
[0035] In an embodiment of the present application, notifying the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device, includes:
[0036] The communication address message is broadcasted in the local area network, so that the forwarding device determines the communication address of the master device according to the communication address message, and sends target data to the master device through the first port according to the communication address of the master device.
[0037] Exemplarily, after the slave device is converted to the master device, a communication address message, such as an ARP message, is broadcast in the local area network, so that the conversion device in the local area network can determine the communication address of the current destination device according to the communication address message, refresh the ARP table entry, and determine the target device and communication address to which the target data needs to be sent. The forwarding device sends the target data to the master device through the first port according to the communication address of the master device.
[0038] S120: Set the first port as a source port for data mirroring, and set the second port as a destination port for data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends the data to the slave device.
[0039] Among them, data mirroring refers to the technology of forwarding the data flow of a port to another designated port. The port through which the forwarding device directly sends outward is the source port of data mirroring, and the other port to which the data flow can be forwarded is the destination port. In an embodiment of the present application, the forwarding device needs to send target data to the master device, and the master device is connected to the forwarding device through the first port, so the forwarding device sends the target data to the master device from the first port. The second port is connected to the slave device. If the target data sent to the master device is synchronized to the slave device, the target data needs to be mirrored from the first port data to the second port. In an embodiment of the present application, the master device sets the first port of the forwarding device as the source port of data mirroring, and sets the second port as the destination port of data mirroring, that is, mirroring the target data from the first port to the second port, so that the target data sent to the master device through the first port is mirrored to the second port to be sent to the slave device, realizing data synchronization between the master device and the slave device, not relying on the master device for synchronization, even if the master device is abnormal, the target data can also be forwarded to the second port by data mirroring and received by the slave device, avoiding data loss or data synchronization failure.
[0040] In an embodiment of the present application, the method further includes:
[0041] The target data is received and sent by the forwarding device through the first port according to the communication address of the main device, and the target data is processed.
[0042] Exemplarily, before the slave device is converted to the master device, the slave device receives the target data forwarded by the forwarding device through data mirroring, but the target data is processed by the master device and the processing result is sent outwardly. The slave device only processes the target data to form the same backup session as the master device, but does not send the processing result outwardly. After the slave device is converted to the master device, the master device completes the setting of port mirroring after the processing process of S11-S120. The forwarding device sends the target data to the master device through the first port according to the communication address of the master device. The master device receives the target data sent by the forwarding device, processes the target data, and forwards the processing result outwardly. Exemplarily, as Figure 2As shown, the master device and the slave device can be connected to the security domain switch to receive the target data sent by the user network of the security domain through the security domain switch, or can be connected to the non-security domain switch to receive the target data sent by the front-end network of the non-security domain through the non-security domain switch. The security domain switch sends the target data to the master device through the first port GE2, and the target data is mirrored from the first port GE2 to the second port GE3 and forwarded to the slave device. The master device processes the target data and forwards it to the non-security domain switch, and the slave device only processes the target data and does not send it out, thereby achieving synchronization of the target data and the session, but the forwarding of the target data by the slave device will not cause network abnormalities.
[0043] The technical solution of the embodiment of the present application is executed by the master device, and the master device and the slave device are respectively connected to the forwarding device. The method includes: notifying the forwarding device to use the master device as the destination device for sending target data, so that the forwarding device sends the target data to the master device through the first port connected to the master device; setting the first port as the source port of data mirroring, and setting the second port as the destination port of data mirroring, so that the forwarding device mirrors the target data sent through the first port to the second port and sends it to the slave device; wherein the second port is the port on the forwarding device connected to the slave device. The above scheme sets the data mirroring from the first port to the second port, so that the target data sent by the forwarding device to the master device through the first port can be mirrored to the second port and sent to the slave device through the second port, thereby realizing data synchronization between the master device and the slave device, solving the problem of data synchronization failure caused by abnormality of the master device in the scheme that relies on the master device for data synchronization, thereby improving the real-time performance and success rate of data synchronization.
[0044] Embodiment 2
[0045] Figure 3 This is a flow chart of a data processing method provided in the second embodiment of the present application. The present embodiment is optimized based on the above embodiment. For solutions not described in detail in the present embodiment, please refer to the above embodiment. Figure 3 As shown, the method of the embodiment of the present application specifically includes the following steps:
[0046] S210: Notify the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device.
[0047] S220. Detect whether there is an original configuration on the forwarding device; wherein the original configuration is that the second port is a source port of data mirroring, and the first port is a destination port of data mirroring.
[0048] Exemplary, before the slave device is converted to the master device, the original master device also executes the scheme in the above embodiment, performs the port setting of the forwarding device, and there is an original configuration, that is, the second port connected to the original master device is set as the source port of the data mirror, and the first port connected to the original slave device is set as the destination port of the data mirror. The master device sends status information to the slave device through the heartbeat line. If the master device is abnormal, it will no longer send status information to the slave device through the heartbeat line. The slave device detects the abnormality of the master device through the heartbeat line, then converts to the master device, and notifies the original master device to convert to the slave device through the heartbeat line, or the original master device detects the abnormality of its own interface or service and automatically converts to the slave device. After the original slave device is converted to the master device and the original master device is converted to the slave device, the forwarding device needs to send target data to the master device, so it is necessary to change the direction of the data mirror, set the first port connected to the master device as the source port of the data mirror, and set the second port connected to the slave device as the destination port of the data mirror. If the original configuration is not deleted at this time, it will affect the execution of the new configuration. It can be detected whether there is an original configuration on the forwarding device, which is convenient for subsequent targeted modification of the configuration.
[0049] S230: If yes, delete the original configuration.
[0050] Exemplarily, if there is an original configuration, the original configuration is deleted to avoid normal setting and execution of subsequent configurations.
[0051] S240, setting the first port as a source port for data mirroring, and setting the second port as a destination port for data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends it to the slave device.
[0052] The second port is a port on the forwarding device connected to the slave device.
[0053] For example, Figure 2 As shown, if Figure 2 In the middle firewall layer, the left side is the slave device, and the right side is the master device. The master device sets the GE2 port of the security domain switch as the source port of the data mirror, and the GE3 port as the destination port. The GE6 port of the non-security domain switch is set as the source port of the data mirror, and the GE7 port is set as the destination port. If the master and slave devices are switched, such as Figure 4As shown in the figure, the left side of the firewall layer is converted to the master device, and the right side is the slave device. The master device deletes the original configuration, that is, the configurations of "GE2 port is the source port of data mirroring, GE3 port is the destination port" and "GE6 port is the source port of data mirroring, and GE7 port is the destination port" are deleted, and the GE3 port of the security domain switch is set as the source port of data mirroring, and the GE2 port is set as the destination port. The GE7 port of the non-security domain switch is set as the source port of data mirroring, and the GE6 port is set as the destination port, thereby modifying the port configuration to realize data mirroring, so that the forwarding device synchronizes the target data sent to the master device to the slave device.
[0054] In an embodiment of the present application, the method further includes:
[0055] Add the remote login account of the forwarding device;
[0056] Accordingly, setting the first port as a source port of data mirroring and setting the second port as a destination port of data mirroring includes:
[0057] The forwarding device is logged in based on a remote login account of the forwarding device, and the first port is set as a source port of the data mirroring and the second port is set as a destination port of the data mirroring based on a remote control protocol.
[0058] Among them, the remote login account can be an account established according to the remote control protocol, such as a telnet account, which is used to enable one device to log in to another device and remotely control the other device. In the embodiment of the present application, the master device needs to modify the port configuration of the forwarding device and needs to remotely control the forwarding device, so the master device needs to add the remote login account of the forwarding device. When the forwarding device needs to be remotely controlled, the forwarding device is logged in based on the remote login account, and the first port is set as the source port of the data mirror based on the remote control protocol, and the second port is set as the destination port of the data mirror, thereby realizing the port configuration of the forwarding device to convert the data mirroring direction.
[0059] The embodiment of the present application provides a data processing method, which detects whether there is an original configuration on the forwarding device; wherein the original configuration is that the second port is the source port of the data mirror and the first port is the destination port of the data mirror; if so, the original configuration is deleted. The above scheme avoids the problem that the new configuration cannot be set or executed due to the original configuration not being deleted by detecting and deleting the original configuration, thereby ensuring that the master device can successfully perform the new configuration and complete the conversion of the data mirroring direction, so that the target data sent by the forwarding device can be mirrored to the port connected to the slave device so as to be received by the slave device, thereby realizing data synchronization between the master device and the slave device.
[0060] Embodiment 3
[0061] Figure 5 This is a flow chart of a data processing method provided in Embodiment 3 of the present application. The present embodiment is optimized based on the above embodiment. For solutions not described in detail in the present embodiment, please refer to the above embodiment. Figure 5 As shown, the method of the embodiment of the present application specifically includes the following steps:
[0062] S310: Notify the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device.
[0063] S320, setting the first port as a source port for data mirroring, and setting the second port as a destination port for data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends it to the slave device.
[0064] The second port is a port on the forwarding device connected to the slave device.
[0065] S330, detecting data to be processed whose destination address is a slave device; wherein the data to be processed is sent by the forwarding device when the slave device acts as a master device.
[0066] Exemplarily, when an abnormality occurs in the original master device, there may be data to be processed that has been sent to the original master device, and this part of the target data cannot be processed normally due to the abnormality of the original master device. When the forwarding device sends the data to be processed to the original master device, it also sends the data to be processed to the original slave device through port mirroring. After the original slave device is converted to the master device, the part of the data to be processed can continue to be processed to ensure the normal processing of the data to be processed. Specifically, the master device can detect the data with the destination address of the slave device as the data to be processed from the received data, that is, detect the data with the destination address of the original master device as the data to be processed.
[0067] In an embodiment of the present application, detecting data to be processed whose destination address is a slave device includes:
[0068] The detection starts from the conversion to the master device until the target data is received and the destination address is the to-be-processed data of the slave device.
[0069] Exemplarily, before the original master device has an abnormality, the target data sent by the forwarding device is still processed and forwarded by the original master device. When the original master device has an abnormality, the data received from that moment on cannot be processed normally, and the original slave device is converted to a master device. The master device detects the conversion to the master device, that is, the abnormality of the original master device begins, until the master device receives the target data within the time period, and the destination address received is the pending data of the slave device, that is, the destination address is the pending data of the original master device, so as to specifically process the pending data that has been sent by the forwarding device within the time period but has not been processed by the original master device in time, thereby avoiding that this part of the data cannot be processed normally and is directly discarded.
[0070] S340: Process the data to be processed.
[0071] Exemplarily, the master device processes the data to be processed by establishing a session, recording access logs, and forwarding traffic. Figure 2 and Figure 4 In the application scenario, when the electronic device acts as a slave device, it receives the target data sent by the forwarding device through data mirroring and processes the target data, such as establishing a session and recording an access log. When the electronic device is converted to a master device, it processes the data to be processed, including processes such as establishing a session, recording an access log, and forwarding traffic. The master device also processes the target data sent by the forwarding device, including processes such as establishing a session, recording an access log, and forwarding traffic.
[0072] The embodiment of the present application provides a data processing method, which detects the data to be processed whose destination address is a slave device; wherein the data to be processed is sent by the forwarding device when the slave device acts as a master device; and processes the data to be processed. The above scheme can detect the data to be processed that has been sent by the forwarding device but has not been processed by the original master device in time, so as to process this part of the data to be processed, thereby avoiding the problem that the forwarding device has sent the data but the original master device has an abnormality and cannot process the part of the data normally, thereby ensuring the normal processing of the data without loss, and improving the stability of the master device and the slave device under abnormal conditions.
[0073] Embodiment 4
[0074] Figure 6 This is a schematic diagram of the structure of a data processing device provided in the fourth embodiment of the present application. The device can execute the data processing method provided in any embodiment of the present application and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device comprises:
[0075] The notification module 410 is used to notify the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through the first port connected to the main device;
[0076] A setting module 420, configured to set the first port as a source port for data mirroring and the second port as a destination port for data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends the target data to the slave device;
[0077] The second port is a port on the forwarding device connected to the slave device.
[0078] In the embodiment of the present application, the device further includes:
[0079] An original configuration detection module, used to detect whether there is an original configuration on the forwarding device; wherein the original configuration is that the second port is a source port of data mirroring and the first port is a destination port of data mirroring;
[0080] The deleting module is used to delete the original configuration if so.
[0081] In the embodiment of the present application, the device further includes:
[0082] A remote login account adding module, used to add a remote login account of the forwarding device;
[0083] Accordingly, the setting module 420 includes:
[0084] A login unit is used to log in to the forwarding device based on the remote login account of the forwarding device, and set the first port as the source port of the data mirroring and the second port as the destination port of the data mirroring based on the remote control protocol.
[0085] In the embodiment of the present application, the device further includes:
[0086] A detection module, used for detecting data to be processed whose destination address is a slave device; wherein the data to be processed is sent by the forwarding device when the slave device acts as a master device;
[0087] A processing module is used to process the data to be processed.
[0088] In the embodiment of the present application, the detection module includes:
[0089] The to-be-processed data detection unit is used to detect the to-be-processed data whose destination address is the slave device and is received during the time period from the conversion to the master device to the reception of the target data.
[0090] In the embodiment of the present application, the device further includes:
[0091] The target data receiving module is used to receive the target data sent by the forwarding device through the first port according to the communication address of the main device, and process the target data.
[0092] In the embodiment of the present application, the notification module 410 includes:
[0093] The broadcast unit is used to broadcast the communication address message in the local area network, so that the forwarding device determines the communication address of the main device according to the communication address message, and sends the target data to the main device through the first port according to the communication address of the main device.
[0094] A data processing device provided in an embodiment of the present application can execute a data processing method provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method.
[0095] Embodiment 5
[0096] Figure 7 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0097] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0098] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0099] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a data processing method.
[0100] In some embodiments, the data processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).
[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0102] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0103] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or 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 foregoing.
[0104] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0105] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0106] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the information expected by the technical solution of this application can be achieved, and this document is not limited here.
[0108] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A data processing method, characterized in that: The method is executed by a master device, wherein the master device and the slave device are respectively connected to a forwarding device, and the method includes: Notify the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device; The first port is set as a source port of data mirroring, and the second port is set as a destination port of data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends the target data to the slave device; The second port is a port on the forwarding device connected to the slave device.
2. The method according to claim 1, characterized in that After notifying the forwarding device to use the main device as a destination device for sending target data, the method further includes: Detecting whether there is an original configuration on the forwarding device; wherein the original configuration is that the second port is a source port of data mirroring and the first port is a destination port of data mirroring; If so, the original configuration is deleted.
3. The method according to claim 1, characterized in that The method further comprises: Add the remote login account of the forwarding device; Accordingly, setting the first port as a source port of data mirroring and setting the second port as a destination port of data mirroring includes: The forwarding device is logged in based on a remote login account of the forwarding device, and the first port is set as a source port of the data mirroring and the second port is set as a destination port of the data mirroring based on a remote control protocol.
4. The method according to claim 1, characterized in that: The method further comprises: Detecting data to be processed whose destination address is a slave device; wherein the data to be processed is sent by the forwarding device when the slave device acts as a master device; The data to be processed is processed.
5. The method according to claim 4, characterized in that Detect the data to be processed by the slave device whose destination address is: The detection starts from the conversion to the master device until the target data is received and the destination address is the to-be-processed data of the slave device.
6. The method according to claim 1, characterized in that The method further comprises: Receive target data sent by the forwarding device through the first port according to the communication address of the main device, and process the target data.
7. The method according to claim 1, characterized in that Notifying the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device, comprising: The communication address message is broadcasted in the local area network, so that the forwarding device determines the communication address of the master device according to the communication address message, and sends target data to the master device through the first port according to the communication address of the master device.
8. A data processing device, characterized in that: The device is configured on a master device, wherein the master device and the slave device are respectively connected to a forwarding device, and the device comprises: a notification module, used for notifying the forwarding device to use the main device as a destination device for sending target data, so that the forwarding device sends the target data to the main device through a first port connected to the main device; A setting module, used to set the first port as a source port of data mirroring and the second port as a destination port of data mirroring, so that the forwarding device mirrors the target data sent via the first port to the second port and sends the target data to the slave device; The second port is a port on the forwarding device connected to the slave device.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method according to any one of claims 1 to 7 when executed.