Data transmission method for reducing serial port communication radio frequency interference, electronic equipment and medium

By receiving and frame-verifying message data in RF disabled mode and sending data in RF enabled mode, the problem of serial communication anomalies caused by RF interference is solved, and the integrity and reliability of data transmission are achieved.

CN121367568APending Publication Date: 2026-01-20SHENZHEN NEOWAY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511459537.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

In existing technologies, radio frequency interference generated by cellular network modules during radio frequency operation affects the serial communication between the main control MCU and the communication module, leading to abnormal data transmission.

Method used

In RF disabled mode, the system receives message data from the main control module via serial communication and performs frame verification. If the frame verification passes, the system switches to RF enabled mode to send data to the server. The system ensures the integrity and reliability of data transmission through RF mode switching and time-division mechanism.

Benefits of technology

It reduces the impact of radio frequency interference on data transmission during serial communication, ensures data integrity and reliability, avoids data transmission anomalies, and improves the real-time performance and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121367568A_ABST
    Figure CN121367568A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data transmission and communication, and discloses a data transmission method for reducing serial port communication radio frequency interference, electronic equipment and a medium, and the method comprises the steps: receiving message data of a main control module through a serial port in a radio frequency forbidden mode; carrying out integrity judgment on the received message data through frame verification; and if the frame verification is passed, processing the message data passing the frame verification and then sending the processed message data to a server in a radio frequency available mode. According to the invention, a radio frequency function is not started during serial port communication, so that the influence of radio frequency interference on data transmission during serial port communication is reduced, the integrity of data is preliminarily ensured, and the abnormity of data transmission is avoided; then frame verification is carried out, so that the integrity of the data is further ensured; after the serial port communication is finished, the radio frequency function is started again, the data passing the frame verification is sent to the server side, and the data integrity and reliability of each data transmission stage are guaranteed through switching of the radio frequency mode and a time-sharing mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data transmission and communication, and particularly relates to a data transmission method for reducing radio frequency interference of serial port communication, an electronic device and a medium. BACKGROUND

[0002] If an electronic device or a smart device (for example, a smart electricity meter, a smart water meter, a shared electric vehicle, etc.) adopts a design scheme in which a communication module communicates with a master control MCU through serial port communication (for example, UART serial port communication), when the communication module (for example, a cellular network module) works in radio frequency, radio frequency interference is generated, which affects the serial port communication between the master control MCU and the communication module, and further causes data transmission abnormity. SUMMARY

[0003] The main purpose of the present application is to provide a data transmission method, device, equipment and storage medium, aiming at solving the technical problem that radio frequency interference of serial port communication causes data transmission abnormity in the prior art.

[0004] The first aspect of the present application provides a data transmission method for reducing radio frequency interference of serial port communication, applied to a communication module of an electronic device, the electronic device further comprising a master control module in serial port communication with the communication module, and the data transmission method for reducing radio frequency interference of serial port communication comprises the following steps. In the radio frequency disabled mode, receiving message data of the master control module through serial port communication; Judging the integrity of the received message data through frame checking; If the frame checking is passed, switching to the radio frequency available mode, and sending the message data passed by the frame checking to a server end after processing.

[0005] The present application further provides an electronic device, comprising a master control module and a communication module in serial port communication, and the communication module is used for performing data transmission with the master control module and a server end respectively according to the data transmission method for reducing radio frequency interference of serial port communication.

[0006] The present application further provides a computer device, comprising a memory and at least one processor, the memory stores instructions; the at least one processor invokes the instructions in the memory, so that the computer device executes the data transmission method for reducing radio frequency interference of serial port communication.

[0007] The present application further provides a computer readable storage medium, which stores instructions, and when the instructions are run on a computer, the computer executes the data transmission method for reducing radio frequency interference of serial port communication.

[0008] The application provides a data transmission method for reducing radio frequency interference in serial port communication, electronic equipment and medium. Radio frequency function is not enabled during serial port communication, so as to reduce the influence of radio frequency interference on data transmission during serial port communication, preliminarily ensure the integrity of data and avoid data transmission abnormity. Frame check is then performed to further ensure the integrity of data. After serial port communication is completed, the radio frequency function is enabled again, and data passing frame check is sent to a server end. The application ensures the integrity and reliability of data in each data transmission stage through switching of radio frequency modes and time-sharing mechanism. BRIEF DESCRIPTION OF DRAWINGS

[0009] Figure 1 A first embodiment flowchart of the data transmission method for reducing radio frequency interference in serial port communication in the embodiments of the application is shown. Figure 2 An embodiment function module diagram of the electronic equipment in the embodiments of the application is shown. Figure 3 An embodiment diagram of the computer equipment in the embodiments of the application is shown. DETAILED DESCRIPTION

[0010] The terms "first", "second", "third", "fourth" and the like in the specification and claims of the application and the above drawings (if any) are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" or "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0011] Existing intelligent devices generally adopt a design scheme in which a cellular module communicates with a master control MCU through, for example, a UART serial port. However, when the cellular network module works in radio frequency, radio frequency interference under extreme conditions may affect serial port communication between the master control MCU and the module, resulting in data transmission abnormity.

[0012] Based on this, the application provides a data transmission scheme for reducing radio frequency interference in serial port communication.

[0013] REFERENCE Figure 1 The application provides a data transmission method for reducing radio frequency interference in serial port communication, applied to a communication module of electronic equipment, the electronic equipment further comprising a master control module in communication with the communication module through a serial port. The data transmission method comprises the following steps. S100: receiving the message data of the master module through serial communication in the radio frequency disabled mode.

[0014] Specifically, the communication module of the electronic device can be a cellular module or a cellular network module. The communication module can interact with the master module through serial communication, and can also interact with the server through network air interface communication. The serial communication can be UART serial communication, or other serial communication, and the application does not limit the serial communication.

[0015] When the communication module and the master module interact with each other, the communication module is in the radio frequency disabled mode, so that the communication module only interacts with the master module and does not actively communicate with the server, so that the communication module does not enable the radio frequency function, thereby blocking the radio frequency interference during serial communication, and ensuring the integrity and reliability of the serial communication data.

[0016] S200: performing integrity judgment on the received message data through frame checking.

[0017] Specifically, the message data transmitted by the master module includes original data and first check data obtained by frame checking the original data. The communication module analyzes the received message data to obtain the original data and the first check data generated by the master module, then performs the same frame checking on the original data to obtain second check data, and compares the first check data with the second check data. If the first check data and the second check data are the same, it means that the frame checking is successful, otherwise the frame checking fails or is abnormal. The frame checking can be used to judge the integrity of the message data. If there is no abnormality in the data transmission during the UART serial communication, the data received by the communication module is the same as the data transmitted by the master module. If there is a transmission abnormality, the received data is different from the transmitted data.

[0018] S300: If the frame checking is passed, switch to the radio frequency available mode, and send the message data passed by the frame checking to the server after processing.

[0019] Specifically, the radio frequency available mode means that the communication module can interact with the server. If the frame checking is passed, the communication module is switched from the radio frequency disabled mode to the radio frequency available mode, and the network data service is restored. The communication module can send the message data passed by the frame checking and processed to the server through radio frequency. The communication module can encapsulate the original data in the message data and send it to the server, or can package and encapsulate the original data and the second frame check data and then send it to the server, or can encrypt and then send it, and the application does not limit the above operations.

[0020] It should be noted that the communication module can work in a radio frequency disabled mode or a radio frequency available mode. The working mode of the communication module can be switched by the communication module itself or by the master module, and the present application does not limit this.

[0021] In addition, before step S100, the communication module will also be powered on and networked, ensuring that the data dialing state is normal, so as to communicate with the server in time when necessary.

[0022] In the present embodiment, the radio frequency disabled mode and the radio frequency available mode are switched. When the communication module communicates with the master MCU, the radio frequency is kept closed first, and then is opened after the data is received and verified to be complete, thereby avoiding radio frequency interference and improving the reliability and real-time performance of data transmission. In the present embodiment, the communication process is optimized to ensure that the communication module performs serial communication and air interface communication in time, thereby reducing radio frequency interference during serial communication, reducing or avoiding the generation of dirty data, and improving the data transmission integrity and reliability of the electronic device.

[0023] The present embodiment implements a data transmission scheme that resists radio frequency interference during serial communication. The radio frequency function is not enabled during serial communication, thereby reducing the impact of radio frequency interference on data transmission during serial communication, preliminarily ensuring the integrity of the data, and avoiding data transmission anomalies. Frame verification is then performed to further ensure the integrity of the data. After the serial communication is completed, the radio frequency function is enabled to send the data that passes the frame verification to the server, and the present embodiment ensures the integrity and reliability of the data in each data transmission stage through the switching of the radio frequency mode and the time-sharing mechanism.

[0024] In one embodiment, the radio frequency disabled mode includes a first radio frequency disabled mode and a second radio frequency disabled mode. In the first radio frequency disabled mode, the communication module suspends active one-way communication with the server, thereby cutting off the radio frequency interference caused by active one-way communication. In the second radio frequency disabled mode, the communication module suspends the receiving and transmitting functions of the communication with the server, thereby cutting off the radio frequency interference caused by the receiving and transmitting of data.

[0025] Specifically, the first radio frequency disabled mode is used to disable the function of the communication module to actively send data to the server, but does not disable the function of the server to actively send data or instructions to the communication module. That is, in the first radio frequency disabled mode, the server can still actively request data or send instructions to the communication module in one direction, and the communication module can receive the request or instructions sent by the server.

[0026] Since the communication module does not actively send data to the server in the first radio frequency disabled mode, the radio frequency of the communication module is equivalent to being closed, thereby reducing or eliminating radio frequency interference during serial communication.

[0027] The second radio frequency disable mode can be understood as a flight mode or an air interface communication disable mode, the GSM / GPRS module is turned off to cut off the function of communication signal, the communication module does not actively send a paging signal to the base station, does not try to contact the base station, and cannot receive data from the base station. In the second radio frequency disable mode, the communication module suspends the function of receiving data sent from the server end and the function of sending data to the server end. In the second radio frequency disable mode, the communication module cannot transmit and receive data, and therefore, radio frequency interference caused by air interface communication can be eliminated.

[0028] In the second radio frequency disable mode, the server end can still request data from the communication module or send instructions. Since the communication module is in a network interruption state or a network data service interruption state at this time, even if the server end requests data from the communication module or sends instructions, the server end will not receive a response from the communication module.

[0029] In an embodiment, the data transmission method for reducing radio frequency interference of serial port communication further comprises: If the frame check is abnormal, a retransmission mechanism is triggered, the message data of the master control module is received again through serial port communication, and the integrity of the newly received message data is judged through frame check until the frame check is passed.

[0030] Specifically, when a frame check error occurs, the frame check is abnormal. In the absence of radio frequency interference, data transmission abnormalities may also occur due to the master control module or the communication module itself. Therefore, this embodiment can handle data transmission abnormality conditions other than radio frequency interference to ensure the correctness and integrity of data transmission.

[0031] In this embodiment, the message data with frame check error in the radio frequency disable mode is also retransmitted in the serial port communication process. The communication module can send a retransmission request to the master control module, and the master control module re-sends the message data that is not completely transmitted or has an error to the communication module in response to the retransmission request. The communication module can discard or destroy the message data with frame check abnormality to reduce memory occupation.

[0032] Each time the message data is retransmitted, the communication module performs corresponding frame check on the newly received message data, and if the frame check is passed, the retransmission is stopped. Then, the radio frequency usable mode is switched to, and the message data that passes the frame check is sent to the server end after processing in the radio frequency usable mode.

[0033] It should be noted that the communication module is still in the radio frequency disable mode during retransmission, and switches to the radio frequency usable mode only after the frame check is successful. Therefore, radio frequency interference can still be effectively avoided during retransmission.

[0034] The embodiment can still obtain correct and complete data through retransmission mechanism in the radio frequency disabled mode when frame check error occurs, and ensures normal transmission of data.

[0035] The application can fundamentally avoid the influence of long-term radio frequency interference on serial communication in a short period, and ensure the reliability and real-time performance of data transmission.

[0036] In one embodiment, the data transmission method for reducing radio frequency interference of serial communication further comprises: In the radio frequency available mode, if the first data request of the server end is received, the radio frequency disabled mode is switched to, and the second data request is sent to the host module in response to the first data request; The response data returned by the host module based on the second data request is received; The integrity of the response data is judged through frame check; If the frame check passes, the radio frequency available mode is switched to, and the response data passing the frame check is sent to the server end after processing.

[0037] Specifically, in the radio frequency available mode, the communication module has restored network data service, and the communication module has data transceiving function of bidirectional communication with the server end, that is, can actively send data to the server end, and can receive data or instructions sent by the server end. In addition, in the radio frequency available mode, the communication module does not perform serial communication with the host module. Therefore, in the radio frequency available mode, the communication module can receive the first data request sent by the server end at any time.

[0038] The electronic device reports data to the server end at a certain frequency, for example, reports data once every 1 hour. During the period without reporting data to the server end, the communication module can perform serial communication with the host module in the radio frequency disabled mode. The server end actively requests data, which may be because the user instruction is received, and the latest data needs to be obtained, so the server end needs to send a query request to the electronic device.

[0039] In order to respond to the first data request, the communication module needs to perform serial communication with the host module to obtain the data requested by the server end from the host module. In order to ensure that the serial communication is not interfered or the radio frequency interference is reduced, at this time, the communication module needs to be switched from the radio frequency available mode to the radio frequency disabled mode.

[0040] After the communication module enters the radio frequency disabled mode, a new round of serial port communication with the host module is started. More specifically, the communication module generates a second data request based on the first data request and sends the second data request to the host module through serial port communication. After receiving the second data request, the host module queries the corresponding data, generates response data based on the queried data, and returns the response data to the communication module through serial port communication. After receiving the response data through serial port communication, the communication module performs frame check integrity judgment on the response data. If the frame check of the response data is passed, the communication module switches from the radio frequency disabled mode to the radio frequency available mode, and processes the response data after the frame check is passed and sends it to the server end.

[0041] After receiving the data request of the server end, the embodiment can still conveniently switch from the radio frequency available mode to the radio frequency disabled mode, and then respond to the data request of the server end by serial port communication with the host module in the radio frequency disabled mode to obtain response data in the case of reducing or eliminating radio frequency interference, and further perform frame check after obtaining the corresponding response data, thereby further ensuring the integrity and accuracy of the response data, and finally switch back to the radio frequency available mode to send the accurate response data to the server end. The embodiment realizes accurate data transmission through switching of the radio frequency mode.

[0042] In one embodiment, the data transmission method for reducing radio frequency interference of serial port communication further comprises: In the first radio frequency disabled mode, if the communication module is performing first serial port communication with the host module while receiving the first data request of the server end, the priority of the serial port communication with the host module and the air interface communication with the server end is determined; If the priority of the air interface communication is higher than that of the serial port communication, the first information for indicating suspension of the first serial port communication is sent to the host module; In the radio frequency disabled mode, a second data request is sent to the host module through new second serial port communication in response to the first data request; The response data returned by the host module based on the second data request is received; The integrity of the response data is judged through frame check; If the frame check is passed, the response data passed through the frame check is sent to the server end after processing in the radio frequency available mode.

[0043] Specifically, in the first RF disabled mode, the communication module has the function of receiving data from the server, but it does not have the function of actively sending data to the server. Although the communication module does not actively communicate with the server, the server can send data requests or instructions to the communication module, and the communication module can also receive data or instructions from the server. Simultaneously, the communication module is also engaged in serial communication with the main control module.

[0044] In the above scenario, if the communication module receives the first data request from the server, it needs to respond to the first data request and complete the first serial communication with the main control module in the absence of radio frequency interference. However, responding to the first data request requires active communication with the server, which inevitably introduces radio frequency interference.

[0045] Based on this, the communication module in this embodiment acts as a referee, and can process the first serial port communication and the first data request response in a time-sharing manner according to the service processing priority.

[0046] More specifically, the communication module determines the priority between serial communication with the main control module and air communication with the server. If the priority of air communication is higher than that of serial communication, the communication module responds to the first data request first and needs to suspend the first serial communication with the main control module. The first serial communication is a communication connection established to perform the corresponding serial data transmission task.

[0047] The communication module can send a first message to the main control module to instruct the main control module to pause or interrupt the first serial port communication. In response, the main control module will no longer send message data to the communication module. After pausing the first serial communication, the communication module still needs to communicate with the main control module via serial communication to obtain the data requested by the server in order to respond to the first data request. To ensure that the serial communication is not affected by radio frequency interference or to reduce radio frequency interference, the communication module still needs to be in radio frequency disabled mode. The communication module can remain in the first radio frequency disabled mode or switch from the first radio frequency disabled mode to the second radio frequency disabled mode; this embodiment does not impose any restrictions.

[0048] After the communication module enters the radio frequency disabled mode, a new round of second serial port communication with the host module is started. More specifically, the communication module generates a second data request based on the first data request and sends the second data request to the host module through serial port communication. After receiving the second data request, the host module queries the corresponding data, generates response data based on the queried data, and returns the response data to the communication module through serial port communication. After receiving the response data through serial port communication, the communication module performs frame check integrity judgment on the response data. If the frame check of the response data is passed, the communication module switches from the radio frequency disabled mode to the radio frequency available mode, and processes the response data after the frame check and sends it to the server end.

[0049] If the communication module receives a data request from the server end while performing serial port communication with the host module, the processing priority of serial port communication and air interface communication can be compared. If the air interface communication has higher priority, the current serial port communication is suspended, a new serial port communication is started, and the data request from the server end is responded to by serial port communication with the host module in the radio frequency disabled mode, so as to obtain response data in the case of reducing or eliminating radio frequency interference. After obtaining the corresponding response data, further frame check is performed to further ensure the integrity and accuracy of the response data. Finally, the radio frequency available mode is switched back to send the accurate response data to the server end. Through the switching of the radio frequency mode, the accurate transmission of data is realized. The processing order of serial port communication tasks and air interface communication tasks can be distinguished by priority, and the two types of tasks are processed in time division mode, so as to ensure that the serial port communication is not interfered by radio frequency and the user request is processed in time.

[0050] In one embodiment, after the response data passed by the frame check is processed and sent to the server end, the data transmission method for reducing radio frequency interference of serial port communication further comprises: In the radio frequency disabled mode, second information for indicating the resumption of the first serial port communication is sent to the host module, and the first serial port communication with the host module is resumed.

[0051] Specifically, after the communication module responds to the first data request from the server end, the interrupted first serial port communication needs to be continued to be processed to continue the serial data transmission. Based on this, the communication module needs to switch from the radio frequency available mode to the radio frequency disabled mode, and in the radio frequency disabled mode, second information for resuming the first serial port communication is sent to the host module. After receiving the second information, the host module resumes the first serial port communication with the communication module and continues to transmit the untransmitted message data to the communication module, so as to save the data transmission time. Alternatively, the host module can start from the beginning to retransmit the message data to the communication module through the first serial port communication, and the communication module will discard the message data that has not been completely received before, so as to ensure the integrity of the message data received from the beginning and avoid data duplication.

[0052] The embodiment resumes the first serial port communication which is previously suspended after responding to the data request of the server side in priority, and ensures that the unfinished serial port communication is continued to be completed in the radio frequency disabled mode.

[0053] In one embodiment, the data transmission method for reducing radio frequency interference of serial port communication further comprises: If the priority of the serial port communication is higher than the priority of the air interface communication, third information for indicating suspension of the air interface communication is sent to the server side after switching to the radio frequency available mode, or switching from the first radio frequency disabled mode to the second radio frequency disabled mode. The first serial port communication with the host module is continued until the first serial port communication is ended in the radio frequency disabled mode or in the second radio frequency disabled mode. In response to the first data request, a second data request is sent to the host module through a new second serial port communication. Response data returned by the host module based on the second data request is received. The response data is subjected to integrity judgment through frame check. If the frame check passes, the response data which passes the frame check is sent to the server side in the radio frequency available mode.

[0054] Specifically, in the first radio frequency disabled mode, if the communication module receives the first data request of the server side while the communication module is performing the first serial port communication with the host module, the communication module as a referee processes the first serial port communication and the first data request response according to the business processing priority in time.

[0055] More specifically, the communication module judges the priority between the serial port communication with the host module and the air interface communication with the server side, and if the priority of the serial port communication is higher than the priority of the air interface communication, the communication module responds to the serial port communication in priority, continues the first serial port communication with the host module, and temporarily does not respond to the first data request, wherein the first serial port communication is a communication connection established for performing a corresponding serial port data transmission task.

[0056] In the process of continuing the first serial port communication with the host module, the communication module can still be in the first radio frequency disabled mode, but needs to actively send third information to the server side to indicate that the server side suspends the air interface communication, so that the server side does not send data request to the communication module in the first radio frequency disabled mode, and the communication module can continue the first serial port communication with the host module without radio frequency interference.

[0057] In the process of continuing the first serial port communication with the master module, the communication module can also be switched from the first radio frequency disabled mode to the second radio frequency disabled mode. In the second radio frequency disabled mode, the communication module cannot receive and send messages from the server end, even if the server end repeatedly sends the first data request to the communication module frequently because it does not receive the response data of the communication module based on the first data request, the first serial port communication between the communication module and the master module will not be interfered by radio frequency.

[0058] The communication module continues the first serial port communication with the master module until the first serial port communication ends. Then the communication module starts responding to the first data request and starts a new round of second serial port communication with the master module. More specifically, the communication module generates a second data request based on the first data request and sends the second data request to the master module through serial port communication. After receiving the second data request, the master module queries the corresponding data, generates response data based on the queried data, and returns the response data to the communication module through serial port communication. After receiving the response data through serial port communication, the communication module performs frame check integrity judgment on the response data. If the frame check of the response data is passed, the communication module is switched from the radio frequency disabled mode (first radio frequency disabled mode or second radio frequency disabled mode) to the radio frequency available mode, and processes the response data after the frame check is passed and sends it to the server end.

[0059] In this embodiment, if the communication module receives a data request from the server end while communicating with the master module through the serial port, it can compare the processing priorities of serial port communication and air interface communication. In the case of high priority of serial port communication, the data request is not responded to, but the server end is notified to suspend air interface communication or switch to the second radio frequency disabled mode to avoid further data request from the server end, so as to ensure that the first serial port communication is not interfered by radio frequency in the process of continuing, and the communication module starts responding to the data request after the first serial port communication ends, and starts a new second serial port communication, and responds to the data request from the server end by serial port communication in the radio frequency disabled mode, so as to obtain the response data in the case of reducing or eliminating radio frequency interference, and further frame check after obtaining the corresponding response data, further ensuring the integrity and accuracy of the response data, and finally switching back to the radio frequency available mode to send the accurate response data to the server end. In this embodiment, the accurate transmission of data is realized by switching the radio frequency mode, the processing order of serial port communication task and air interface communication task can be distinguished by priority, and the two types of tasks are processed in time, so as to ensure that the serial port communication is not interfered by radio frequency and the user request is processed in time.

[0060] In one embodiment, the data transmission method for reducing radio frequency interference of serial port communication further comprises: If the priority of the serial communication is higher than the priority of the air interface communication, the fourth information for suspending the first serial communication is sent to the host module, and the third information for indicating suspension of the air interface communication is sent to the server in the radio frequency available mode; In the radio frequency disabled mode, the fifth information for indicating resumption of the first serial communication is sent to the host module, and the first serial communication with the host module is resumed until the first serial communication ends. In response to the first data request, the second data request is sent to the host module through the new second serial communication; The response data returned by the host module based on the second data request is received; The integrity of the response data is judged through frame checking; If the frame checking passes, the response data that passes the frame checking is sent to the server in the radio frequency available mode.

[0061] Specifically, if the processing priority of the serial communication is higher than the air interface communication, the communication module needs to inform the server not to send data requests again, but sending the third information to the server by the communication module will cause radio frequency interference, therefore, before sending the third information, the communication module first informs the host module to suspend the first serial communication. Then the communication module is switched from the first radio frequency disabled mode to the radio frequency available mode, and the third information for indicating suspension of the air interface communication is sent to the server in the radio frequency available mode. In this way, the server will not send data requests to the communication module again.

[0062] Then, the communication module is switched from the radio frequency available mode to the radio frequency disabled mode, at this time, the radio frequency disabled mode can be the first radio frequency disabled mode or the second radio frequency disabled mode. In the radio frequency disabled mode, the communication module sends the fifth information to the host module to instruct the host module to resume the first serial communication to continue to complete the first serial communication that has not been completed.

[0063] The communication module and the host module continue the first serial communication until the first serial communication ends. Then the communication module starts to respond to the first data request and starts a new round of second serial communication with the host module. More specifically, the communication module generates a second data request based on the first data request and sends the second data request to the host module through serial communication. After receiving the second data request, the host module queries the corresponding data and generates response data based on the queried data, and returns the response data to the communication module through serial communication. After receiving the response data through serial communication, the communication module performs frame checking integrity judgment on the response data. If the frame checking of the response data passes, the communication module is switched from the radio frequency disabled mode (the first radio frequency disabled mode or the second radio frequency disabled mode) to the radio frequency available mode, and the response data that passes the frame checking is processed and sent to the server.

[0064] The communication module sends fourth information to the host module to suspend the first serial port communication before sending third information to the server end to indicate suspension of air interface communication, which can effectively avoid radio frequency interference to the first serial port communication when the third information is sent. If the communication module receives a data request from the server end while performing serial port communication with the host module, the processing priority of the serial port communication and the air interface communication can be compared. In the case of high serial port communication priority, the data request is not responded to, and the server end is notified to suspend air interface communication to avoid further data requests from the server end, thereby ensuring that the first serial port communication is not affected by radio frequency interference. After the first serial port communication is completed, the communication module begins to respond to the data request and starts a new second serial port communication. In the radio frequency disabled mode, the serial port communication with the host module is performed to respond to the data request from the server end, so that the response data is obtained in the case of reduced or eliminated radio frequency interference. After the corresponding response data is obtained, further frame checking is performed to further ensure the integrity and accuracy of the response data. Finally, the radio frequency enabled mode is switched back to send accurate response data to the server end. Through the switching of the radio frequency mode, the present embodiment realizes accurate data transmission. The priority can be used to distinguish the processing order of the serial port communication task and the air interface communication task, and the two types of tasks are processed in time division mode to ensure that the serial port communication is not affected by radio frequency interference and the user request is processed in time.

[0065] Reference Figure 2 The present application also provides an electronic device including a host module 10 and a communication module 20 for performing data transmission with the host module 10 and a server end through serial port communication.

[0066] Specifically, the communication module 20 performs data transmission with the host module 10 through, for example, UART serial port communication, and also performs data transmission with the server end through air interface communication. The present embodiment ensures that the serial port communication and the air interface communication are performed in time division mode as much as possible, so that the communication module does not interact with the server end as much as possible during serial port data transmission, and further ensures that the serial port data transmission is not affected by radio frequency interference.

[0067] The data transmission scheme of the communication module 20 based on time division communication is described above in the description of the data transmission method for reducing radio frequency interference to serial port communication, which will not be described again here.

[0068] The electronic device of the present embodiment is not limited to a meter, a water meter, etc., but can also be a shared tram, etc. As long as the MCU and the communication module are devices that perform serial port communication, the present scheme can be used.

[0069] If the electronic device is a smart meter, the message data can include meter data, such as current, sensor data of the power system, user power consumption data, etc., which are not limited in the present application. The smart meter actively uploads data to the server side, which can be 1 hour or at intervals for a certain period of time.

[0070] Compared with the traditional scheme, the application coordinates the communication flow of the communication module and the master module and the communication module and the server through the time-sharing mechanism, that is, the radio frequency is closed or the data interaction with the server is stopped when the communication module and the master module communicate through the serial port, and the radio frequency is started again after the data is received and verified to be complete, which effectively avoids the influence of long-time concentrated interference of the radio frequency on the serial port communication which is difficult to recover. This mechanism can improve the reliability of data transmission, reduce data transmission failure caused by radio frequency interference, reduce the power consumption of the electronic device, prolong the service life of the electronic device, while ensuring the real-time performance of data transmission, and meet the real-time performance requirements of the server for data.

[0071] Figure 3 The computer device 7000 can have a relatively large difference due to different configurations or performances, and can include one or more processors (central processing units, CPUs) 710 (for example, one or more processors) and a memory 720, one or more storage media 730 (for example, one or more mass storage devices) storing application programs 733 or data 732. The memory 720 and the storage medium 730 can be temporary storage or persistent storage. The programs stored in the storage medium 730 can include one or more modules (not shown in the figure), each of which can include a series of instruction operations in the computer device 7000. Further, the processor 710 can be configured to communicate with the storage medium 730 and execute a series of instruction operations in the storage medium 730 on the computer device 7000.

[0072] The computer device 7000 can also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input / output interfaces 760, and / or one or more operating systems 731, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art can understand that, Figure 3 The computer device structure shown does not constitute a limitation on the computer device, and can include more or fewer components than shown, or combine certain components, or different component arrangements.

[0073] The application further provides a computer device including a memory and a processor, the memory stores computer readable instructions, and the computer readable instructions are executed by the processor to make the processor execute the steps of the data transmission method for reducing radio frequency interference of serial port communication in the above embodiments. The application further provides a computer readable storage medium, which can be a non-volatile computer readable storage medium or a volatile computer readable storage medium, and the computer readable storage medium stores instructions, and the instructions make the computer execute the steps of the data transmission method for reducing radio frequency interference of serial port communication when the instructions are run on the computer.

[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.

[0075] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in the embodiments of the application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0076] The above-described embodiments are only used to illustrate the technical solutions of the application, rather than limit them; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application.

Claims

1. A data transmission method for reducing radio frequency interference in serial communication, applied to a communication module of an electronic device, wherein the electronic device further includes a main control module that communicates with the communication module via a serial port, characterized in that, The data transmission method for reducing radio frequency interference of serial port communication comprises: In the radio frequency disabled mode, receiving message data of a master control module through serial port communication; Judging the integrity of the received message data through frame check; If the frame check is passed, switching to the radio frequency available mode, and sending the message data passed by the frame check to a server end after processing.

2. The data transmission method of claim 1, wherein, The radio frequency disabled mode comprises a first radio frequency disabled mode and a second radio frequency disabled mode; In the first radio frequency disabled mode, the communication module suspends active one-way communication with the server end to cut off the radio frequency interference caused by the active one-way communication; In the second radio frequency disabled mode, the communication module suspends the receiving and sending functions of the communication with the server end to cut off the radio frequency interference caused by the receiving and sending data.

3. The data transmission method of claim 1 or 2, wherein, The data transmission method for reducing radio frequency interference of serial port communication further comprises: If the frame check is abnormal, triggering a retransmission mechanism, receiving the message data of the master control module through serial port communication again, and judging the integrity of the newly received message data through frame check until the frame check is passed.

4. The data transmission method of claim 2, wherein, The data transmission method for reducing radio frequency interference of serial port communication further comprises: In the radio frequency available mode, if a first data request of the server end is received, switching to the radio frequency disabled mode, sending a second data request to the master control module in response to the first data request; Receiving response data returned by the master control module based on the second data request; Judging the integrity of the response data through frame check; If the frame check is passed, switching to the radio frequency available mode, and sending the response data passed by the frame check to the server end after processing.

5. The data transmission method of claim 2, wherein, The data transmission method for reducing radio frequency interference of serial port communication further comprises: In the first radio frequency disabled mode, if the first data request of the server end is received while the communication module is performing first serial port communication with the master control module, judging the priority of the serial port communication with the master control module and the air interface communication with the server end; If the priority of the air interface communication is higher than that of the serial port communication, sending first information to the master control module for indicating suspension of the first serial port communication; In the radio frequency disabled mode, sending a second data request to the master control module through new second serial port communication in response to the first data request; Receiving response data returned by the master control module based on the second data request; Judging the integrity of the response data through frame check; If the frame check is passed, in the radio frequency available mode, sending the response data passed by the frame check to the server end after processing.

6. The data transmission method of claim 5, wherein, After the response data passed by the frame check is sent to the server end after processing, the data transmission method for reducing radio frequency interference of serial port communication further comprises: In the radio frequency disabled mode, sending second information to the master control module for indicating resumption of the first serial port communication, and resuming the first serial port communication with the master control module.

7. The data transmission method of claim 5 or 6, wherein, The data transmission method for reducing radio frequency interference of serial port communication further comprises: If the priority of the serial port communication is higher than that of the air interface communication, sending third information to the server end for indicating suspension of the air interface communication after switching to the radio frequency available mode, or switching from the first radio frequency disabled mode to the second radio frequency disabled mode; Switching from the radio frequency available mode to the radio frequency disabled mode or in the second radio frequency disabled mode, continuing the first serial port communication with the master module until the first serial port communication ends; In response to the first data request, sending a second data request to the master module through a new second serial port communication; Receiving response data returned by the master module based on the second data request; Performing integrity judgment on the response data through frame check; If the frame check passes, sending the response data that passes the frame check to the server in the radio frequency available mode.

8. The data transmission method of claim 5 or 6, wherein, The data transmission method for reducing radio frequency interference of serial port communication further comprises: If the priority of the serial port communication is higher than the priority of the air interface communication, sending fourth information for suspending the first serial port communication to the master module, and sending third information for indicating suspension of the air interface communication to the server in the radio frequency available mode; In the radio frequency disabled mode, sending fifth information for indicating resumption of the first serial port communication to the master module, resuming the first serial port communication with the master module until the first serial port communication ends; In response to the first data request, sending a second data request to the master module through a new second serial port communication; Receiving response data returned by the master module based on the second data request; Performing integrity judgment on the response data through frame check; If the frame check passes, sending the response data that passes the frame check to the server in the radio frequency available mode.

9. An electronic device, comprising: The electronic device comprises a master module and a communication module for serial port communication, and the communication module is configured to perform data transmission with the master module and the server according to the data transmission method for reducing radio frequency interference of serial port communication in any one of claims 1-8.

10. A computer-readable storage medium having stored thereon instructions, the instructions comprising, The instructions are executed by the processor to implement the data transmission method for reducing radio frequency interference of serial port communication in any one of claims 1-8.