WO2020206955A1 - 一种数据交互的通用处理方法及装置 - Google Patents

一种数据交互的通用处理方法及装置 Download PDF

Info

Publication number
WO2020206955A1
WO2020206955A1 PCT/CN2019/109110 CN2019109110W WO2020206955A1 WO 2020206955 A1 WO2020206955 A1 WO 2020206955A1 CN 2019109110 W CN2019109110 W CN 2019109110W WO 2020206955 A1 WO2020206955 A1 WO 2020206955A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data interaction
usage scenario
parameters
current usage
Prior art date
Application number
PCT/CN2019/109110
Other languages
English (en)
French (fr)
Inventor
黄文浩
吴婷婷
吴慧阳
张志勇
杨成颖
孙迁
Original Assignee
苏宁云计算有限公司
苏宁易购集团股份有限公司
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 苏宁云计算有限公司, 苏宁易购集团股份有限公司 filed Critical 苏宁云计算有限公司
Priority to CA3176864A priority Critical patent/CA3176864A1/en
Publication of WO2020206955A1 publication Critical patent/WO2020206955A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Definitions

  • the present invention relates to the technical field of big data, in particular to a general processing method and device for data interaction.
  • the embodiments of the present invention provide a general processing method and device for data interaction, which can effectively improve the reusability, efficiency and consistency of code, and at the same time realize the method and result of data interaction Features such as consistency, version control, extended use scenarios, environmental monitoring, and error handling.
  • the technical solution is as follows:
  • a general processing method for data interaction includes: initializing data parameter settings for the data interaction service according to preset rules of the data interaction service; and invoking the data interaction according to the initial data parameter in the current usage scenario Service; according to the different data parameters corresponding to the current usage scenario, issue a corresponding data request; perform data processing required by the current usage scenario according to the data returned by the data request.
  • the initialization data parameter setting according to the preset rules of the data interaction service includes: performing basic data interaction transmission according to the agreed rules of the data interaction service Setting of parameters, wherein the basic data interaction input parameters include a basic data interaction address, locally encrypted data used to identify the user's identity, and an identifier used to identify the user's identity.
  • the method before sending the corresponding data request according to the different data parameters corresponding to the current usage scenario, the method further includes: a specific address for data exchange required for the current usage scenario Information difference data parameter identification settings, and set the transfer parameter identification of the data interaction required by the current use scene, and initialize it to an empty object.
  • the sending of a corresponding data request according to the difference data parameter corresponding to the current usage scenario includes: filling in the difference corresponding to the current usage scenario For data parameters, fill in the transfer parameters for data interaction required by the current use scenario.
  • the fourth to sixth possible implementation manners perform the data processing required by the current usage scenario according to the data returned by the data request , Including: judging whether the data returned by the data request is normal data, if so, returning the logical processing corresponding to the normal data, if not, further monitoring whether the current usage scenario requires exception handling, if exception handling is required, then Put the exception handling logic corresponding to the exception handling into the exception callback.
  • a general processing device for data interaction includes: an initialization data parameter setting module, configured to initialize data parameter settings for the data interaction service according to preset rules of the data interaction service; data interaction service
  • the calling module is used for the current use scenario to call the data interaction service according to the initialization data parameters;
  • the data request initiation module is used for issuing corresponding data requests according to the different data parameters corresponding to the current use scenario;
  • the data processing module is used for Perform data processing required by the current usage scenario according to the data returned by the data request.
  • the initialization data parameter setting module is configured to: set basic data interaction input parameters according to the agreed rules of the data interaction service, wherein the basic data Data interaction incoming parameters include data interaction base address, locally encrypted data used to identify the user's identity, and an identifier used to identify the user's identity.
  • the device further includes a difference setting module, and the difference setting module is configured to: in the data request initiation module according to the difference data corresponding to the current usage scenario Parameters, before sending the corresponding data request, perform the identification setting of the differential data parameters of the specific address information required for the data interaction of the current use scene, and set the transfer parameter identification of the data interaction required for the current use scene, and initialize it as an empty object.
  • the data request initiation module is used to: fill in the differential data parameters corresponding to the current usage scenario, and fill in the data interaction required by the current usage scenario Pass parameters.
  • the data processing module is configured to: determine whether the data returned by the data request is normal Data, if yes, return to the logic processing corresponding to the normal data, if not, further monitor whether the current usage scenario requires exception handling, if exception handling is required, put the exception handling logic corresponding to the exception handling into the exception callback Inside.
  • Consistency During the project creation period, the device is initialized according to the agreed specifications of the project data provider and the agreed results. In actual usage scenarios, data requests can be initiated and data feedback results can be obtained by simply calling the data interaction service, achieving the consistency of data interaction methods and results, and uniform processing of input and return data for the front and back data interactions of the development project , Thereby reducing repeated settings and processing in actual use scenarios. Because the input parameters and return data of the project data interaction are unified encapsulated, the development code, steps and logic are simplified, and the reusability and consistent operation of the project code are enhanced The centralization of data interaction and the controllability of versions, and effectively improve development efficiency.
  • Environmental monitoring can configure different data request addresses according to the project development period, test period, and online release, and can automatically obtain the data of the corresponding data provider in the actual use scenario according to the different environment;
  • Error handling including an error handling mechanism, which routinely handles the error data agreed by the rules, and reserves the right to monitor whether there is an error handling mechanism in the usage scenario that requires selective error callback processing.
  • FIG. 1 is a flowchart of a general processing method for data interaction provided by Embodiment 1 of the present invention
  • Fig. 3 is a schematic structural diagram of a general processing device for data interaction provided by Embodiment 2 of the present invention.
  • the general processing method and device for data interaction provided by the embodiment of the present invention throws customizable parameters to the preset use scene and initializes it by adopting the method of dynamic parameter setting, and the use scene is called according to the preset parameter rules. Effectively improve the reusability, efficiency and consistency of the code, and at the same time realize the consistency of the data interaction method and result, version control, extended use scenarios, environmental monitoring, error handling and other functions. Therefore, the embodiment of the present invention provides The general processing method and device for data interaction can be applied to a variety of usage scenarios involving data interaction.
  • FIG. 1 is a flowchart of a general processing method for data interaction provided by Embodiment 1 of the present invention. As shown in Figure 1, the general processing method for data interaction provided by the embodiment of the present invention includes the following steps:
  • the basic data interaction input parameters are set.
  • the basic data interaction input parameters include the data interaction basic address, the local encrypted data used to identify the user's identity, and the user's identity.
  • logo the agreed rules of the data interaction service refer to the pre-determined data interaction service related rules according to the agreed specifications of the project data provider or the agreed rules of the front-end and back-end data interaction of the project.
  • the agreed rules of the front-end and back-end data interaction of the project from the information storage unit or baseUrl (data interaction base address), cookie (encrypted data stored locally, used to identify user identity), token (data interaction Information such as the identification used to identify the user's identity agreed by the two parties is set as the basic data interaction input parameter.
  • initialization is performed in accordance with the agreed rules, and the data parameter settings are initialized.
  • the data request can be initiated and the data feedback result can be obtained by simply calling the data interactive service, thus realizing the data The method of interaction and the consistency of results.
  • step 101 the process of initializing data parameter setting for the data interaction service according to the preset rules of the data interaction service, in addition to the method described in the above steps, can also be implemented in other ways.
  • the implementation of the present invention The example does not limit the specific method.
  • the current usage scenario calls the data interaction service according to the initialization data parameters.
  • the usage scenarios here include multiple usage scenarios such as project development period, tester, online publishing, etc.
  • the call parameters are reserved, and customized parameters can be passed in the actual use scenarios. Some customized parameters can be processed according to different customized parameters. Abnormal types of requests expand the usage scenarios to meet the usage requirements of more scenarios.
  • the current use scenario calls the data interaction service, and fills in the differential data parameters of the actual data interaction url (specific address information for data interaction) to api (a type of data interaction service agreement used to identify specific addresses) according to actual needs In the information) parameter, fill in the parameters that need to be transferred in the current interaction into params (a kind of parameter transfer identifier agreed by the data interaction service) to complete the corresponding data request of the current data interaction.
  • api a type of data interaction service agreement used to identify specific addresses
  • the general processing method for data interaction provided by the embodiment of the present invention further includes:
  • the differential data parameter of the url (specific address information of the data interaction service) for the front and back end data interaction of the customized project is api (a kind of information used to identify the specific address agreed by the data interaction service), and the input of the data interaction service is set Parameter params (a type of parameter transfer identifier agreed by the data interaction service), and initialized to an empty object.
  • step 103 the process of issuing a corresponding data request according to the different data parameters corresponding to the current usage scenario, in addition to the method described in the above steps, can also be implemented in other ways.
  • the embodiment of the present invention is specific The method is not limited.
  • step 104 is a flowchart of specific sub-steps of step 104 in Embodiment 1 of the present invention.
  • the returned data is monitored for error codes, and different error handling mechanisms are given according to different error codes, and reserved to monitor whether there is an error handling mechanism in the use scene.
  • Sexual error callback handling Perform a normal success callback for non-abnormal data, and return the return body of data interaction for use in scenarios.
  • the logic processing returned by the normal data used this time is written into the success callback of the device to meet the conventional needs. If the actual use scenario requires special processing such as data reset for the data return error scenario, the error processing logic can be placed in the error callback. If there is no special processing, leave it blank. The above process can be repeated for different scenarios.
  • step 104 the process of performing data processing required by the current usage scenario in step 104 according to the data returned by the data request can be implemented in other ways besides the method described in the above steps.
  • the method is not limited.
  • Fig. 3 is a schematic structural diagram of a general processing device for data interaction provided by Embodiment 2 of the present invention.
  • the general processing device 2 for data interaction provided by the embodiment of the present invention includes: an initialization data parameter setting module 21, a data interaction service calling module 22, a data request initiating module 23 and a data processing module 24.
  • the initialization data parameter setting module 21 is used to perform initialization data parameter setting for the data interaction service according to the preset rules of the data interaction service. Specifically, the initialization data parameter setting module 21 is used to: according to the agreed rules of the data interaction service, set the basic data interaction input parameters, where the basic data interaction input parameters include the basic address of the data interaction and the parameters used to identify the user's identity. Locally encrypted data, the identification used to identify the user's identity.
  • the data interaction service invocation module 22 is used for invoking the data interaction service according to the initialization data parameters in the current usage scenario.
  • the data request initiation module 23 is configured to issue corresponding data requests according to the different data parameters corresponding to the current usage scenario. Specifically, the data request initiation module 23 is used to: fill in the differential data parameters corresponding to the current use scene, and fill in the transfer parameters of the data interaction required by the current use scene.
  • a difference setting module 25 which is used for:
  • the data request initiation module 23 Before the data request initiation module 23 sends out the corresponding data request according to the different data parameters corresponding to the current use scene, it performs the identification setting of the different data parameters of the specific address information required for data interaction in the current use scene, and sets the current use scene location.
  • the passed parameter identification that requires data interaction is initialized to an empty object.
  • the data processing module 24 is used to perform data processing required by the current usage scenario according to the data returned by the data request. Specifically, the data processing module 24 is used to determine whether the data returned by the data request is normal data, and if so, return the logical processing corresponding to the normal data; if not, further monitor whether the current usage scenario requires exception handling, and if exception handling is required, Put the exception handling logic corresponding to the exception handling into the exception callback.
  • the general processing device for data interaction triggers the general processing method for data interaction
  • only the division of the above functional modules is used as an example for illustration. In actual applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the general processing device for data interaction and the general processing method for data interaction provided in the foregoing embodiment belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • Consistency During the project creation period, the device is initialized according to the agreed specifications of the project data provider and the agreed results. In actual usage scenarios, data requests can be initiated and data feedback results can be obtained by simply calling the data interaction service, achieving the consistency of data interaction methods and results, and uniform processing of input and return data for the front and back data interactions of the development project , Thereby reducing repeated settings and processing in actual use scenarios. Because the input parameters and return data of the project data interaction are unified encapsulated, the development code, steps and logic are simplified, and the reusability and consistent operation of the project code are enhanced The centralization of data interaction and the controllability of versions, and effectively improve development efficiency.
  • Environmental monitoring can configure different data request addresses according to the project development period, test period, and online release, and can automatically obtain the data of the corresponding data provider in the actual use scenario according to the different environment;
  • Error handling including an error handling mechanism, which routinely handles the error data stipulated by the rules, and reserves the monitoring of whether there is an error handling mechanism in the usage scenario for selective error callback processing.
  • These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)
  • Exchange Systems With Centralized Control (AREA)

Abstract

一种数据交互的通用处理方法及装置,属于大数据技术领域。所述方法包括:根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置(101);当前使用场景根据所述初始化数据参数调用所述数据交互服务(102);根据当前使用场景对应的差异性数据参数,发出相应数据请求(103);根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理(104)。该数据交互的通用处理方法及装置,能有效提高代码的复用性、高效性和一致性,并同时实现了数据交互的方法和结果的一致性、版本控制、扩展使用场景、环境监测、错误处理等功能。

Description

一种数据交互的通用处理方法及装置 技术领域
本发明涉及大数据技术领域,特别涉及一种数据交互的通用处理方法及装置。
背景技术
现有数据交互方式是根据具体使用场景,使用具体数据接口传递查询条件来获取数据。该方法不利于数据交互的通用场景处理,比如根据不同的错误状态码提示不同的错误信息;也不利于统一的数据交互接口的版本控制。
发明内容
为了解决现有技术的问题,本发明实施例提供了一种数据交互的通用处理方法及装置,能有效提高代码的复用性、高效性和一致性,并同时实现了数据交互的方法和结果的一致性、版本控制、扩展使用场景、环境监测、错误处理等功能。所述技术方案如下:
第一方面,提供了一种数据交互的通用处理方法,包括:根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置;当前使用场景根据所述初始化数据参数调用所述数据交互服务;根据当前使用场景对应的差异性数据参数,发出相应数据请求;根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理。
结合第一方面,在第一种可能的实现方式中,所述根据数据交互服务的预设规则,进行初始化数据参数设置,包括:根据所述数据交互服务的约定规则,进行基础数据交互传入参数的设置,其中,所述基础数据交互传入参数包括数据交 互基础地址、用于辨别用户身份的本地加密数据、用于辨别用户身份的标识。
结合第一方面,在第二种可能的实现方式中,在根据当前使用场景对应的差异性数据参数,发出相应数据请求之前,所述方法还包括:进行当前使用场景所需数据交互的具体地址信息的差异性数据参数的标识设置,并设置当前使用场景所需数据交互的传递参数标识,并初始化为空对象。
结合第一方面的第二种可能实现方式,在第三种可能的实现方式中,所述根据当前使用场景对应的差异性数据参数,发出相应数据请求,包括:填入当前使用场景对应的差异性数据参数,填写当前使用场景所需数据交互的传递参数。
结合第一方面的第一至三种可能实现方式中的任一种,在第四至六种可能的实现方式中,根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理,包括:判断所述数据请求返回的数据是否是正常数据,如果是,返回所述正常数据对应的逻辑处理,如果否,进一步监测所述当前使用场景是否需要异常处理,如果需要异常处理,则将所述异常处理对应的异常处理逻辑放入异常回调内。
第二方面,提供了一种数据交互的通用处理装置,所述装置包括:初始化数据参数设置模块,用于根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置;数据交互服务调用模块,用于当前使用场景根据所述初始化数据参数调用所述数据交互服务;数据请求发起模块,用于根据当前使用场景对应的差异性数据参数,发出相应数据请求;数据处理模块,用于根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理。
结合第二方面,在第一种可能的实现方式中,所述初始化数据参数设置模块用于:根据所述数据交互服务的约定规则,进行基础数据交互传入参数的设置,其中,所述基础数据交互传入参数包括数据交互基础地址、用于辨别用户身份的本地加密数据、用于辨别用户身份的标识。
结合第二方面,在第二种可能的实现方式中,所述装置还包括差异性设置模块,所述差异性设置模块用于:在所述数据请求发起模块根据当前使用场景对应 的差异性数据参数,发出相应数据请求之前,进行当前使用场景所需数据交互的具体地址信息的差异性数据参数的标识设置,并设置当前使用场景所需数据交互的传递参数标识,并初始化为空对象。
结合第二方面的第二种可能实现方式,在第三种可能的实现方式中,数据请求发起模块用于:填入当前使用场景对应的差异性数据参数,填写当前使用场景所需数据交互的传递参数。
结合第二方面的第一至三种可能实现方式中的任一种,在第四至六种可能的实现方式中,所述数据处理模块用于:判断所述数据请求返回的数据是否是正常数据,如果是,返回所述正常数据对应的逻辑处理,如果否,进一步监测所述当前使用场景是否需要异常处理,如果需要异常处理,则将所述异常处理对应的异常处理逻辑放入异常回调内。
本发明实施例提供的技术方案带来的有益效果是:
(1)一致性,在项目创建时期,根据项目数据提供方约定规范,按照约定结果对本装置进行初始化。实际使用场景中,只需调用数据交互服务即可发起数据请求和得到数据反馈结果,实现了数据交互的方法和结果的一致性,为开发项目的前后端数据交互入参和返回数据的统一处理,从而减少了实际使用场景中重复设置和处理由于采用对项目数据交互的入参和返回数据进行统一封装处理,简化了开发的代码、步骤和逻辑,增强了项目代码的重用性、操作的一致性、数据交互的中心化和版本的可控性,并有效提高开发效率。
(2)具体到版本控制,现有数据交互的方式在编程人员进行系统开发的过程中,开发人员在前后端数据交互时需要对当前使用场景对数据交互的入参和出参都需分别进行设置和处理,不利于代码功能的解耦和重用,也给整体项目的一致性带来了不小的挑战,无法对数据交互进行统一处理,也无法对数据交互进行统一的版本控制,基于此创新的引入了版本控制的概念,可根据实际使用场景调用不同版本的数据,轻松实现数据的版本控制,能应对不同场景不同情况的数据控制。
(3)扩展性,保留调用参数,可供实际使用场景中传递定制化的参数,可根据定制化参数的不同,处理一些异常类型的请求,扩展使用场景,满足更多场景的使用需求;
(4)环境监测,可以根据项目开发期、测试期、线上发布配置不同的数据请求地址,能够在实际使用场景根据所处的环境不同来自动获取对应的数据提供方的数据;
(5)错误处理,含有错误处理机制,该机制对规则约定的错误数据进行常规处理,并预留监测使用场景内是否有需要错误处理机制进行选择性的错误回调处理。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例1提供的数据交互的通用处理方法流程图;
图2是本发明实施例1中104步骤的具体子步骤流程图;
图3是本发明实施例2提供的数据交互的通用处理装置结构示意图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。需要说明的是,在本发明的描述中,“多个”或“多种”的含义是两个以上,除非另有明确具体的限定。
本发明实施例提供的数据交互的通用处理方法及装置,通过采用动态参数设置的方式,对预设使用场景抛出可定制化参数并初始化,使用场景按照预设的参数规则,进行调用,能有效提高代码的复用性、高效性和一致性,并同时实现了数据交互的方法和结果的一致性、版本控制、扩展使用场景、环境监测、错误处理等功能,因此,本发明实施例提供的该数据交互的通用处理方法及装置,可以应用于涉及数据交互的多种使用场景。
下面结合具体实施例及附图,对本发明实施例提供的数据交互的通用处理方法及装置作详细说明。
实施例1
图1是本发明实施例1提供的数据交互的通用处理方法流程图。如图1所示,本发明实施例提供的数据交互的通用处理方法,包括以下步骤:
101、根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置。
具体的,根据数据交互服务的约定规则,进行基础数据交互传入参数的设置,其中,基础数据交互传入参数包括数据交互基础地址、用于辨别用户身份的本地加密数据、用于辨别用户身份的标识。这里,数据交互服务的约定规则是指根据项目数据提供方约定规范或项目前后端数据交互的约定规则,进行预先确定的数据交互服务相关规则。
示例性地,根据项目前后端数据交互的约定规则,从信息的存储单元内或者baseUrl(数据交互基础地址),cookie(存储在本地经过加密的数据,用于辨别用户身份),token(数据交互双方约定的用于辨别用户身份的标识)等信息,设置为基础数据交互传入参数。在项目创建时期,根据项目数据交互服务的约定规则,按照约定规则进行初始化,初始化数据参数设置,实际使用场景中,只需调用数据交互服务即可发起数据请求和得到数据反馈结果,实现了数据交互的方法和结果的一致性。
值得注意的是,步骤101根据数据交互服务的预设规则,对数据交互服务 进行初始化数据参数设置的过程,除了上述步骤所述的方式之外,还可以通过其他方式实现该过程,本发明实施例对具体的方式不加以限定。
102、当前使用场景根据初始化数据参数调用数据交互服务。
具体的,这里的使用场景包括项目开发期、测试器、线上发布等多种使用场景,保留调用参数,可供实际使用场景中传递定制化的参数,可根据定制化参数的不同,处理一些异常类型的请求,扩展使用场景,满足更多场景的使用需求。
值得注意的是,步骤102当前使用场景根据初始化数据参数调用数据交互服务的过程,除了上述步骤所述的方式之外,还可以通过其他方式实现该过程,本发明实施例对具体的方式不加以限定。
103、根据当前使用场景对应的差异性数据参数,发出相应数据请求。
具体的,填入当前使用场景对应的差异性数据参数,填写当前使用场景所需数据交互的传递参数。
示例性地,当前使用场景调用数据交互服务,根据实际需求填入实际数据交互url(数据交互的具体地址信息)的差异性数据参数到api(数据交互服务约定的一种用于标识具体地址的信息)参数内,填写当前交互需要传递的参数到params(数据交互服务约定的一种传递参数的标识)内,即可完成当前数据交互的相应数据请求。
在根据当前使用场景对应的差异性数据参数,发出相应数据请求之前,本发明实施例提供的数据交互的通用处理方法还包括:
进行当前使用场景所需数据交互的具体地址信息的差异性数据参数的标识设置,并设置当前使用场景所需数据交互的传递参数标识,并初始化为空对象。
示例性地,定制项目前后端数据交互的url(数据交互服务的具体地址信息)差异性数据参数为api(数据交互服务约定的一种用于标识具体地址的信息),设置数据交互服务的入参params(数据交互服务约定的一种传递参数的标识),并初始化为空对象。
值得注意的是,步骤103根据当前使用场景对应的差异性数据参数,发出 相应数据请求的过程,除了上述步骤所述的方式之外,还可以通过其他方式实现该过程,本发明实施例对具体的方式不加以限定。
104、根据数据请求返回的数据进行当前使用场景所需的数据处理。
图2是本发明实施例1中104步骤的具体子步骤流程图。
具体的,如图2所示,判断数据请求返回的数据是否是正常数据,如果是,返回正常数据对应的逻辑处理,如果否,进一步监测当前使用场景是否需要异常处理,如果需要异常处理,则将异常处理对应的异常处理逻辑放入异常回调内。
示例性地,根据项目前后端数据交互的约定规则,对返回数据进行错误码监测,根据不同的错误码给出不同的错误处理机制,并预留监测使用场景内是否有需要错误处理机制进行选择性的错误回调处理。对无异常数据进行正常的成功回调,返回数据交互的返回体,供使用场景使用。实际使用场景将本次使用的正常数据返回的逻辑处理写入本装置的成功回调内,即可满足常规需求。如果实际使用场景需要对数据返回错误场景进行数据重置等特殊处理,可将错误处理的逻辑放入错误回调内,如果没有特殊处理,可不填。不同场景使用可重复上述流程。
值得注意的是,步骤104根据数据请求返回的数据进行当前使用场景所需的数据处理的过程,除了上述步骤所述的方式之外,还可以通过其他方式实现该过程,本发明实施例对具体的方式不加以限定。
实施例2
图3是本发明实施例2提供的数据交互的通用处理装置结构示意图。如图2所示,本发明实施例提供的数据交互的通用处理装置2,包括:初始化数据参数设置模块21、数据交互服务调用模块22、数据请求发起模块23和数据处理模块24。
其中,初始化数据参数设置模块21,用于根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置。具体的,初始化数据参数设置模块21用于:根据数据交互服务的约定规则,进行基础数据交互传入参数的设置,其中, 基础数据交互传入参数包括数据交互基础地址、用于辨别用户身份的本地加密数据、用于辨别用户身份的标识。
数据交互服务调用模块22,用于当前使用场景根据初始化数据参数调用数据交互服务。
数据请求发起模块23,用于根据当前使用场景对应的差异性数据参数,发出相应数据请求。具体的,数据请求发起模块23用于:填入当前使用场景对应的差异性数据参数,填写当前使用场景所需数据交互的传递参数。8、根据权利要求6所述的装置,上述装置还包括差异性设置模块25,差异性设置模块25用于:
在数据请求发起模块23根据当前使用场景对应的差异性数据参数,发出相应数据请求之前,进行当前使用场景所需数据交互的具体地址信息的差异性数据参数的标识设置,并设置当前使用场景所需数据交互的传递参数标识,并初始化为空对象。
数据处理模块24,用于根据数据请求返回的数据进行当前使用场景所需的数据处理。具体的,数据处理模块24用于:判断数据请求返回的数据是否是正常数据,如果是,返回正常数据对应的逻辑处理,如果否,进一步监测当前使用场景是否需要异常处理,如果需要异常处理,则将异常处理对应的异常处理逻辑放入异常回调内。
需要说明的是:上述实施例提供的数据交互的通用处理装置在触发数据交互的通用处理方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据交互的通用处理装置与数据交互的通用处理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
上述所有可选技术方案,可以采用任意结合形成本发明的可选实施例,在此不再一一赘述。
综上所述,本发明实施例提供的数据交互的通用处理方法及装置,相比现有技术具有以下有益效果:
(1)一致性,在项目创建时期,根据项目数据提供方约定规范,按照约定结果对本装置进行初始化。实际使用场景中,只需调用数据交互服务即可发起数据请求和得到数据反馈结果,实现了数据交互的方法和结果的一致性,为开发项目的前后端数据交互入参和返回数据的统一处理,从而减少了实际使用场景中重复设置和处理由于采用对项目数据交互的入参和返回数据进行统一封装处理,简化了开发的代码、步骤和逻辑,增强了项目代码的重用性、操作的一致性、数据交互的中心化和版本的可控性,并有效提高开发效率。
(2)具体到版本控制,现有数据交互的方式在编程人员进行系统开发的过程中,开发人员在前后端数据交互时需要对当前使用场景对数据交互的入参和出参都需分别进行设置和处理,不利于代码功能的解耦和重用,也给整体项目的一致性带来了不小的挑战,无法对数据交互进行统一处理,也无法对数据交互进行统一的版本控制,基于此创新的引入了版本控制的概念,可根据实际使用场景调用不同版本的数据,轻松实现数据的版本控制,能应对不同场景不同情况的数据控制。
(3)扩展性,保留调用参数,可供实际使用场景中传递定制化的参数,可根据定制化参数的不同,处理一些异常类型的请求,扩展使用场景,满足更多场景的使用需求;
(4)环境监测,可以根据项目开发期、测试期、线上发布配置不同的数据请求地址,能够在实际使用场景根据所处的环境不同来自动获取对应的数据提供方的数据;
(5)错误处理,含有错误处理机制,该机制对规则约定的错误数据进行常规处理,并预留监测使用场景内是否有需要错误处理机制,以进行选择性的错误回调处理。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过 硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
本申请实施例中是参照根据本申请实施例中实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例中的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例中范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精 神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (10)

  1. 一种数据交互的通用处理方法,其特征在于,包括:
    根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置;
    当前使用场景根据所述初始化数据参数调用所述数据交互服务;
    根据当前使用场景对应的差异性数据参数,发出相应数据请求;
    根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理。
  2. 根据权利要求1所述的方法,其特征在于,所述根据数据交互服务的预设规则,进行初始化数据参数设置,包括:
    根据所述数据交互服务的约定规则,进行基础数据交互传入参数的设置,
    其中,所述基础数据交互传入参数包括数据交互基础地址、用于辨别用户身份的本地加密数据、用于辨别用户身份的标识。
  3. 根据权利要求1所述的方法,其特征在于,在根据当前使用场景对应的差异性数据参数,发出相应数据请求之前,所述方法还包括:
    进行当前使用场景所需数据交互的具体地址信息的差异性数据参数的标识设置,并设置当前使用场景所需数据交互的传递参数标识,并初始化为空对象。
  4. 根据权利要求3所述的方法,其特征在于,所述根据当前使用场景对应的差异性数据参数,发出相应数据请求,包括:
    填入当前使用场景对应的差异性数据参数,填写当前使用场景所需数据交互的传递参数。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理,包括:
    判断所述数据请求返回的数据是否是正常数据,如果是,返回所述正常数据对应的逻辑处理,如果否,进一步监测所述当前使用场景是否需要异常处理,如果需要异常处理,则将所述异常处理对应的异常处理逻辑放入异常回调内。
  6. 一种数据交互的通用处理装置,其特征在于,所述装置包括:
    初始化数据参数设置模块,用于根据数据交互服务的预设规则,对数据交互服务进行初始化数据参数设置;
    数据交互服务调用模块,用于当前使用场景根据所述初始化数据参数调用所述数据交互服务;
    数据请求发起模块,用于根据当前使用场景对应的差异性数据参数,发出相应数据请求;
    数据处理模块,用于根据所述数据请求返回的数据进行所述当前使用场景所需的数据处理。
  7. 根据权利要求6所述的装置,其特征在于,所述初始化数据参数设置模块用于:
    根据所述数据交互服务的约定规则,进行基础数据交互传入参数的设置,
    其中,所述基础数据交互传入参数包括数据交互基础地址、用于辨别用户身份的本地加密数据、用于辨别用户身份的标识。
  8. 根据权利要求6所述的装置,其特征在于,所述装置还包括差异性设置模块,所述差异性设置模块用于:
    在所述数据请求发起模块根据当前使用场景对应的差异性数据参数,发出相应数据请求之前,进行当前使用场景所需数据交互的具体地址信息的差异性数据参数的标识设置,并设置当前使用场景所需数据交互的传递参数标识,并初始化为空对象。
  9. 根据权利要求8所述的装置,其特征在于,所述数据请求发起模块用于:
    填入当前使用场景对应的差异性数据参数,填写当前使用场景所需数据交互的传递参数。
  10. 根据权利要求6至9任一项所述的装置,其特征在于,所述数据处理模块用于:
    判断所述数据请求返回的数据是否是正常数据,如果是,返回所述正常数据对应的逻辑处理,如果否,进一步监测所述当前使用场景是否需要异常处理,如 果需要异常处理,则将所述异常处理对应的异常处理逻辑放入异常回调内。
PCT/CN2019/109110 2019-04-09 2019-09-29 一种数据交互的通用处理方法及装置 WO2020206955A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CA3176864A CA3176864A1 (en) 2019-04-09 2019-09-29 General-purpose processing method and apparatus for data exchange

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910280061.0 2019-04-09
CN201910280061.0A CN110134461B (zh) 2019-04-09 2019-04-09 一种数据交互的通用处理方法及装置

Publications (1)

Publication Number Publication Date
WO2020206955A1 true WO2020206955A1 (zh) 2020-10-15

Family

ID=67569478

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/109110 WO2020206955A1 (zh) 2019-04-09 2019-09-29 一种数据交互的通用处理方法及装置

Country Status (3)

Country Link
CN (1) CN110134461B (zh)
CA (1) CA3176864A1 (zh)
WO (1) WO2020206955A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134461B (zh) * 2019-04-09 2021-08-06 苏宁易购集团股份有限公司 一种数据交互的通用处理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106487861A (zh) * 2015-09-01 2017-03-08 腾讯科技(北京)有限公司 网络数据提供方法和装置
US20170295062A1 (en) * 2014-09-24 2017-10-12 Zte Corporation Method, device and system for configuring runtime environment
CN109408376A (zh) * 2018-09-28 2019-03-01 深圳乐信软件技术有限公司 一种配置数据的生成方法、装置、设备及存储介质
CN109547514A (zh) * 2017-09-22 2019-03-29 北京金山云网络技术有限公司 一种任务处理方法、装置、电子设备及存储介质
CN110134461A (zh) * 2019-04-09 2019-08-16 苏宁易购集团股份有限公司 一种数据交互的通用处理方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100587693C (zh) * 2007-10-30 2010-02-03 金蝶软件(中国)有限公司 从多个数据源获取数据的方法及系统
CN102571550B (zh) * 2010-12-30 2016-05-25 北京亿阳信通科技有限公司 一种通用的信息交互平台和方法
CN105335523A (zh) * 2015-12-01 2016-02-17 深圳市迪菲特科技股份有限公司 一种数据交互方法及Web服务器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170295062A1 (en) * 2014-09-24 2017-10-12 Zte Corporation Method, device and system for configuring runtime environment
CN106487861A (zh) * 2015-09-01 2017-03-08 腾讯科技(北京)有限公司 网络数据提供方法和装置
CN109547514A (zh) * 2017-09-22 2019-03-29 北京金山云网络技术有限公司 一种任务处理方法、装置、电子设备及存储介质
CN109408376A (zh) * 2018-09-28 2019-03-01 深圳乐信软件技术有限公司 一种配置数据的生成方法、装置、设备及存储介质
CN110134461A (zh) * 2019-04-09 2019-08-16 苏宁易购集团股份有限公司 一种数据交互的通用处理方法及装置

Also Published As

Publication number Publication date
CN110134461A (zh) 2019-08-16
CN110134461B (zh) 2021-08-06
CA3176864A1 (en) 2020-10-15

Similar Documents

Publication Publication Date Title
TWI734088B (zh) 基於區塊鏈的交易處理方法及裝置、電子設備
CN104081748B (zh) 文档通信运行时接口
CN108833578B (zh) 基于fifo命名管道进行双工通信的方法及相关设备
CN111144883B (zh) 一种区块链网络的处理性能分析方法及装置
CN107770269B (zh) 一种服务响应方法及其终端
WO2021082340A1 (zh) 数据处理方法、装置、系统和存储介质
WO2019001074A1 (zh) 一种远程过程调用的方法、装置及计算机设备
CN110659018A (zh) 一种流程引擎实现方法及装置
US20150143334A1 (en) Message exchange pattern rendezvous abstraction
EP3101965A1 (en) Method and apparatus for adjacent node registration, and method and system for crossing node registration
CN112866421B (zh) 基于分布式缓存以及nsq的智能合约运行方法及装置
US20150371327A1 (en) System for dynamically selecting a communications fabric
CN109478148A (zh) 基于工作流程的对象析构
WO2018076882A1 (zh) 存储设备的操作方法及物理服务器
WO2020206955A1 (zh) 一种数据交互的通用处理方法及装置
CN110597634A (zh) 一种数据处理方法、装置及计算机可读存储介质
US20170163768A1 (en) Method and apparatus for expanding transactions in opc ua
JP2012503455A (ja) ネットワークにおけるアクセス制御方法およびネットワーク
CN108632321A (zh) 基于大数据平台下资源调度的处理方法和装置
CN107025126B (zh) 一种资源调度方法、nfvo和系统
WO2023168913A1 (zh) Sdk与接入应用的兼容方法、装置、设备及介质
US8583610B2 (en) Dynamically extending a plurality of manageability capabilities of it resources through the use of manageability aspects
RU2676423C2 (ru) Способ и устройство для реализации концепции транзакций в opc ua посредством механизма таймаута
EP2942711A2 (en) Dynamic generation of proxy connections
CN111031123B (zh) Spark任务的提交方法、系统、客户端及服务端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19923793

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19923793

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.04.2022)

ENP Entry into the national phase

Ref document number: 3176864

Country of ref document: CA

122 Ep: pct application non-entry in european phase

Ref document number: 19923793

Country of ref document: EP

Kind code of ref document: A1