Movatterモバイル変換


[0]ホーム

URL:


CN111917513A - A method of data interaction between mobile terminal and server side - Google Patents

A method of data interaction between mobile terminal and server side
Download PDF

Info

Publication number
CN111917513A
CN111917513ACN202010744007.XACN202010744007ACN111917513ACN 111917513 ACN111917513 ACN 111917513ACN 202010744007 ACN202010744007 ACN 202010744007ACN 111917513 ACN111917513 ACN 111917513A
Authority
CN
China
Prior art keywords
instruction
module
request
data
extended
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
CN202010744007.XA
Other languages
Chinese (zh)
Other versions
CN111917513B (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.)
Shanghai Ocean University
Original Assignee
Shanghai Ocean University
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 Shanghai Ocean UniversityfiledCriticalShanghai Ocean University
Priority to CN202010744007.XApriorityCriticalpatent/CN111917513B/en
Publication of CN111917513ApublicationCriticalpatent/CN111917513A/en
Application grantedgrantedCritical
Publication of CN111917513BpublicationCriticalpatent/CN111917513B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention relates to the field of network interfaces of mobile application, in particular to a data interaction method between a mobile terminal and a server terminal, which is applied to the mobile terminal and the server terminal. An instruction receiving module and an instruction driving module are deployed at the server end, and a construction request instruction module and an instruction sending module are deployed at the mobile end. The request constructing module generates an instruction according to the service logic, the instruction sending module packages the instruction and sends the packaged instruction to the instruction receiving module, the instruction receiving module analyzes the extended instruction and sends the analyzed extended instruction to the instruction driving module, the instruction receiving module sends the instruction to the instruction driving module, the instruction driving module processes the extended instruction to obtain returned data, and the returned data are returned according to the original path. The method can enable the mobile application calling interface to be as calling a local function, and brings great convenience to program debugging. In this mode, when the function needs to be modified or a new function needs to be added, the modification can be completed only by modifying the instruction driving module, and the expandability of the program is greatly improved.

Description

Translated fromChinese
一种移动端与服务器端数据交互方法A method of data interaction between mobile terminal and server side

技术领域technical field

本发明涉及移动应用开发领域,是一种移动端与服务器端数据交互方法。The invention relates to the field of mobile application development, and relates to a data interaction method between a mobile terminal and a server terminal.

背景技术Background technique

随着智能手机、平板电脑等移动设备的普及,各类移动应用的发展愈加繁荣。与此同时,移动应用的体积越来越庞大,通过网络接口获取数据是移动应用展示内容的主要来源,因此移动应用中的网络通讯模块也变得越来越重要。由于移动应用与网络接口的交互在移动应用开发中具有重要地位,并且在移动应用程序中,网络接口请求的代码块非常多而且所在位置比较离散,所以移动应用和网络接口的交互模块在编写和调试上具有较高的复杂度,影响着移动应用的开发效率。With the popularity of mobile devices such as smartphones and tablet computers, the development of various mobile applications has become more prosperous. At the same time, the volume of mobile applications is getting larger and larger, and obtaining data through a network interface is the main source of the content displayed by the mobile application. Therefore, the network communication module in the mobile application is also becoming more and more important. Because the interaction between mobile applications and network interfaces plays an important role in mobile application development, and in mobile applications, there are many code blocks requested by network interfaces and their locations are relatively discrete, so the interaction modules between mobile applications and network interfaces are written and Debugging has high complexity, which affects the development efficiency of mobile applications.

目前存在很多成熟的框架可用于实现移动应用与网络接口交互的开发,例如在安卓开发中可以采用Retrofit请求框架,后台则常采用Struts2,SpringMVC等框架。这些框架对于移动开发中的网络通讯模块已经给出了可行的解决方案。在后台服务器编写接口,移动应用程序中编写请求。对于每一个移动端的网络接口调用,在服务器端对应已编写好的url,实现对应请求参数的处理代码模块。这种明确的分工使得移动应用开发中的接口调试与协同开发变得困难和复杂。在没有开发网络接口之前,移动端开发时的UI显示只能使用假数据填充,之后再改为网络接口请求来的数据,并调试接口数据的适配问题,其中开发出错率,以及开发复杂度都显著提高。At present, there are many mature frameworks that can be used to realize the development of interaction between mobile applications and network interfaces. For example, the Retrofit request framework can be used in Android development, and Struts2, SpringMVC and other frameworks are often used in the background. These frameworks have given feasible solutions for network communication modules in mobile development. Write the interface in the background server, and write the request in the mobile application. For each mobile terminal network interface call, the server side corresponds to the prepared url, and implements the processing code module corresponding to the request parameters. This clear division of labor makes interface debugging and collaborative development in mobile application development difficult and complicated. Before the development of the network interface, the UI display during mobile terminal development can only be filled with fake data, and then change to the data requested by the network interface, and debug the adaptation of the interface data, among which the development error rate and development complexity. are significantly improved.

现有的设计模式中,移动应用想要访问服务器资源,需要通过HTTP协议向指定的服务器传递信息,服务器根据应用请求调用相应的接口,并返回相应的结果。整个流程所涉及的操作为移动端定义请求接口方法,创造请求数据,填充URL和数据,向服务器发送请求,服务器调用指定URL的网络接口处理请求,返回请求结果,移动端根据请求结果刷新UI。在这种设计模式下,移动端与服务器端交互时传递的数据较为复杂,并且特定URL的请求数据和返回数据必须事先约定。请求数据和URL之间却没有明确的联系,如果在发送请求时携带了错误的请求数据,移动端将不能接受到正常的返回结果。In the existing design mode, if a mobile application wants to access server resources, it needs to transmit information to a designated server through the HTTP protocol, and the server calls the corresponding interface according to the application request and returns the corresponding result. The operations involved in the whole process define the request interface method for the mobile terminal, create the request data, fill in the URL and data, send the request to the server, the server calls the network interface of the specified URL to process the request, returns the request result, and the mobile terminal refreshes the UI according to the request result. In this design mode, the data transmitted when the mobile terminal interacts with the server terminal is more complex, and the request data and return data of a specific URL must be agreed in advance. However, there is no clear connection between the request data and the URL. If the wrong request data is sent when the request is sent, the mobile terminal will not be able to receive the normal return result.

上述模式中存在的另一个问题是接口对请求数据的逻辑处理耦合在接口之中,即使是使用MVC架构将逻辑处理模块独立起来,逻辑处理模块所处理的数据仍然需要通过上层数据接收层传递给它,并没有把网络请求的发送与接收完全屏蔽,无法真正实现移动端像调用函数一样调用接口,无法达到移动端与服务器端数据的一致性。Another problem in the above mode is that the logical processing of the requested data by the interface is coupled in the interface. Even if the logical processing module is independent of the MVC architecture, the data processed by the logical processing module still needs to be passed to the upper data receiving layer. It does not completely block the sending and receiving of network requests, and it cannot really realize that the mobile terminal can call the interface like a function call, and it cannot achieve the consistency of the data between the mobile terminal and the server side.

此外,上述模式中服务器端和移动端在开发模块实现隔离的同时对交互数据也进行了隔离,因而难以实现协同开发。因而,涉及网络请求的移动应用开发不能仅考虑移动端,如何让移动端和服务器端相辅相成,配合恰当,在简化移动端的同时可以让服务器端也方便的开发接口,实现协同开发,从而降低开发复杂度,让移动端和服务器端具有数据一致性的同时也具有模块隔离性,是目前移动应用中网络通讯模块设计与开发面临的主要问题。In addition, in the above mode, the server side and the mobile side isolate the interactive data while the development module is isolated, so it is difficult to achieve collaborative development. Therefore, the development of mobile applications involving network requests cannot only consider the mobile terminal. How to make the mobile terminal and the server side complement each other and cooperate properly? While simplifying the mobile terminal, it can also allow the server side to develop a convenient interface to achieve collaborative development, thereby reducing the complexity of development. It is the main problem facing the design and development of network communication modules in mobile applications at present.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于针对现有技术中的不足,提供一种移动端与服务器端数据交互方法,通过在服务器端和移动端之间采用约定格式的指令进行交互通信,以确保请求的指令和返回数据之间具有更好的一致性,并在业务逻辑层面隔离指令的网络传输过程。The purpose of the present invention is to provide a method for data interaction between a mobile terminal and a server terminal, aiming at the deficiencies in the prior art. There is better consistency between data, and the network transmission process of instructions is isolated at the business logic level.

本发明所解决的技术问题可以采用以下技术方案来实现:The technical problem solved by the present invention can be realized by the following technical solutions:

一种移动端与服务器端数据交互方法,应用于移动端和服务器端,其包括以下步骤:A method for data interaction between a mobile terminal and a server terminal, applied to the mobile terminal and the server terminal, includes the following steps:

(S1)构造请求指令模块根据业务逻辑模块的请求构造指令;所述指令包括操作码和操作数;所述操作码包括所述指令请求服务器端操作的类和对类的操作,所述操作数为对类操作过程中的参数;(S1) The construction request instruction module constructs an instruction according to the request of the business logic module; the instruction includes an operation code and an operand; the operation code includes the class of the instruction requesting the server-side operation and the operation on the class, the operand It is a parameter in the operation process of the class;

(S2)指令发送模块对所述指令进行解析,根据所述指令的类型对所述指令进行相应处理,并加入标签信息,以得到扩展指令;(S2) The instruction sending module parses the instruction, performs corresponding processing on the instruction according to the type of the instruction, and adds label information to obtain an extended instruction;

(S3)所述指令发送模块将所述扩展指令发送至所述指令接收模块;(S3) the instruction sending module sends the extended instruction to the instruction receiving module;

(S4)所述指令接收模块对所述扩展指令进行解析,以还原所述指令;并将还原后的指令发送至所述指令驱动模块;(S4) the instruction receiving module parses the extended instruction to restore the instruction; and sends the restored instruction to the instruction driving module;

(S5)所述指令驱动模块根据所述指令中的操作码调用相应类及其操作对所述指令中的操作数进行处理,以获得返回数据,并将所述返回数据发送至所述指令接收模块;(S5) The instruction driving module calls the corresponding class and its operation according to the opcode in the instruction to process the operand in the instruction to obtain return data, and sends the return data to the instruction receiving module;

(S5)所述指令接收模块将所述返回数据以及代表其种类的标签信息封装成扩展指令发送至所述指令发送模块;(S5) The instruction receiving module encapsulates the returned data and the label information representing its type into an extended instruction and sends it to the instruction sending module;

(S6)所述指令发送模块对返回的扩展指令进行解析,得到返回数据,并发送至所述构造请求指令模块;(S6) described instruction sending module parses the returned extended instruction, obtains return data, and sends to described construction request instruction module;

(S7)所述构造请求指令模块将接收的返回数据转发至所述业务逻辑模块。(S7) The construction request instruction module forwards the received return data to the business logic module.

本发明的进一步改进在于,所述指令以及所述扩展指令以json格式实现。A further improvement of the present invention is that the instruction and the extended instruction are implemented in json format.

本发明的进一步改进在于,所述服务器端和所述移动部署在同一设备上时,所述构造请求指令模块将指令直接发送至所述指令驱动模块,所述指令驱动模块直接将返回数据发送至所述构造请求指令模块。A further improvement of the present invention is that when the server and the mobile are deployed on the same device, the construction request instruction module directly sends the instruction to the instruction driving module, and the instruction driving module directly sends the return data to The construction request instruction module.

本发明的进一步改进在于,所述指令驱动模块包括对象管理器以及分析器;A further improvement of the present invention is that the instruction driving module includes an object manager and an analyzer;

所述分析器用于解析所述指令中的操作码,获得操作码对应的类以及对类的操作,并将解析结果转发至所述对象管理器;The analyzer is used to parse the opcode in the instruction, obtain the class corresponding to the opcode and the operation on the class, and forward the parsing result to the object manager;

所述对象管理器中关联存储有所述服务器端可操作的类以及类的各个操作,并根据所述分析器的分析结果调用相应的类以及对类的操作,同时代入指令中的操作数,以获取返回数据。The object manager is associated and stored with the server-side operable classes and various operations of the classes, and calls the corresponding classes and operations on the classes according to the analysis results of the analyzer, and substitutes the operands in the instructions at the same time, to get the return data.

本发明的进一步改进在于,所述指令驱动模块还包括异常处理模块;当所述分析器检测到异常的操作码时,将操作码对应的指令转发至所述异常处理模块,由所述异常处理模块进行记录,并生成相应的返回数据。A further improvement of the present invention lies in that the instruction driving module further includes an exception processing module; when the analyzer detects an abnormal operation code, it forwards the instruction corresponding to the operation code to the exception processing module, and the exception is processed by the exception processing module. The module records and generates corresponding return data.

本发明的进一步改进在于,步骤(S2)中,对所述指令进行处理的方式包括base64编码、对称加密。A further improvement of the present invention is that, in step (S2), the manner of processing the instruction includes base64 encoding and symmetric encryption.

与现有技术相比,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:

1.本发明方法基于移动应用的移动端与服务器端数据交互的特点,构建统一的移动端指令发送方法、统一的服务器端指令接收方法、统一的服务器端指令驱动的逻辑处理方法、统一的数据返回方法,实现移动端与服务器端数据交互的便捷,提高移动应用的网络接口的开发效率。1. The method of the present invention is based on the characteristics of data interaction between the mobile terminal and the server side of the mobile application, and constructs a unified mobile terminal instruction sending method, a unified server-side instruction receiving method, a unified server-side instruction-driven logic processing method, and unified data. The return method realizes the convenience of data interaction between the mobile terminal and the server terminal, and improves the development efficiency of the network interface of the mobile application.

2.在保证模块隔离性的同时也保证了移动端与服务器端面向的交互数据的一致性。2. While ensuring module isolation, it also ensures the consistency of interactive data between the mobile terminal and the server side.

3.指令驱动模块成为实际数据交互的载体,保证程序的扩展性,提高测试效率。3. The instruction-driven module becomes the carrier of actual data interaction, which ensures the extensibility of the program and improves the test efficiency.

4.屏蔽具体网络传输,降低数据耦合度,简化移动端和服务器端的代码编写。4. Shield specific network transmission, reduce data coupling, and simplify code writing on mobile and server ends.

附图说明Description of drawings

图1为本发明所述的指令的结构示意图。FIG. 1 is a schematic structural diagram of an instruction according to the present invention.

图2为本发明所述的移动端与服务器端通讯方法的流程示意图。FIG. 2 is a schematic flowchart of a communication method between a mobile terminal and a server terminal according to the present invention.

具体实施方式Detailed ways

为使本发明实现的技术手段、创作特征、达成目的与功效易于明白了解,下面结合具体实施方式,进一步阐述本发明。In order to make the technical means, creative features, achievement goals and effects realized by the present invention easy to understand, the present invention will be further described below with reference to the specific embodiments.

如图1、2所示,本发明的实施例提供一种移动端与服务器端数据交互方法,应用于移动端和服务器端,该方法包括以下步骤:As shown in Figures 1 and 2, an embodiment of the present invention provides a method for data interaction between a mobile terminal and a server side, which is applied to the mobile terminal and the server side. The method includes the following steps:

(S1)构造请求指令模块根据业务逻辑模块的请求构造指令;指令包括操作码和操作数;操作码包括指令请求服务器端操作的类和对类的操作,操作数为对类操作过程中的参数;(S1) The construction request instruction module constructs an instruction according to the request of the business logic module; the instruction includes an operation code and an operand; the operation code includes the class of the instruction requesting the server-side operation and the operation on the class, and the operand is the parameter in the operation process of the class ;

(S2)指令发送模块对所述指令进行解析,根据所述指令的类型对所述指令进行相应处理,并加入标签信息,以得到扩展指令;(S2) The instruction sending module parses the instruction, performs corresponding processing on the instruction according to the type of the instruction, and adds label information to obtain an extended instruction;

(S3)所述指令发送模块将所述扩展指令发送至所述指令接收模块;(S3) the instruction sending module sends the extended instruction to the instruction receiving module;

(S4)所述指令接收模块对所述扩展指令进行解析,以还原所述指令;并将还原后的指令发送至所述指令驱动模块;(S4) the instruction receiving module parses the extended instruction to restore the instruction; and sends the restored instruction to the instruction driving module;

(S5)所述指令驱动模块根据所述指令中的操作码调用相应类及其操作对所述指令中的操作数进行处理,以获得返回数据,并将所述返回数据发送至所述指令接收模块;(S5) The instruction driving module calls the corresponding class and its operation according to the opcode in the instruction to process the operand in the instruction to obtain return data, and sends the return data to the instruction receiving module;

(S5)所述指令接收模块将所述返回数据以及代表其种类的标签信息封装成扩展指令发送至所述指令发送模块;(S5) The instruction receiving module encapsulates the returned data and the label information representing its type into an extended instruction and sends it to the instruction sending module;

(S6)所述指令发送模块对返回的扩展指令进行解析,得到返回数据,并发送至所述构造请求指令模块;(S6) described instruction sending module parses the returned extended instruction, obtains return data, and sends to described construction request instruction module;

(S7)所述构造请求指令模块将接收的返回数据转发至所述业务逻辑模块。(S7) The construction request instruction module forwards the received return data to the business logic module.

本实施例中,指令由构造请求指令模块生成,指令的结构如图2所示。在操作码中,“类”表示希望调用的对象的名称,“对类的操作”移动端想要服务器端对对象的操作方式,而操作数表示上述操作过程中的参数。在具体实现过程中,操作码和操作数都采用字符串进行表示。操作码中的“类”对应服务器端中的一个对象,而“对类的操作”对应对象的方法。这种面对对象的表达方式复合主流软件开发思想,指令中的内容直观形象,不仅便于服务器端处理,还可降低开发人员的开发难度,在调试过程中抓取的指令的含义直观,不必调用解析工具进行额外解析。In this embodiment, the instruction is generated by the construction request instruction module, and the structure of the instruction is shown in FIG. 2 . In the opcode, "class" indicates the name of the object to be called, "operation on the class" the mobile terminal wants the server to operate on the object, and the operand indicates the parameters in the above operation process. In the specific implementation process, both opcodes and operands are represented by strings. The "class" in the opcode corresponds to an object on the server side, and the "operation on the class" corresponds to the method of the object. This object-oriented expression method is combined with mainstream software development ideas. The content in the instructions is intuitive and visual, which is not only convenient for server-side processing, but also reduces the development difficulty of developers. The meaning of the instructions captured during the debugging process is intuitive, and there is no need to call The parsing tool does additional parsing.

通常移动端与服务器端的交互都是与服务器端的数据库进行交互。现有的关系数据库中,通常将每张表看作一个类,表里的每一行看为一个对象。而移动应用向服务器发送请求,最终也是对服务器数据库进行一定的操作,这些操作是面向数据库表的抽象数据类型的,因此移动应用的网络请求可以根据具体操作的抽象数据类型来划分,所以指令的操作码部分应该包含类和对类的操作,指令的数据部分可能有很多参数,为了更好的组织代码,提高代码质量。Usually the interaction between the mobile terminal and the server side is to interact with the database on the server side. In the existing relational database, each table is usually regarded as a class, and each row in the table is regarded as an object. The mobile application sends a request to the server, and finally performs certain operations on the server database. These operations are abstract data types oriented to database tables. Therefore, the network requests of mobile applications can be divided according to the abstract data types of specific operations. The opcode part should contain classes and operations on classes. The data part of the instruction may have many parameters, in order to better organize the code and improve the code quality.

现有的网络请求库通常只能实现post、get等简单功能。而本实施例中,由于操作码仅需移动端与服务器端约定,因此指令的操作码中的“对类的操作”可以采用更加多样的操作。为了实现这一功能,在移动端与服务器端约定好的情况下,仅需在服务器端实现相应的方法(method),即可供服务器端进行调用。因此采用指令进行交互,可使提高系统的可扩展性。Existing network request libraries usually only implement simple functions such as post and get. However, in this embodiment, since the operation code only needs to be agreed between the mobile terminal and the server terminal, more diverse operations can be adopted for the "operation on the class" in the operation code of the instruction. In order to realize this function, under the condition that the mobile terminal and the server side agree, only the corresponding method (method) needs to be implemented on the server side, which can be called by the server side. Therefore, the use of instructions to interact can improve the scalability of the system.

指令驱动模块是从面向对象的思想出发,它需要实现的功能是能够执行相应的指令,返回执行结果。因此指令驱动模块包括对象管理器以及分析器。分析器用于解析指令中的操作码,获得操作码对应的类以及对类的操作,并将解析结果转发至所述对象管理器。对象管理器中关联存储有所述服务器端可操作的类以及类的各个操作,并根据分析器的分析结果调用相应的类以及对类的操作,同时代入指令中的操作数,以获取返回数据。The instruction-driven module is based on the object-oriented idea. The function it needs to implement is to be able to execute the corresponding instruction and return the execution result. Therefore, the instruction-driven module includes an object manager and an analyzer. The analyzer is used to parse the opcode in the instruction, obtain the class corresponding to the opcode and the operation on the class, and forward the parsing result to the object manager. The server-side operable classes and various operations of the classes are associated and stored in the object manager, and the corresponding classes and operations on the classes are called according to the analysis results of the analyzer, and the operands in the instructions are substituted at the same time to obtain the returned data. .

本实施例中,指令驱动模块还包括异常处理模块;当分析器检测到异常的操作码时,将操作码对应的指令转发至所述异常处理模块,由所述异常处理模块进行记录,并生成相应的返回数据。异常处理模块能够报出异常,并可以提示异常原因,从而提高开发效率。In this embodiment, the instruction driving module further includes an exception processing module; when the analyzer detects an abnormal operation code, it forwards the instruction corresponding to the operation code to the exception processing module, and the exception processing module records and generates corresponding return data. The exception handling module can report exceptions and prompt the cause of exceptions, thereby improving development efficiency.

在本实施例中,指令以及扩展指令采用json格式实现。JSON格式在传输效率上优于其它数据传输格式,主流编程语言均具有丰富的json的工具库。此外,JSON具有便于扩展的特征,可以在其中加入其它字段,已实现更加丰富的功能。In this embodiment, the instruction and the extended instruction are implemented in json format. The JSON format is superior to other data transmission formats in terms of transmission efficiency, and mainstream programming languages have rich json tool libraries. In addition, JSON has the characteristics of easy expansion, and other fields can be added to it, which has achieved richer functions.

例如,在一些实施例中,在指令的JSON中加入指令编号的字段,服务器端在发送返回数据的过程中,将指令编号附加在返回数据的JSON中,以便移动端判断返回数据对应的指令。For example, in some embodiments, a field of an instruction number is added to the JSON of the instruction, and the server side adds the instruction number to the JSON of the returned data during the process of sending the returned data, so that the mobile terminal can determine the instruction corresponding to the returned data.

在开发过程中,移动端和服务器端可部署在同一个设备上,以便联合调试以及协同开发。在此过程中,构造请求指令模块将指令直接发送至指令驱动模块,指令驱动模块直接将返回数据发送至构造请求指令模块。During the development process, the mobile terminal and the server side can be deployed on the same device for joint debugging and collaborative development. In this process, the construction request instruction module directly sends the instruction to the instruction driving module, and the instruction driving module directly sends the return data to the construction request instruction module.

无论是开发过程还是在生产环境,移动端的构造请求指令模块生成的指令和服务器端的指令驱动模块所接收的指令是相同的。同时指令驱动模块生成的返回数据与构造请求指令模块接收到的返回数据是一致的。指令发送模块以及指令接收模块相适配,仅用于传递指令。对于构造请求指令模块、移动端的业务逻辑、指令驱动模块以及服务器端的数据库服务来说,指令的传递过程以及网络通信过程被完全屏蔽,这样可以将网络通信过程完全屏蔽,让程序的编写和调试更加方便,也方便将请求接口函数化。No matter in the development process or in the production environment, the instructions generated by the construction request instruction module of the mobile terminal and the instructions received by the instruction drive module of the server side are the same. At the same time, the return data generated by the instruction driving module is consistent with the return data received by the construction request instruction module. The instruction sending module and the instruction receiving module are adapted to transmit instructions only. For the construction request command module, the business logic of the mobile terminal, the command-driven module, and the database service of the server side, the command transmission process and the network communication process are completely shielded, which can completely shield the network communication process and make program writing and debugging easier. It is convenient and convenient to functionalize the request interface.

在移动应用工程中,出于网络通讯安全性的考虑,往往需要对指令进行处理,例如指令中的操作数为图片、音频视频等文件时,需要对指令进行base64编码,指令中包括用户的密码等敏感数据时,传输过程需要对称加密。为了将传输过程与业务逻辑模块分离,本实施例中,指令发送模块根据指令的类型对所述指令进行相应处理(例如base64编码或对称加密)。扩展指令中包括处理后的指令以及对应的标签信息。指令接收模块可根据标签信息从相应的扩展指令中还原出指令。In mobile application engineering, for the consideration of network communication security, it is often necessary to process instructions. For example, when the operands in the instruction are pictures, audio and video files, etc., the instruction needs to be base64 encoded, and the instruction includes the user's password. For sensitive data, the transmission process requires symmetric encryption. In order to separate the transmission process from the business logic module, in this embodiment, the instruction sending module performs corresponding processing on the instruction according to the type of the instruction (for example, base64 encoding or symmetric encryption). The extended instruction includes the processed instruction and corresponding label information. The instruction receiving module can restore the instruction from the corresponding extended instruction according to the label information.

服务器端返回数据的过程也是以扩展指令的方式在网络中传输的。指令接收模块向指令发送模块发送的扩展指令中包括处理后的返回数据以及相应的信息标签。返回数据需要进行处理目的不仅在于保证网络传输过程中的安全性,标签信息还可使得指令接发送模块可以根据不同的返回数据类型对返回数据采用相应的解析方法,将网络传输引入的额外处理步骤隔离在指令发送模块以及指令接收模块中,降低了系统的耦合性,提高了系统的开发效率以及维护成本。The process of returning data from the server side is also transmitted in the network in the form of extended instructions. The extended instruction sent by the instruction receiving module to the instruction sending module includes the processed return data and the corresponding information label. The purpose of processing the returned data is not only to ensure the security of the network transmission process, but the label information can also enable the command receiving and sending module to adopt corresponding analysis methods for the returned data according to different return data types, introducing additional processing steps into network transmission. It is isolated in the instruction sending module and the instruction receiving module, which reduces the coupling of the system and improves the development efficiency and maintenance cost of the system.

本实施例可以让移动应用调用接口如同调用本地函数,这给程序的调试带来了极大的便利。在这种模式下,当需要修改功能或者是添加新功能时,只需要修改指令驱动模块就可以完成,极大的提高了程序的可扩展性。This embodiment can make the mobile application call the interface as if calling a local function, which brings great convenience to the debugging of the program. In this mode, when you need to modify the function or add a new function, you only need to modify the instruction-driven module to complete it, which greatly improves the scalability of the program.

Claims (6)

CN202010744007.XA2020-07-292020-07-29 A method for data interaction between mobile terminal and server terminalActiveCN111917513B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010744007.XACN111917513B (en)2020-07-292020-07-29 A method for data interaction between mobile terminal and server terminal

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010744007.XACN111917513B (en)2020-07-292020-07-29 A method for data interaction between mobile terminal and server terminal

Publications (2)

Publication NumberPublication Date
CN111917513Atrue CN111917513A (en)2020-11-10
CN111917513B CN111917513B (en)2022-11-22

Family

ID=73286650

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010744007.XAActiveCN111917513B (en)2020-07-292020-07-29 A method for data interaction between mobile terminal and server terminal

Country Status (1)

CountryLink
CN (1)CN111917513B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1534457A (en)*2003-04-022004-10-06Enhanced operating time host computer support
CN101512359A (en)*2006-07-102009-08-19阿斯特瑞昂公司System and method for performing processing in a testing system
CN101988962A (en)*2009-11-092011-03-23上海海洋大学Implementation of interactive information auxiliary system based on ontology and location service
US20110171982A1 (en)*2008-09-192011-07-14Nan WangMethod and device for providing wireless accessed user with a monopolized service control right
CN102289593A (en)*2011-08-222011-12-21上海交通大学Multidisciplinary virtual experiment interactive simulation solution system
CN104020996A (en)*2014-06-132014-09-03中国民航信息网络股份有限公司Instruction front-end system and corresponding instruction front-end interactive method
US20140372970A1 (en)*2013-06-132014-12-18International Business Machines CorporationMethod to auto generate jax-rs rest service implementation classes from existing interfaces
CN106155697A (en)*2016-07-302016-11-23北京慧摩尔科技有限公司A kind of service-oriented Development Framework (YC Framework)
CN106843808A (en)*2017-01-062017-06-13福建升腾资讯有限公司A kind of instruction analytic method of compatible different-format type
CN108877791A (en)*2018-05-232018-11-23百度在线网络技术(北京)有限公司Voice interactive method, device, server, terminal and medium based on view
US20190073227A1 (en)*2011-07-122019-03-07Tongling Yucheng Software Technology Co., LtdService model-oriented software system and operation method thereof

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1534457A (en)*2003-04-022004-10-06Enhanced operating time host computer support
CN101512359A (en)*2006-07-102009-08-19阿斯特瑞昂公司System and method for performing processing in a testing system
US20110171982A1 (en)*2008-09-192011-07-14Nan WangMethod and device for providing wireless accessed user with a monopolized service control right
CN101988962A (en)*2009-11-092011-03-23上海海洋大学Implementation of interactive information auxiliary system based on ontology and location service
US20190073227A1 (en)*2011-07-122019-03-07Tongling Yucheng Software Technology Co., LtdService model-oriented software system and operation method thereof
CN102289593A (en)*2011-08-222011-12-21上海交通大学Multidisciplinary virtual experiment interactive simulation solution system
US20140372970A1 (en)*2013-06-132014-12-18International Business Machines CorporationMethod to auto generate jax-rs rest service implementation classes from existing interfaces
CN104020996A (en)*2014-06-132014-09-03中国民航信息网络股份有限公司Instruction front-end system and corresponding instruction front-end interactive method
CN106155697A (en)*2016-07-302016-11-23北京慧摩尔科技有限公司A kind of service-oriented Development Framework (YC Framework)
CN106843808A (en)*2017-01-062017-06-13福建升腾资讯有限公司A kind of instruction analytic method of compatible different-format type
CN108877791A (en)*2018-05-232018-11-23百度在线网络技术(北京)有限公司Voice interactive method, device, server, terminal and medium based on view

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHANGXIAOXIAO9527: "SOA/软件架构设计---面向服务的架构(SOA详细解释)", 《CSDN》*
旧梦如烟: "面向对象的基本思想", 《CSDN》*

Also Published As

Publication numberPublication date
CN111917513B (en)2022-11-22

Similar Documents

PublicationPublication DateTitle
US11409949B2 (en)Mobile device resource provisioning system and method
CN110457143B (en) Microservice calling methods and devices
CN101826987B (en) A hybrid service support system and method based on a converged open network
CN101699405B (en)Method and device for interaction between host program and plug-in and interaction between plug-ins
US20100082773A1 (en)Screen scraping interface
US20130160064A1 (en)Distributed System Architecture for Control of a Set Top Box
US20120102414A1 (en)Distributed controller of a user interface framework for web applications
CN113127108A (en)Service request processing method and device, storage medium and electronic equipment
CN115550333B (en)Web-based system and method for accessing application in multi-level multi-domain environment
US12045631B2 (en)Page loading method and display apparatus
CN115982257A (en)Interface creation method and related device
US20120102406A1 (en)Composition model for components of a user interface framework for web applications
CN111917513B (en) A method for data interaction between mobile terminal and server terminal
CN118524025A (en)Double-ended communication simulation method, device, storage medium, and program product
CN111694744A (en)Test open method based on monkey source code
CN113064987B (en)Data processing method, apparatus, electronic device, medium, and program product
CN103702221B (en)The content issue presentation system and issue rendering method of Online Video
CN115967709A (en)Request result synchronous returning method, device, terminal equipment and storage medium
CN117749857A (en)Communication method and device of client and server and electronic equipment
CN114546683A (en)Service processing method, device, electronic equipment and storage medium
CN115114046A (en) A data communication method, device, storage medium and device
CN114816358A (en) A service platform development method and device
CN102148755A (en)Mainframe injection component and method for manipulating data packets communicated between emulators and mainframes
CN113032705A (en)Method, device, equipment and medium for processing browser page data
CN114741275A (en)Equipment debugging method, device and equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp