Using ASP script program to design USSD interface access of meteorological short message platform

Over the years, the meteorological short message service has become an important form of meteorological public service. Practicality, convenience, and authority are important factors for it to gain a foothold in the fiercely competitive information service industry. It has played a role in guiding people's production and life and social disaster prevention and mitigation. Important role. Due to the multiple restrictions imposed by the state on the management of the information industry, users currently rely on upstream commands to obtain meteorological short messages. Users need to remember cumbersome commands and SP special service numbers, which is not convenient for users to operate, especially for customized services. The confirmation process greatly increases the complexity of user operations. USSD (Unstructured Supplementary Data Service) is an emerging interactive short message platform technology. It is operated by USSD, which is intuitive and convenient, and users can easily complete related needs. According to the current situation of Shandong Mobile Meteorological Short Message Platform, the author uses ASP script program to link with USSD gateway to realize data transmission and complete related business operations. According to the relevant protocol requirements, the information content is BASE64 encoded to ensure the security of information distribution. After actual work testing, the system has a small load and stable operation. At the same time, it also uses mature network technology to expand the service methods and service fields for meteorological services.

USSD technology

USSD is an emerging interactive short message platform technology [1], which is a new type of interactive data service based on the Global System for Mobile Communications (GSM) network. The USSD system adopts a connection-oriented interactive conversation mode, which can provide data services with comprehensive and interactive information services. Both USSD and SMS are circuit-bearing services, but USSD maintains a wireless connection during the session and provides transparent pipes without storing and forwarding. Therefore, USSD does not need to re-establish the channel every time a message is sent. In terms of response time, USSD responds faster than short messages, thereby increasing users' enthusiasm for participating in interactions. USSD has the following characteristics.

Powerful. It can provide services in the form of dialogue and information business menu.

Easy to operate. The user does not need to input tedious instructions and operates according to the menu. Intuitive and convenient.

Efficient. In an interactive application, since only one connection needs to be established, the delay in establishing signaling connections multiple times is reduced, and the response speed is improved.

Wide range of applications. USSD can run on all current GSM mobile phones and supports roaming function.

USSD can develop a variety of special services, and can use its interactive menu function to establish a variety of information portal services such as mobile banking, financial stock trading, mobile phone bill inquiry, weather information inquiry, email sending and receiving, etc. USSD technology is used alone or combined with current SMS and GPRS technologies, and the market prospect is very broad. USSD business process

The USSD service is currently designed and implemented based on the Shandong Meteorological Mobile SMS platform. After the user enters the USSD portal and selects a specific service according to the menu, the USSD portal will send a request to the mobile 96159 platform (96159 is Shandong Mobile's own business platform), and 96159 sends a request to the SP party according to the specific request [2] (The Bureau of Meteorology is one of the SP ) Forwarding, after receiving the request, the meteorological SMS platform generates an XML message and returns it to the 96159 platform, which is then packaged and packaged by the 96159 platform, submitted to the USSD portal, and finally displayed on the user terminal [3] (see Figure 1 ). Among them, the transmission process message is in XML format, the http short connection mode is used between the 96159 platform and the SP platform, and the interface mode adopts the synchronous request / response mode. In short, the USSD portal is responsible for the design of the business menu and the interactive display of users. The 96159 platform plays the role of authentication instructions and charging judgment in the entire USSD processing process, and the SP platform is responsible for specific business response and information processing.

For users, only need to remember the USSD business service number (which can be saved in the phone address book), for example: Shandong mobile phone users can obtain information services by directly dialing the number listed in Table 1. Compared with traditional methods, this kind of operation undoubtedly greatly improved the execution efficiency, and the average response time was shortened by 80%.

ASP script programming interface

Because the back-end database of the meteorological short message platform is SQL SERVER, and the ASP program has a good access mode with the SQL SERVER database, it is also a script program, which is refined and flexible. At the same time, the technical application of ASP in reading and constructing XML messages is very mature [ 4], comprehensive consideration, choose ASP as the interface programming language. The following is a brief description of the asp script writing process through the code.

The first step: First parse the SPServiceAccessReq request packet passed from the 96159 platform.

Set ReceivedDoc = server.CreateObject ("Msxml2.DOMDocument") ReceivedDoc.load Request

TransacTIonID = ReceivedDoc.selectSingleNode ("// Head / TransacTIonID"). Text


feemsisdn = ReceivedDoc.selectSingleNode ("// Body / Request / FeeMSISDN"). text

linkid = ReceivedDoc.selectSingleNode ("// Body / Request / LinkID"). text

The second step: call the function to query the database. Here, the ADO [5] component in ASP is used.

Step 3: Generate XML packets from the query results and return them to the 96159 platform.

Step 4: After receiving the 96159 transparently transmitted information packet, the USSD portal analyzes it and responds the result to the user terminal, and finally completes the entire interactive operation.

BASE64 encoding implementation

Base64 [6] is the encoding method used to transmit 8Bit byte codes on the network. In order to encrypt the information, according to the protocol requirements, the content of the Property field in the XML of the return packet needs to be BASE64 encoded. Considering that ASP and Javascript have a good combination ability, we chose to nest Javascript scripts in ASP programs and required the scripts to be executed on the server side, that is, namely