CN114564414A - Debugging method, device and storage medium - Google Patents

Debugging method, device and storage medium Download PDF

Info

Publication number
CN114564414A
CN114564414A CN202210456515.7A CN202210456515A CN114564414A CN 114564414 A CN114564414 A CN 114564414A CN 202210456515 A CN202210456515 A CN 202210456515A CN 114564414 A CN114564414 A CN 114564414A
Authority
CN
China
Prior art keywords
debugged
equipment
register
data
configuration parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210456515.7A
Other languages
Chinese (zh)
Other versions
CN114564414B (en
Inventor
邓冠兵
赵洪鹏
陈晓辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Easylinkin Technology Co ltd
Original Assignee
Wuhan Easylinkin Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Easylinkin Technology Co ltd filed Critical Wuhan Easylinkin Technology Co ltd
Priority to CN202210456515.7A priority Critical patent/CN114564414B/en
Publication of CN114564414A publication Critical patent/CN114564414A/en
Application granted granted Critical
Publication of CN114564414B publication Critical patent/CN114564414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • G06F11/3656Software debugging using additional hardware using a specific debug interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a debugging method, a debugging device and a storage medium. The method comprises the following steps: under the condition that a debugging instruction for equipment to be debugged is detected, acquiring the equipment model of the equipment to be debugged; determining a target register corresponding to the equipment model from at least one preset register; determining initial reference configuration parameters of the equipment to be debugged from the target register; debugging the equipment to be debugged according to the initial reference configuration parameters; and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters. Therefore, when the equipment to be debugged is debugged, the original factory technical document of the equipment to be debugged does not need to be checked, automatic debugging of the equipment to be debugged can be achieved through the electronic equipment, efficient management of data can be achieved, and convenience of user operation can be improved.

Description

Debugging method, device and storage medium
Technical Field
The present application relates to a device debugging technology, and in particular, to a debugging method, a debugging apparatus, and a storage medium.
Background
In the related technology, when debugging the device to be debugged, generally, a user needs to read and write the content in the register according to the address code, the function code and the requirement, confirm the data, then perform Cyclic Redundancy Check (CRC) through a checking tool, obtain the CRC Check code, assemble the CRC Check code into a complete data packet by himself, and send the data packet to the device to be debugged, after receiving the data packet, the device to be debugged generates response data, and the user parses the response data by himself.
However, in the process of debugging the device to be debugged based on the method, the user is required to check the original factory technical document of the device to be debugged every time of debugging, the operation process is complicated, and the whole debugging efficiency is low.
Disclosure of Invention
In order to overcome the problems in the related art, the present application provides a debugging method, a debugging apparatus, and a storage medium.
According to a first aspect of embodiments of the present application, there is provided a debugging method, including:
under the condition that a debugging instruction for equipment to be debugged is detected, acquiring the equipment model of the equipment to be debugged;
determining a target register corresponding to the equipment model from at least one preset register;
determining initial reference configuration parameters of the equipment to be debugged from the target register;
debugging the equipment to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
Optionally, the method further includes:
reading initial register data with a first data format from a register of the device to be debugged according to the initial reference configuration parameters;
converting the initial register data from the first data format to a second data format to obtain register data of the equipment to be debugged;
and outputting the register data of the equipment to be debugged according to the second data format.
Optionally, the debugging the device to be debugged according to the initial reference configuration parameter includes:
under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, adjusting the initial reference configuration parameters according to the actual configuration parameters to obtain target reference configuration parameters;
and debugging the equipment to be debugged according to the target reference configuration parameters.
Optionally, the adjusting the initial reference configuration parameter according to the actual configuration parameter under the condition that the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged to obtain a target reference configuration parameter includes:
and under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, determining the actual configuration parameters as the target reference configuration parameters.
Optionally, the method further includes:
detecting an adjusting instruction through an input interface of the electronic equipment under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged;
under the condition that the adjusting instruction is detected, resolving a parameter adjusting value from the adjusting instruction;
and adjusting the initial reference configuration parameters according to the parameter adjustment values to obtain the target reference configuration parameters.
Optionally, the method further includes:
acquiring communication data between the equipment to be debugged and the electronic equipment in the process of communication between the equipment to be debugged and the electronic equipment based on the initial reference configuration parameters;
and generating a debugging log according to the communication data, and outputting the debugging log.
Optionally, the method further includes:
under the condition that a preset operation instruction for reading and writing data is detected, acquiring an address code in the initial reference configuration parameter and a function code corresponding to the preset operation instruction;
performing CRC on the address code, the function code and a data frame related to the register data of the equipment to be debugged to generate a CRC check code;
and generating the communication data according to the address code, the function code, the data frame related to the register data of the device to be debugged and the CRC check code.
Optionally, the device to be debugged includes:
a sensor device.
According to a second aspect of embodiments of the present application, there is provided a debugging apparatus including:
the debugging device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is configured to obtain the device model of a device to be debugged under the condition that a debugging instruction for the device to be debugged is detected;
the first determining module is configured to determine a target register corresponding to the equipment model from at least one preset register;
the second determining module is configured to determine the initial reference configuration parameters of the device to be debugged from the target register;
the debugging module is configured to debug the equipment to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
Optionally, the apparatus further comprises:
the reading module is configured to read initial register data with a first data format from a register of the device to be debugged according to the initial reference configuration parameters;
the conversion module is configured to convert the initial register data from the first data format to a second data format to obtain register data of the device to be debugged;
and the first output module is configured to output the register data of the device to be debugged according to the second data format.
Optionally, the debugging module is configured to:
under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, adjusting the initial reference configuration parameters according to the actual configuration parameters to obtain target reference configuration parameters;
and debugging the equipment to be debugged according to the target reference configuration parameters.
Optionally, the debugging module is configured to:
and under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, determining the actual configuration parameters as the target reference configuration parameters.
Optionally, the apparatus further comprises:
the detection module is configured to detect an adjustment instruction through an input interface of the electronic device under the condition that the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged;
the analysis module is configured to analyze a parameter adjustment value from the adjustment instruction under the condition that the adjustment instruction is detected;
and the adjusting module is configured to adjust the initial reference configuration parameter according to the parameter adjusting value to obtain the target reference configuration parameter.
Optionally, the apparatus further comprises:
the second obtaining module is configured to obtain communication data between the device to be debugged and the electronic device in a communication process of the device to be debugged and the electronic device based on the initial reference configuration parameters;
and the second output module is configured to generate a debugging log according to the communication data and output the debugging log.
Optionally, the apparatus further comprises:
a third obtaining module, configured to obtain an address code in the initial reference configuration parameter and a function code corresponding to a preset operation instruction when the preset operation instruction for data reading and writing is detected;
the checking module is configured to perform CRC checking on the address code, the function code and a data frame related to the register data of the device to be debugged to generate a CRC checking code;
and the generating module is configured to generate the communication data according to the address code, the function code, the data frame related to the register data of the device to be debugged, and the CRC check code.
Optionally, the device to be debugged includes:
a sensor device.
According to a third aspect of embodiments of the present application, there is provided a debugging apparatus including:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: when executed, implement the steps in the debugging method of the first aspect.
According to a fourth aspect of embodiments of the present application, there is provided a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor of a debugging apparatus, enable the apparatus to perform the steps of the debugging method in the first aspect.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in the embodiment of the application, a target register corresponding to the device model of the device to be debugged may be determined according to the device model of the device to be debugged, and an initial reference configuration parameter of the device to be debugged may be acquired from the target register, and then the device to be debugged may be debugged according to the initial reference configuration parameter.
In the embodiment of the application, the register data and the reference configuration parameters can be stored in the register, after the device model of the device to be debugged is determined, the initial reference configuration parameters can be determined from the register through the device model, and then the device to be debugged is debugged according to the initial reference configuration parameters. Therefore, when the equipment to be debugged is debugged, the original factory technical document of the equipment to be debugged does not need to be checked, automatic debugging of the equipment to be debugged can be achieved through the electronic equipment, efficient management of data can be achieved, and convenience of user operation can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
FIG. 1 is a first flowchart illustrating a debugging method in accordance with an exemplary embodiment;
FIG. 2 is a flowchart illustration two of a debugging method, shown in accordance with an exemplary embodiment;
FIG. 3 is a block diagram illustrating a debugging apparatus according to an example embodiment;
FIG. 4 is a block diagram illustrating a debugging apparatus 800 according to an example embodiment;
fig. 5 is a block diagram illustrating a hardware configuration of a debugging apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the embodiment of the present application, a debugging method is provided, and fig. 1 is a first flowchart illustrating the debugging method according to an exemplary embodiment, as shown in fig. 1. The method mainly comprises the following steps:
in step 101, under the condition that a debugging instruction for a device to be debugged is detected, acquiring a device model of the device to be debugged;
in step 102, determining a target register corresponding to the device model from at least one preset register;
in step 103, determining an initial reference configuration parameter of the device to be debugged from the target register;
in step 104, debugging the device to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
It should be noted that the debugging method provided by the present application may be applied to an electronic device, and may also be applied to a server. Here, the electronic device may include: a terminal device, for example a mobile terminal or a fixed terminal. Wherein, the mobile terminal can include: mobile phones, tablet computers, notebook computers and the like. The fixed terminal may include: desktop computers, and the like.
The debugging method in the embodiment of the present application may be configured in a debugging apparatus, and the debugging apparatus may be disposed in a server, or may also be disposed in an electronic device, which is not limited in this embodiment of the present application.
It should be noted that the execution main body in the embodiment of the present application may be, for example, a Central Processing Unit (CPU) in a server or an electronic device in terms of hardware, and may be, for example, a related background service in the server or the electronic device in terms of software, which is not limited to this.
The device to be debugged may include: electronic devices, such as mobile phones, tablet computers, notebook computers, desktop computers, and the like.
In other embodiments, the device to be commissioned may include sensor devices, such as soil temperature and humidity sensors, rain buckets, noise sensors, wind speed sensors, and the like.
In the implementation process, the electronic device and the device to be debugged can be connected in the same communication link, so that data interaction between the electronic device and the device to be debugged is realized. For example, the electronic device and the device to be debugged are located in the same communication network, the electronic device may send request information to the device to be debugged, the device to be debugged may receive the request information sent by the electronic device, send response information to the electronic device after making a corresponding response, and complete a data interaction process between the electronic device and the device to be debugged.
For another example, the electronic device and the device to be debugged are located in the same communication network, the device to be debugged may send request information to the electronic device, and the electronic device may receive the request information sent by the device to be debugged, and return corresponding response information to the device to be debugged, and may also complete data interaction.
In some embodiments, taking the electronic device as a personal computer and the device to be debugged as a sensor device as an example, the personal computer and the sensor device may be located in an RS485 communication network connected by using an RS485 interface. As a master-slave communication mode is generally adopted in the RS485 communication network, namely, one host machine is provided with a plurality of slave machines, and any one time of data interaction is initiated by the host machine. Based on this, the personal computer can send the addressing data frame to the sensor equipment through the communication link, and the sensor equipment analyzes the addressing data frame after receiving the addressing command, and sends a corresponding response frame to the personal computer.
In some embodiments, in the case that a debugging instruction for the device to be debugged is detected, the electronic device may acquire the device model of the device to be debugged. Before debugging, various equipment models are defined in electronic equipment, including a soil temperature and humidity sensor, a rainfall bucket, a noise sensor, a wind speed sensor and the like. In some embodiments, different models of electronic devices may be identified by numbers or symbols, e.g., a soil temperature and humidity sensor may be identified as 1, a noise sensor may be identified as 2, a rainfall bucket sensor may be identified as 3, etc.
In other embodiments, the device model of the device to be debugged cannot be directly obtained, and then the user-defined device model, the set default device address, the set default device baud rate, and the configured register data conversion formula corresponding to the device need to be stored, and the device model of the device to be debugged can be obtained when a debugging instruction for the device to be debugged is detected.
In other embodiments, the device model may not be selected, data may be transmitted according to a custom data packet, an address code, a function code, and contents of a register to be read and written, which are detected by an input interface of the electronic device, are directly identified, and then a CRC check code is acquired by a check tool, and an integrated data packet is assembled and sent to the device to be debugged.
In some embodiments, data transmission may be performed in a transparent transmission mode, where the transparent transmission mode is a transparent transmission mode, and indicates that a transmission network is only responsible for transmitting a service to be transmitted to a destination node regardless of a transmission service, and meanwhile, the transmission quality is guaranteed without processing the transmission service. That is to say, when the electronic device transmits the addressing data frame to the device to be debugged, the addressing data frame is not set, and the identified addressing data frame is directly transmitted to the device to be debugged.
In some embodiments, after the device model of the device to be debugged is determined, according to the device model, a target register corresponding to the device model may be determined from a preset register, and then the initial reference configuration parameters of the device to be debugged may be determined from the target register.
In some embodiments, all data of the device to be debugged is stored in registers of the device to be debugged. Wherein all data may include: reference configuration parameters, register data, etc. The reference configuration parameters may include: device address, device baud rate, register address, register meaning, etc. The register data may include: register data corresponding to register addresses, register meanings. When register data of the device to be debugged needs to be acquired according to the initial reference configuration parameters in the debugging process, a corresponding target register is determined from a preset register of the electronic device according to the device model, and the initial reference configuration parameters of the device to be debugged can be determined from the target register. The target register stores initial reference configuration parameters of the equipment to be debugged related to the equipment model, a conversion formula of register data corresponding to the equipment to be debugged and the like.
Taking the example that the device to be debugged is the sensor device, all data of the sensor device is stored in the register of the sensor device, and corresponding register data can be acquired from the register of the sensor device according to the initial reference configuration parameters acquired from the target register. The initial reference configuration parameters are parameters required in the debugging process, and may include: default device address, default device baud rate, register address, register meaning, etc. The register data may include: and register data corresponding to the register address and the register meaning are acquired by the sensor equipment.
Taking the sensor device as an RS485 soil temperature and humidity sensor device as an example, all data of the RS485 soil temperature and humidity sensor device are stored in a register of the RS485 soil temperature and humidity sensor device, and corresponding register data can be acquired from the register of the RS485 soil temperature and humidity sensor device according to the initial reference configuration parameters acquired from the target register. The initial reference configuration parameters are parameters required in the debugging process of the RS485 soil temperature and humidity sensor device, and may include: default device address, default device baud rate, register address, register meaning, etc.; among them, the register meaning may include: water content, temperature value, etc. The register data may include: register data corresponding to the register address and the register meaning are acquired by RS485 soil temperature and humidity sensor equipment; wherein the register data may include: a water content real-time value (expanded by 10 times), a temperature real-time value (expanded by 10 times), and the like.
In some embodiments, the device to be debugged may be debugged according to the initial reference configuration parameter, where register data of the device to be debugged may be obtained from a register of the device to be debugged according to the determined initial reference configuration parameter. The default device address and the default device baud rate in the initial reference configuration parameter may be used to establish communication between the device to be debugged and the electronic device, and the register address and the register meaning may be used to confirm the position of the register data of the device to be debugged in the register of the device to be debugged, and may directly obtain the specific value of the register data of the device to be debugged from the register of the device to be debugged.
It should be noted that the electronic device may send request information to the device to be debugged, and after receiving the request information sent by the electronic device, the device to be debugged makes a corresponding response and sends response information to the electronic device.
For example, the following description will be given of an example in which the sensor device is an RS485 soil temperature and humidity sensor device, and the RS485 soil temperature and humidity sensor device interacts with a personal computer. All data in the RS485 soil temperature and humidity sensor device are stored in a register mode, and the data stored in the register of the RS485 soil temperature and humidity sensor device are read or written by the personal computer through sending a reading or writing instruction to the RS485 soil temperature and humidity sensor device. Table 1 is a register content definition for an RS485 soil temperature and humidity sensor device, as follows:
table 1 register content definition for RS485 soil temperature and humidity sensor device
Figure 9228DEST_PATH_IMAGE001
In table 1, the first column is a register address, which indicates a register address where data in the RS485 soil temperature and humidity sensor device is stored, that is, a location where relevant data is stored in the register; the second column is the content, which represents the content of the register stored in the corresponding register address; the third column is operations, which show the corresponding operations that can be performed on the data of the register address; the fourth column is a definition description, which indicates the specific meaning of the contents of the register stored in the corresponding register address.
Taking an example of reading register data of the RS485 soil temperature and humidity sensor device by a personal computer, table 2 shows an example of an inquiry frame format sent to the RS485 soil temperature and humidity sensor device when the personal computer reads sensor data of the RS485 soil temperature and humidity sensor device, that is, the moisture content and the temperature value, as follows:
table 2 inquiry frame sent by pc to RS485 soil temperature and humidity sensor device
Figure 254264DEST_PATH_IMAGE002
In table 2, the first column is an address code, which indicates an equipment address of the RS485 soil temperature and humidity sensor equipment; the second column is a function code which represents the operation of the RS485 soil temperature and humidity sensor device executed by the electronic device; the third column is a register initial address, which indicates that the electronic equipment operates the data stored in the corresponding register address in the RS485 soil temperature and humidity sensor equipment; the fourth column is the number of registers, which indicates the number of registers which are stored in the RS485 soil temperature and humidity sensor equipment from the initial address of the registers and need to be correspondingly operated by the electronic equipment; the fifth column is a CRC check code, which indicates the verification of the transmitted data, calculated by a specific algorithm from all the preceding bytes.
Here, if the device address of the RS485 soil temperature and humidity sensor device is 01, the address code is 01 when the personal computer sends the inquiry frame; reading register data of RS485 soil temperature and humidity sensor equipment by a personal computer, wherein the corresponding function code for reading the register data is 03; the personal computer reads the water content and the temperature value of the RS485 soil temperature and humidity sensor device, the register addresses stored in the data of the two sensors are 0000H and 0001H respectively, and the initial address of the register is 0000; if the personal computer reads the data of the two registers, the number of the registers is 0002; the CRC check code is calculated by performing a specific algorithm on the previous address code, function code, and the like.
After receiving the inquiry frame sent by the personal computer, the RS485 soil temperature and humidity sensor device analyzes the inquiry frame, makes a corresponding response, and returns a response frame to the personal computer. Table 3 shows an example of a format of a corresponding response frame sent from the RS485 soil temperature and humidity sensor device to the personal computer, as follows:
table 3 response frame returned to pc by RS485 soil temperature and humidity sensor device
Figure 830739DEST_PATH_IMAGE003
In table 3, the first column is an address code, which indicates an equipment address of the RS485 soil temperature and humidity sensor equipment; the second column is a function code which represents the operation of the RS485 soil temperature and humidity sensor device executed by the electronic device; the third column is data length which indicates the number of bytes of data returned to the personal computer by the RS485 soil temperature and humidity sensor equipment; the fourth column is a moisture value which represents the data of the moisture value read from the register of the RS485 soil temperature and humidity sensor device; the fifth column is a temperature value which represents data of the temperature value read from the register of the RS485 soil temperature and humidity sensor device; the sixth column is a CRC check code, which indicates the verification of the transmitted data, calculated by performing a specific algorithm on all the preceding bytes.
Here, if the device address of the RS485 soil temperature and humidity sensor device is 01, the address code when the RS485 soil temperature and humidity sensor device returns a response frame is 01; reading register data of RS485 soil temperature and humidity sensor equipment by a personal computer, wherein the corresponding function code for reading the register data is 03; the personal computer reads the water content and the temperature value of the RS485 soil temperature and humidity sensor equipment, and the data length is four bytes; reading a moisture value 00B3 from a register of an RS485 soil temperature and humidity sensor device; the temperature value read from the RS485 soil temperature and humidity sensor equipment register is 0089; the CRC check code is calculated by performing a specific algorithm on the previous address code, function code, data value, and the like. After the RS485 soil temperature and humidity sensor equipment receives data, CRC calculation is carried out on the bytes in front, the calculated data are compared with CRC data sent by a personal computer, if the data are the same, the data are normal and have no errors, if the comparison results are different, the data are indicated to have errors in the transmission process, the frame data are discarded, and the data are treated by corresponding errors after the personal computer does not respond.
In the embodiment of the application, a target register corresponding to the device model of the device to be debugged may be determined according to the device model of the device to be debugged, and an initial reference configuration parameter of the device to be debugged may be acquired from the target register, and then the device to be debugged may be debugged according to the initial reference configuration parameter.
In the embodiment of the application, the register data and the reference configuration parameters can be stored in the register, after the device model of the device to be debugged is determined, the initial reference configuration parameters can be determined from the register through the device model, and then the device to be debugged is debugged according to the initial reference configuration parameters. Therefore, when the equipment to be debugged is debugged, the original factory technical document of the equipment to be debugged does not need to be checked, the automatic debugging process of the equipment to be debugged can be realized through the electronic equipment, the efficient management of data can be realized, and the convenience of user operation can be improved.
In some embodiments, the method further comprises:
reading initial register data with a first data format from a register of the device to be debugged according to the initial reference configuration parameters;
converting the initial register data from the first data format to a second data format to obtain register data of the equipment to be debugged; and outputting the register data of the equipment to be debugged according to the second data format.
Here, the first data format includes: a computer may recognize a data format, such as a 16-ary data format. The second data format includes: a data format that can be recognized by a user, such as a 2-ary data format.
It should be noted that, because the register data is stored in the register in the first data format, the register data of the device to be debugged read from the register of the device to be debugged is in the first data format, the register data of the device to be debugged returned by the device to be debugged is also in the first data format, and the initial register data having the first data format is also displayed in the electronic device, but the data in the first data format often cannot intuitively represent the physical characteristics of the data.
In the embodiment of the application, after the initial register data in the first data format is read, the first data format which cannot visually display the data characteristics is converted into the second data format which can directly embody the data characteristics according to the preset conversion formula, and the register data of the device to be debugged is output according to the second data format. Here, the conversion formula set in advance includes a formula of converting 16 systems into 2 systems. For example, the first data format is a 16-system data format, the second data format is a 2-system data format, and after the data is returned to the electronic device, the data is converted from the 16-system data format to the 2-system data format according to a preset conversion formula. For users, the data in the 2-system data format can more intuitively embody the physical characteristics of the data, and the readability is better than that of the data in the 16-system data format.
In the embodiment of the application, the preset conversion formula is mainly used for outputting the register data of the device to be debugged in the second data format, so that a user can conveniently and directly obtain the physical characteristics of the data according to the register data of the device to be debugged in the second data format, the register data of the device to be debugged in the second format does not need to be obtained through manual calculation according to the initial register data in the first data format, and the interaction experience of the user is improved.
In some embodiments, the debugging the device to be debugged according to the initial reference configuration parameters includes:
under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, adjusting the initial reference configuration parameters according to the actual configuration parameters to obtain target reference configuration parameters;
and debugging the equipment to be debugged according to the target reference configuration parameters.
In some embodiments, the initial reference configuration parameters are different from the actual configuration parameters, and according to the actual configuration parameters, register data of the corresponding device to be debugged may be obtained from a register of the device to be debugged, so that a debugging process of the device to be debugged may be completed, and it is determined that the device to be debugged may normally operate. And under the condition that the register data of the corresponding device to be debugged cannot be acquired from the register of the device to be debugged according to the initial reference configuration parameters, the initial reference configuration parameters of the device to be debugged can be adjusted according to the actual configuration parameters.
In other embodiments, the device to be debugged may be debugged directly according to the initial reference configuration parameter under the condition that the initial reference configuration parameter is the same as the actual configuration parameter of the device to be debugged.
Assuming that the default device address is 1 and the default device baud rate is 4800 bits/second (bit/s) in the initial reference configuration parameters of the device to be debugged, but the device address is 1 and the device baud rate is 9600 bits/s in the actual configuration parameters of the device to be debugged, the actual configuration parameters of the device to be debugged are inconsistent with the initial reference configuration parameters, the register data of the device to be debugged cannot be acquired from the register of the device to be debugged by directly using the initial reference configuration parameters, and the initial reference configuration parameters can be adjusted according to the actual configuration parameters, so that the register data of the device to be debugged can be acquired from the register of the device to be debugged according to the adjusted target reference configuration parameters.
In some embodiments, the actual configuration parameters may be obtained from a custom input interface. For example, the device address identified from the custom input interface is 1, the device baud rate is 2400 bit/s, communication is performed according to the device address and the device baud rate, and register data of the device to be debugged is acquired from a register of the device to be debugged. If register data of the equipment to be debugged can be acquired, determining that the equipment address is 1 and the equipment baud rate is 2400 bit/s in the actual configuration parameters; if the register data of the device to be debugged cannot be acquired, the device address and the device baud rate are identified again according to the user-defined input interface until communication can be achieved, namely the device address and the device baud rate of the register data of the device to be debugged can be acquired from the register of the device to be debugged, and are determined as actual configuration parameters.
In other embodiments, the actual configuration parameters may be obtained from an automated acquisition tool configured. For example, an automatic acquisition tool is operated, and the automatic acquisition tool rapidly tests the device address and the device baud rate in a traversal manner, so that the actual configuration parameters can be automatically displayed.
When the initial reference configuration parameters are different from the actual configuration parameters and the target reference configuration parameters cannot be obtained through communication according to the initial reference configuration parameters, the initial reference configuration parameters are adjusted according to the actual configuration parameters which can be communicated, so that the adjustment of the initial reference configuration parameters can be ensured to be based, and the adjusted target reference configuration parameters are closer to the actual configuration parameters.
In some embodiments, the adjusting the initial reference configuration parameter according to the actual configuration parameter to obtain a target reference configuration parameter when the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged includes:
and under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, determining the actual configuration parameters as the target reference configuration parameters.
In some embodiments, when the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged, according to the initial reference configuration parameter, the register data of the device to be debugged cannot be acquired from the register of the device to be debugged, and the initial reference configuration parameter may be adjusted according to the actual configuration parameter. For example, the actual configuration parameter may be determined as the target reference configuration parameter. According to the actual configuration parameters, communication can be completed, register data of the device to be debugged is obtained from a register of the device to be debugged, the actual configuration parameters are directly determined as target reference configuration parameters, and according to the target reference configuration parameters (namely, the actual configuration parameters), the register data of the device to be debugged can be obtained from the register of the device to be debugged.
In the embodiment of the application, the actual configuration parameters capable of completing communication are determined as the target reference configuration parameters, so that the adjustment of the initial reference configuration parameters can be completed more conveniently, the target reference configuration parameters are determined, and the adjusted target reference configuration parameters can be ensured to realize the communication between the electronic equipment and the equipment to be debugged.
In some embodiments, the method further comprises:
detecting an adjusting instruction through an input interface of the electronic equipment under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged;
under the condition that the adjusting instruction is detected, resolving a parameter adjusting value from the adjusting instruction;
and adjusting the initial reference configuration parameters according to the parameter adjustment values to obtain the target reference configuration parameters.
In some embodiments, when the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged, according to the initial reference configuration parameter, the register data of the device to be debugged cannot be acquired from the register of the device to be debugged, and the initial reference configuration parameter needs to be adjusted correspondingly. The corresponding adjusting instruction can be detected through an input interface of the electronic equipment, a parameter adjusting value is obtained through analysis in the adjusting instruction, and the initial reference configuration parameter is adjusted according to the corresponding parameter adjusting value in the corresponding interface to obtain the target reference configuration parameter.
For example, in the initial reference configuration parameters, the default device address is 1, the default device baud rate is 4800 bits/s, the device address adjustment value is 1, and the device baud rate adjustment value is 2400 bits/s in the parameter adjustment values analyzed from the adjustment instruction, at this time, the default device address and the default device baud rate in the initial reference configuration parameters are adjusted to obtain the target reference configuration parameters, that is, the target device address is 1, and the target device baud rate is 2400 bits/s.
In the embodiment of the application, according to the self-defined adjusting instruction in the input interface of the electronic device, more modifications can be made on the initial reference configuration parameters, the adjusting diversity is increased, and more attempts can be made to determine the target reference configuration parameters in the adjusting process.
In some embodiments, the method further comprises:
acquiring communication data between the equipment to be debugged and the electronic equipment in the process of communication between the equipment to be debugged and the electronic equipment based on the initial reference configuration parameters;
and generating a debugging log according to the communication data, and outputting the debugging log.
In the process that the equipment to be debugged and the electronic equipment communicate based on the initial reference configuration parameters, the electronic equipment sends an inquiry frame to the equipment to be debugged, and after receiving the inquiry frame sent by the electronic equipment, the equipment to be debugged analyzes the inquiry frame, makes a corresponding response and returns a response frame to the electronic equipment. By taking the device to be debugged as the RS485 soil temperature and humidity sensor device and the electronic device as an example, in the data interaction process between the RS485 soil temperature and humidity sensor device and the electronic device, the query frame sent by the personal computer to the RS485 soil temperature and humidity sensor device is as follows: 010300000002C 40B, the response frame returned to the personal computer by the RS485 soil temperature and humidity sensor device is: 01030400B 30089 CA 72.
In the embodiment of the application, communication data between the device to be debugged and the electronic device can be acquired, a debug log is output according to the communication data, the TX represents the transmitted communication data, and the RX represents the received communication data in the debug log. Taking the communication between the RS485 soil temperature and humidity sensor device and the electronic device as an example, the output debugging log is:
TX>>:01 03 00 00 00 02 C4 0B
RX>>:01 03 04 00 B3 00 89 CA 72
in the embodiment of the application, the generation of the debug log can display the data interaction process in the communication process of the device to be debugged and the electronic device, and the information such as the device address and the operation instruction of the device to be debugged, the initial address of the operated data in the register of the device to be debugged and the like can be directly checked through the debug log, so that the communication process between the device to be debugged and the electronic device can be clearly displayed.
In some embodiments, the method further comprises:
under the condition that a preset operation instruction for reading and writing data is detected, acquiring an address code in the initial reference configuration parameter and a function code corresponding to the preset operation instruction;
performing CRC on the address code, the function code and a data frame related to register data of the device to be debugged to generate a CRC code;
and generating the communication data according to the address code, the function code, the data frame related to the register data of the device to be debugged and the CRC check code.
In the embodiment of the application, when an instruction that data needs to be read from a register of a device to be debugged or data needs to be written into the register of the device to be debugged is detected, an address code in an initial reference configuration parameter and a function code corresponding to a preset operation instruction are obtained, and the preset operation instruction is used for reading the data from the register of the device to be debugged or writing the data into the register of the device to be debugged. The device address is an address code, belongs to data in the initial reference configuration parameters, and can be acquired from a corresponding data storage unit in the target register; the function code characterizes different instructions, e.g. function code 03 indicates reading one or consecutive register data and function code 06 indicates writing a single register data.
And automatically performing CRC (cyclic redundancy check) on the acquired address code, the acquired function code and the data frame related to the register data of the equipment to be debugged. The CRC check function is that all the bytes of a frame of data except the last two bytes are subjected to specific algorithm calculation, and the data generated after calculation is used as a first CRC check code. After the debugging equipment receives the data, performing CRC calculation on the bytes in front, taking the data generated after calculation as a second CRC code, and comparing the second CRC code with the received first CRC code, wherein if the first CRC code is the same as the second CRC code, the data can be determined to be normal without errors; if the first CRC code is different from the second CRC code, the data is wrong in transmission, the frame data is discarded, the device to be debugged considers that the data is not received, and the electronic device does corresponding error processing after receiving no response. For example, taking the data frame in the communication process between the RS485 soil temperature and humidity sensor device and the personal computer as an example, the first CRC check code (C40B) in the inquiry frame is obtained by performing a specific algorithm according to the address code, the function code and the register start address, and the second CRC check code (CA 72) in the response frame is obtained by performing a specific algorithm according to the address code, the function code, the data length and the moisture value. And comparing the first check code and the second check code to confirm whether errors occur in data interaction.
And generating communication data according to the address code, the function code, the data frame related to the register data of the equipment to be debugged and the CRC check code. The CRC code obtained by the method is added at the end of one frame of data, and the data is combined into a query frame or a response frame to generate communication data. For example, the query frame is composed of an address code, a function code, a register start address, the number of registers and a first CRC check code, and the response frame is composed of an address code, a function code, a data length, a moisture value, a temperature value and a second CRC check code. The inquiry frame and the data frame together constitute communication data.
In the embodiment of the application, the electronic equipment can automatically acquire the register data of the equipment to be debugged according to the initial reference configuration parameters, and the debugging process of the equipment to be debugged is completed.
In some embodiments, the device to be debugged includes:
a sensor device.
In some embodiments, the device to be debugged comprises a sensor device, wherein the model of the sensor device comprises a soil temperature and humidity sensor, a rainfall barrel, a noise sensor, a wind speed sensor and the like.
Taking the device to be debugged as a sensor device as an example, RS485 communication is widely applied to various sensors, and the corresponding communication protocol ModBus-RTU specifies that the whole RS485 communication network can only have 1 host and a plurality of slave machines. All data of the slave in RS485 communication are stored in a register mode, and the data of the slave are read and written by the host through a read-write instruction.
Because the RS485 sensor equipment can only be used as a slave machine, tool software is usually required to be used for debugging the RS485 sensor equipment, the equipment is ensured to be normal, and then the RS485 sensor equipment is combined with other equipment used as the slave machine for comprehensive debugging. The RS485 sensor devices are various in types, meanwhile, default device addresses, default device baud rates and device register content definitions of RS485 sensor devices of different manufacturers are different, the RS485 sensor devices are used as users or developers of one device, original factory technical documents of the devices to be debugged need to be checked every time the RS485 sensor devices are used, and the RS485 sensor devices are quite troublesome in daily use.
In the embodiment of the application, the debugging method is applied to the sensor equipment, the model of the sensor equipment and the content of the corresponding register can be managed more conveniently, the reading of data in the sensor equipment can be more visual, and the efficiency of the debugging process is improved.
Fig. 2 is a flowchart illustrating a second debugging method according to an exemplary embodiment, where as shown in fig. 2, the method mainly includes the following steps:
in step 301, the device model of the device to be commissioned is determined.
Here, before the device is debugged, the device model of the device to be debugged needs to be determined, the initial reference configuration parameters including the default device address and the default device baud rate can be obtained according to the device model of the device to be debugged, and the register data conversion formula corresponding to the device model is determined, so that the 16-system byte data in the register data is automatically converted into real physical data, and a user can conveniently view and analyze the data.
In some embodiments, if the common default information of the device to be debugged changes, the initialized initial reference configuration parameters may be modified by "parameter setting", i.e. the device is re-initialized. If the default device address preset by the device to be debugged is 01 but the general information changes and the default device address needs to be initialized again and changed to 05, the default device address can be changed through parameter setting, and the modification of the initial reference configuration parameter information such as the baud rate of the default device and the address of the default register can also be completed through parameter setting.
In other embodiments, the device model can be a soil temperature and humidity sensor, a rainfall bucket sensor, a noise sensor and the like. In addition, the model of the device to be debugged is not selected, data can be transmitted according to the self-defined data packet, and the function can be realized through a transparent transmission mode.
In step 302, it is determined whether the default device address and the default device baud rate of the selected device model are consistent with the actual device address and the actual device baud rate of the device to be debugged.
Here, after the device model of the device to be debugged is selected, the initial reference configuration parameters of the device to be debugged may be acquired, where the initial reference configuration parameters include a default device address and a default device baud rate. When the equipment model of the equipment to be debugged is selected, the corresponding positions of the equipment address and the baud rate can be automatically switched and displayed into the default equipment address and the default equipment baud rate of the selected equipment model according to the selected equipment model. The communication between the equipment to be debugged and the electronic equipment can be tried to be established through the 'reading' button, the actual equipment address or the equipment baud rate of the equipment to be debugged is obtained, whether the default equipment address and the default equipment baud rate of the selected equipment model are consistent with the actual equipment address and the actual equipment baud rate or not can be judged, and corresponding operation is carried out.
In step 303, no adjustment is made to the default device address and the default device baud rate.
In some embodiments, when trying to establish communication between the device to be debugged and the electronic device by using the "read" button, the device to be debugged and the electronic device may communicate with each other, the default device address and the default device baud rate are consistent with the actual device address and the actual device baud rate of the device to be debugged, the device may be debugged by directly using the default device address and the default device baud rate, and the default device address and the default device baud rate do not need to be adjusted.
In step 304, the initial reference configuration parameters are adjusted according to the actual configuration parameters.
In some embodiments, when trying to establish communication between a device to be debugged and an electronic device through a "read" button, the device to be debugged and the electronic device cannot communicate with each other, a default device address and a default device baud rate are not consistent with an actual device address and an actual device baud rate of the device to be debugged, the default device address and the default device baud rate cannot be directly used, the default device address and the default device baud rate need to be adjusted through corresponding "setting" to obtain a target reference configuration parameter, and the target reference configuration parameter after being modified takes effect during communication.
In some embodiments, the device address and the device baud rate after the "setting" are identified, and communication between the device to be debugged and the electronic device is tried to be established according to the device address and the device baud rate after the "setting" until the communication between the device to be debugged and the electronic device can be completed, the device address and the device baud rate which can complete the communication at this time are determined as the actual device address and the actual device baud rate, a target reference configuration parameter is formed, and the subsequent communication process is completed according to the target reference configuration parameter.
In step 305, it is determined whether the default baud rate parameters need to be changed.
Here, the baud rate parameter may be modified according to the requirement of the device to be debugged, such as the check mode, the data bit, or the stop bit in the default baud rate parameter.
In step 306, the default baud rate parameters are modified based on the actual baud rate.
In some embodiments, when the actual baud rate parameter is not consistent with the preset baud rate parameter, the verification mode, the data bit or the stop bit in the default baud rate parameter may be changed by "more" according to the requirement of the device to be debugged.
In step 307, the device to be debugged is debugged.
Here, when the initial reference configuration parameters are the same as the actual configuration parameters, the device to be debugged is debugged according to the initial reference configuration parameters. And when the initial reference configuration parameters are inconsistent with the actual configuration parameters, adjusting the initial reference configuration parameters according to the actual configuration parameters to obtain target reference configuration parameters, and debugging the equipment to be debugged according to the target reference configuration parameters.
In step 308, register data of the device to be debugged is obtained.
In the embodiment of the application, according to the determined initial reference configuration parameter or the changed target reference configuration parameter, register data of the device to be debugged can be acquired from a register of the device to be debugged. Taking an RS485 soil temperature and humidity sensor device as an example, addresses 0000H and 0001H of data storage are displayed in a register address area respectively, moisture content and temperature values corresponding to register addresses are displayed in a register meaning, the corresponding moisture content (humidity) or temperature value can be obtained through reading, and the corresponding moisture content (humidity) or temperature value is displayed in the data column of the register. Here, the register data is stored in the register in a 16-system data format, and since the corresponding conversion formula is preset, before the register data of the device to be debugged is displayed in the register data column, the initial register data in the 16-system data format is converted into the register data of the device to be debugged in the 2-system data format, so that the displayed value is the converted real physical value.
In step 309, register data is written to the register of the device to be debugged.
In some embodiments, data may be written to a register of the device to be debugged by "set", which is grey when the register contents are in read-only mode, indicating that data cannot be written.
In the embodiment of the application, the RS485 soil temperature and humidity sensor device is taken as an example, the water content and the temperature value are in a read-only mode, and the corresponding 'setting' button is gray, so that the writing operation cannot be performed. In addition, the register address and the register meaning are parameters corresponding to the device model, and cannot be modified. The values of the device address and the device baud rate are read-write operable, and thus the device address and the device baud rate can be modified by "setting".
In some embodiments, for register parameters not defined in the device model, reading and writing of data can also be realized by inputting register addresses, but the register data is shown as 16-bit byte data.
In step 310, the device to be debugged is debugged successfully.
According to the determined initial reference configuration parameters or the changed target reference configuration parameters, register data of the device to be debugged is successfully acquired from a register of the device to be debugged or is successfully written into the register of the device to be debugged, and the device to be debugged is successfully debugged.
In step 311, a debug log of the device to be debugged is viewed.
The "log information" area displays the content of specific communication in a 16-system data format, including an inquiry frame sent by the electronic device to the device to be debugged and a response frame returned by the device to be debugged to the electronic device.
In some embodiments, when reading the register data, the debug log will display:
query frame: address code, function code, register initial address, register number and CRC check code;
response frame: address code, function code, data length, register data, CRC check code.
In other embodiments, when writing register data, the debug log may display:
query frame: address code, function code, register initial address, modified numerical value, CRC check code;
response frame: address code, function code, register start address, modified value, CRC check code.
In the embodiment of the application, the RS485 soil temperature and humidity sensor device is taken as an example, and when the data (the moisture value and the temperature value) of the register is read, the contents displayed by the debugging log are as follows:
TX>>:01 03 00 00 00 02 C4 0B
RX>>:01 03 04 00 B3 00 89 CA 72
when the register data (device baud rate) is written, the contents displayed by the debug log are as follows:
TX>>:01 06 07 D1 00 02 59 46
RX>>:01 06 07 D1 00 02 59 46
the debugging method is used for debugging the device to be debugged, the whole debugging process can be optimized, the device to be debugged is convenient to manage, the user can operate and use conveniently, the efficiency in the data interaction process is improved, the register data of the device to be debugged can be visually displayed, the communication process is displayed in the form of a communication log, and the interaction experience of the user is improved.
Fig. 3 is a block diagram illustrating a debugging apparatus according to an example embodiment. As shown in fig. 3, the debugging apparatus 400 is applied to an electronic device, and the debugging apparatus 400 mainly includes:
a first obtaining module 401, configured to obtain, when a debugging instruction for a device to be debugged is detected, a device model of the device to be debugged;
a first determining module 402, configured to determine, from at least one preset register, a target register corresponding to the device model;
a second determining module 403, configured to determine an initial reference configuration parameter of the device to be debugged from the target register;
a debugging module 404 configured to debug the device to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
In some embodiments, the apparatus further comprises:
the reading module is configured to read initial register data with a first data format from a register of the device to be debugged according to the initial reference configuration parameters;
the conversion module is configured to convert the initial register data from the first data format to a second data format to obtain register data of the device to be debugged;
and the first output module is configured to output the register data of the device to be debugged according to the second data format.
In some embodiments, the debug module 404 is configured to:
under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, adjusting the initial reference configuration parameters according to the actual configuration parameters to obtain target reference configuration parameters;
and debugging the equipment to be debugged according to the target reference configuration parameters.
In some embodiments, the debug module 404 is configured to:
and under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, determining the actual configuration parameters as the target reference configuration parameters.
In some embodiments, the apparatus further comprises:
the detection module is configured to detect an adjustment instruction through an input interface of the electronic device under the condition that the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged;
the analysis module is configured to analyze a parameter adjustment value from the adjustment instruction under the condition that the adjustment instruction is detected;
and the adjusting module is configured to adjust the initial reference configuration parameter according to the parameter adjusting value to obtain the target reference configuration parameter.
In some embodiments, the apparatus further comprises:
the second obtaining module is configured to obtain communication data between the device to be debugged and the electronic device in a communication process of the device to be debugged and the electronic device based on the initial reference configuration parameters;
and the second output module is configured to generate a debugging log according to the communication data and output the debugging log.
In some embodiments, the apparatus further comprises:
a third obtaining module, configured to obtain an address code in the initial reference configuration parameter and a function code corresponding to a preset operation instruction when the preset operation instruction for data reading and writing is detected;
the checking module is configured to perform CRC checking on the address code, the function code and a data frame related to the register data of the device to be debugged to generate a CRC checking code;
and the generating module is configured to generate the communication data according to the address code, the function code, the data frame related to the register data of the device to be debugged, and the CRC check code.
In some embodiments, the device to be debugged includes:
a sensor device.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 4 is a block diagram illustrating a debugging apparatus 800 according to an example embodiment. For example, the device 800 may be a mobile phone, a mobile computer, etc.
Referring to fig. 4, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of the components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as Wi-Fi, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, communications component 816 further includes a Near Field Communications (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, instructions in the storage medium, when executed by a processor of a debugging apparatus, enable the debugging apparatus to perform a debugging method, the method comprising:
under the condition that a debugging instruction for equipment to be debugged is detected, acquiring the equipment model of the equipment to be debugged;
determining a target register corresponding to the equipment model from at least one preset register;
determining initial reference configuration parameters of the equipment to be debugged from the target register;
debugging the equipment to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
Fig. 5 is a block diagram illustrating a hardware configuration of a debugging apparatus according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 5, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform a debugging method comprising:
under the condition that a debugging instruction for equipment to be debugged is detected, acquiring the equipment model of the equipment to be debugged;
determining a target register corresponding to the equipment model from at least one preset register;
determining initial reference configuration parameters of the equipment to be debugged from the target register;
debugging the equipment to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. A debugging method is applied to electronic equipment and comprises the following steps:
under the condition that a debugging instruction for equipment to be debugged is detected, acquiring the equipment model of the equipment to be debugged;
determining a target register corresponding to the equipment model from at least one preset register;
determining initial reference configuration parameters of the equipment to be debugged from the target register;
debugging the equipment to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
2. The method of claim 1, further comprising:
reading initial register data with a first data format from a register of the device to be debugged according to the initial reference configuration parameters;
converting the initial register data from the first data format to a second data format to obtain register data of the equipment to be debugged;
and outputting the register data of the equipment to be debugged according to the second data format.
3. The method according to claim 1, wherein the debugging the device to be debugged according to the initial reference configuration parameters comprises:
under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, adjusting the initial reference configuration parameters according to the actual configuration parameters to obtain target reference configuration parameters;
and debugging the equipment to be debugged according to the target reference configuration parameters.
4. The method according to claim 3, wherein the adjusting the initial reference configuration parameter according to the actual configuration parameter to obtain a target reference configuration parameter when the initial reference configuration parameter is different from the actual configuration parameter of the device to be debugged comprises:
and under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged, determining the actual configuration parameters as the target reference configuration parameters.
5. The method of claim 3, further comprising:
detecting an adjusting instruction through an input interface of the electronic equipment under the condition that the initial reference configuration parameters are different from the actual configuration parameters of the equipment to be debugged;
under the condition that the adjusting instruction is detected, analyzing a parameter adjusting value from the adjusting instruction;
and adjusting the initial reference configuration parameters according to the parameter adjustment values to obtain the target reference configuration parameters.
6. The method of claim 1, further comprising:
acquiring communication data between the equipment to be debugged and the electronic equipment in the process of communication between the equipment to be debugged and the electronic equipment based on the initial reference configuration parameters;
and generating a debugging log according to the communication data, and outputting the debugging log.
7. The method of claim 6, further comprising:
under the condition that a preset operation instruction for reading and writing data is detected, acquiring an address code in the initial reference configuration parameter and a function code corresponding to the preset operation instruction;
performing CRC on the address code, the function code and a data frame related to register data of the device to be debugged to generate a CRC code;
and generating the communication data according to the address code, the function code, the data frame related to the register data of the device to be debugged and the CRC check code.
8. The method according to any one of claims 1 to 7, wherein the device to be debugged comprises:
a sensor device.
9. A debugging device is applied to an electronic device and comprises:
the debugging device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is configured to obtain the device model of a device to be debugged under the condition that a debugging instruction for the device to be debugged is detected;
the first determining module is configured to determine a target register corresponding to the equipment model from at least one preset register;
the second determining module is configured to determine the initial reference configuration parameters of the device to be debugged from the target register;
the debugging module is configured to debug the equipment to be debugged according to the initial reference configuration parameters;
and determining that the debugging of the equipment to be debugged is successful under the condition that the register data of the equipment to be debugged is acquired from the register of the equipment to be debugged according to the initial reference configuration parameters.
10. A commissioning apparatus, comprising:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: when executed, implement the steps in a debugging method of any of claims 1 to 8.
11. A non-transitory computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of a debugging apparatus, enable the apparatus to perform the steps of the debugging method of any of claims 1 to 8.
CN202210456515.7A 2022-04-28 2022-04-28 Debugging method, device and storage medium Active CN114564414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210456515.7A CN114564414B (en) 2022-04-28 2022-04-28 Debugging method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210456515.7A CN114564414B (en) 2022-04-28 2022-04-28 Debugging method, device and storage medium

Publications (2)

Publication Number Publication Date
CN114564414A true CN114564414A (en) 2022-05-31
CN114564414B CN114564414B (en) 2022-08-09

Family

ID=81721158

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210456515.7A Active CN114564414B (en) 2022-04-28 2022-04-28 Debugging method, device and storage medium

Country Status (1)

Country Link
CN (1) CN114564414B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938566A (en) * 2010-09-10 2011-01-05 青岛海信移动通信技术股份有限公司 Visual terminal debugging method and device
CN102231128A (en) * 2011-07-06 2011-11-02 青岛海信信芯科技有限公司 Online debugging method and debugging host
WO2013164772A1 (en) * 2012-05-03 2013-11-07 Koninklijke Philips N.V. Method and device for commissioning of nodes of a network
CN104539502A (en) * 2015-01-26 2015-04-22 北海恒久天成技术开发有限公司 Method for adding modbus equipment in customized manner
CN106294143A (en) * 2016-08-03 2017-01-04 北京百度网讯科技有限公司 The adjustment method of the depositor of chip and device
CN108628734A (en) * 2017-03-21 2018-10-09 中兴通讯股份有限公司 A kind of function program adjustment method and terminal
CN208270992U (en) * 2018-06-04 2018-12-21 天津万维工业设计有限公司 intelligent network sensor device
CN110457198A (en) * 2018-05-07 2019-11-15 龙芯中科技术有限公司 Debugging message output method, device and storage medium
CN111050235A (en) * 2019-12-13 2020-04-21 天健创新(北京)监测仪表股份有限公司 Automatic sensor identification method and device for water quality monitoring terminal
CN113626310A (en) * 2021-07-09 2021-11-09 芯来智融半导体科技(上海)有限公司 Development and debugging system, device to be tested and debugging method
CN113704104A (en) * 2021-08-25 2021-11-26 合肥宏晶微电子科技股份有限公司 Program debugging method, device, system, electronic device and storage medium
CN114205427A (en) * 2021-11-17 2022-03-18 武汉慧联无限科技有限公司 Method, device and storage medium for protocol docking debugging

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938566A (en) * 2010-09-10 2011-01-05 青岛海信移动通信技术股份有限公司 Visual terminal debugging method and device
CN102231128A (en) * 2011-07-06 2011-11-02 青岛海信信芯科技有限公司 Online debugging method and debugging host
WO2013164772A1 (en) * 2012-05-03 2013-11-07 Koninklijke Philips N.V. Method and device for commissioning of nodes of a network
CN104539502A (en) * 2015-01-26 2015-04-22 北海恒久天成技术开发有限公司 Method for adding modbus equipment in customized manner
CN106294143A (en) * 2016-08-03 2017-01-04 北京百度网讯科技有限公司 The adjustment method of the depositor of chip and device
CN108628734A (en) * 2017-03-21 2018-10-09 中兴通讯股份有限公司 A kind of function program adjustment method and terminal
CN110457198A (en) * 2018-05-07 2019-11-15 龙芯中科技术有限公司 Debugging message output method, device and storage medium
CN208270992U (en) * 2018-06-04 2018-12-21 天津万维工业设计有限公司 intelligent network sensor device
CN111050235A (en) * 2019-12-13 2020-04-21 天健创新(北京)监测仪表股份有限公司 Automatic sensor identification method and device for water quality monitoring terminal
CN113626310A (en) * 2021-07-09 2021-11-09 芯来智融半导体科技(上海)有限公司 Development and debugging system, device to be tested and debugging method
CN113704104A (en) * 2021-08-25 2021-11-26 合肥宏晶微电子科技股份有限公司 Program debugging method, device, system, electronic device and storage medium
CN114205427A (en) * 2021-11-17 2022-03-18 武汉慧联无限科技有限公司 Method, device and storage medium for protocol docking debugging

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LONHAND郎汉德: "土壤传感器说明书", 《HTTPS://WWW.LONHAND.COM/UPLOADS/20211123/17F1745BC594D1881D0AD308AAC60BBF》 *

Also Published As

Publication number Publication date
CN114564414B (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN110659028B (en) Data processing system, method, device, electronic equipment and storage medium
CN110673782B (en) Control method applied to screen projection scene and related equipment
WO2019233212A1 (en) Text identification method and device, mobile terminal, and storage medium
CN110610699B (en) Voice signal processing method, device, terminal, server and storage medium
CN106375096B (en) short message verification method and device
CN107659717B (en) State detection method, device and storage medium
CN105094541A (en) Method, device and system for terminal control
CN111273899A (en) Code processing method and device, electronic equipment and storage medium
CN105072246A (en) Information synchronization method, device and terminal
CN107562500B (en) Debugging device, method and equipment
US20220337577A1 (en) Method and device for application login
CN109684112B (en) Program file operation method, device, terminal and storage medium
CN113434134B (en) Component processing method and device, electronic equipment and storage medium
CN105407160A (en) Interface display method and device
CN107958273B (en) Volume adjusting method and device and storage medium
CN114584261B (en) Data processing method, device and storage medium
CN114564414B (en) Debugging method, device and storage medium
CN108737588A (en) Domain name analytic method and device
CN111552606B (en) Data processing method and device and electronic equipment
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN115408277B (en) Interface testing method and device
CN106850556A (en) service access method, device and equipment
CN113626321B (en) Bridging test method, device, system and storage medium
US11782523B2 (en) Method for controlling Internet of Things device, and terminal device
CN109491655A (en) A kind of incoming event processing method and processing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Debugging methods, devices, and storage media

Granted publication date: 20220809

Pledgee: CITIC Bank Limited by Share Ltd. Wuhan branch

Pledgor: WUHAN EASYLINKIN TECHNOLOGY CO.,LTD

Registration number: Y2024980000365

PE01 Entry into force of the registration of the contract for pledge of patent right