Collection
zero Useful+1
zero

data interface

Interface for outputting data to data connection line during data transmission
The data interface is the interface that outputs data to the data connection line during data transmission. wireless decoder Common interfaces are RS-232 Port. RS-232-C Interface (also known as EIA RS-232-C) is the most commonly used one Serial communication interface
Chinese name
data interface
Representative
RS-232 port
Usually used for
Mainstream high-end market analysis software
Achievements
The most stable and efficient transmission on the market
Interpretation
Interface for outputting data to data connection line during data transmission

brief introduction

Announce
edit
It was created in 1970 by Electronic Industry Association of America EIA )Union bell system Modem Standards for serial communication jointly formulated by manufacturers and computer terminal manufacturers. Its full name is“ Data terminal equipment Serial between (DTE) and data communication equipment (DCE) Binary Data exchange interface technical standard "This standard stipulates that a 25 pin DB25 connector is used to specify the signal content of each pin of the connector, as well as the level of various signals.

Opportunity to add interfaces

Announce
edit
In general, when a page does not require a second request, an interface is used, such as the general details page, personal information page, etc; If a single page function requires a second request, such as a list page with paging function, an interface is used; The page contains multiple functions. If one of them needs a second request, multiple interfaces need to be defined. For example, there is a list of to-do items under the personal information page, and paging is supported. If an interface returns all information, the personal information content will be refreshed every time the page is turned, which will cause unnecessary information transmission. [1]

Parameters and return values

Announce
edit
First of all, the current practice of the author is to use URL to transfer parameters for general queries, use POST to transfer JSON strings to submit data for addition and modification, and use POST for deletion as well. As for the return value, all interfaces in the project return JSON data uniformly and agree on a format. For example, this JSON object contains three keys, data, msg and status, which represent the returned data. Data may be an object or array, requesting feedback information and feedback status code, so that each interface does not need to be explained again. Let's talk about some details. In high-level languages, there are multiple types of data, such as String, Int, DateTime, etc. After serializing to JSON, all of them become character string At this time, you need to pay attention to the fields without values. For example, when the value type is nullable, the serialized value is directly null without quotation marks; When it is non nullable, the value is the default value, and there is no quotation mark, while DateTime is quoted, "0001-01-01T00:00:00"; For example, when the reference type String has no value, it will also become null after serialization, instead of the empty string "". To use the empty string "" to represent it, you must give a default value, such as String. Empty. This is because iOS told me that when the field value returned null, they reported an error. Another situation we have encountered before is the precision problem of numeric types. At that time, the interface returned a price field, and the server of course used the decimal type, with two decimal places reserved. However, the value received by the iOS terminal had many more decimal places, and Android had no problem. Finally, it had to convert to the string type before serialization. For other numeric types that need to contain decimal places, when all the decimal points are 0, the serialization will become an integer. In this case, it also needs to be converted to a string first and then serialized. For the DateTime type, when it is received as an addition/modification parameter, it is inserted into the database after deserialization. If you happen to use Sql Server , the DateTime type is also used. Please note that its range is 1753-01-01 00:00:00 to 9999-12-31 23:59:59, and the empty string is converted to "0001-01-01 00:00:00", and an exception will be reported. [2]