WO2019136800A1 - Service processing method, apparatus and device, and computer-readable storage medium - Google Patents

Service processing method, apparatus and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2019136800A1
WO2019136800A1 PCT/CN2018/077139 CN2018077139W WO2019136800A1 WO 2019136800 A1 WO2019136800 A1 WO 2019136800A1 CN 2018077139 W CN2018077139 W CN 2018077139W WO 2019136800 A1 WO2019136800 A1 WO 2019136800A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
content
attribute information
configuration file
interface
Prior art date
Application number
PCT/CN2018/077139
Other languages
French (fr)
Chinese (zh)
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 平安科技(深圳)有限公司
Publication of WO2019136800A1 publication Critical patent/WO2019136800A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a service processing method, apparatus, device, and computer readable storage medium.
  • a request interface is written for each type of service, and the service parameters are transmitted for different service requests, correspondingly, multiple package objects need to be created, and then each interface is separately processed in response to the corresponding service request, so that each additional service is added.
  • the request needs to increase the development of an interface, increase the workload of interface development, and too many interfaces will make the interface more confusing and inconvenient to manage.
  • the embodiment of the present application provides a service processing method, device, device, and computer readable storage medium, which can process different types of services through the same interface.
  • the embodiment of the present application provides a service processing method, where the method includes: receiving, by an interface, a service request initiated by a user, where the data carried by the service request includes a service parameter, a user ID, and a service ID of an identifier type;
  • the content of the latest configuration file corresponding to the interface, the content includes a service ID that identifies a different type of service, and first attribute information and second attribute information of the corresponding type of service; and converts the data carried by the service request into a JSONObject object Obtaining a service ID and a user ID of the service request from the JSONObject object; acquiring corresponding first attribute information from the content according to the service ID, and obtaining the location from the JSONObject object according to the first attribute information; Determining a service parameter that is required to be delivered by the service request; determining whether the user ID that sends the service request has an operation authority for the type of service; and if the user ID has an operation authority for the type of service, according to the service ID
  • the embodiment of the present application further provides a service processing apparatus, where the apparatus includes a unit for executing the foregoing service processing method.
  • the embodiment of the present application further provides a service processing device, where the device includes a memory, and a processor connected to the memory, and the memory is configured to store program data for implementing a service processing method; And a processor for executing program data stored in the memory to perform the method as described in the first aspect above.
  • an embodiment of the present application provides a computer readable storage medium, where the one or more program data is stored, and the one or more program data may be processed by one or more processes.
  • the apparatus is executed to implement the method described in the first aspect above.
  • the embodiment of the present application provides a service processing method, apparatus, device, and computer readable storage medium.
  • the service processing method of the present application By implementing the service processing method of the present application, only one interface needs to be developed, and a corresponding configuration file is configured for the interface, and each type is configured.
  • the service is assigned a service ID.
  • the interface can determine, according to the service ID of the service request, which type of service the service request belongs to, and then invoke the corresponding processing method according to the configuration content of the medium type service in the configuration file.
  • the method, the device, the device and the computer readable storage medium of the present application implement the processing of all types of services in the same interface, and do not need to allocate different interfaces for different types of services. To avoid excessive and confusing interfaces, it is convenient to manage the interface. For a new type of service, you only need to add the corresponding configuration content to the configuration file, and add a new processing method for the unified interface to facilitate the expansion of the interface.
  • FIG. 1 is a schematic flowchart of a service processing method according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a sub-flow of a service processing method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of another sub-process of a service processing method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another sub-process of a service processing method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another sub-process of a service processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic block diagram showing a unit structure of a service processing apparatus according to an embodiment of the present disclosure
  • FIG. 7 is a schematic block diagram showing a subunit structure of a service processing apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic block diagram showing another subunit structure of a service processing apparatus according to an embodiment of the present application.
  • FIG. 9 is a schematic block diagram showing another subunit structure of a service processing apparatus according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of a service processing device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a service processing method according to an embodiment of the present application.
  • the method can run on smart devices such as tablets, laptops, and smart terminals.
  • the steps of the method include S101 to S107.
  • S101 Receive a service request initiated by a user by using an interface, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type.
  • the development staff develops an interface that is associated with the APP front end to implement the service request and processing of the APP front-end user.
  • a configuration file is configured for the interface, and the configuration file includes the configuration content of the type of service that can be implemented, and finally the processing of the service request is passed.
  • the information of the businessInterfaceId field is the service ID of the type of the service, that is, which service is indicated.
  • the attribute information of the service includes the first attribute information and the second attribute information, which are embodied in the businessAttributeKey field and the defaultValue field.
  • the businessAttributeKey field indicates the attribute name of each type of attribute of the service. Some attribute names are customized by the developer, and are consistent with the name of the service parameter to be delivered by the service request, and include the required delivery service parameters defining the service type.
  • the name is the first attribute information, and some attribute names are specified with a uniform name, for example, sqlType (operation type), sqlMap (corresponding execution statement) and other attributes with specific functions, database, or implementation of the business request. Class, etc., for the second attribute information, sqlType and sqlMap are respectively for the database (query, delete, add, etc.) specific operation types and specific execution statements, the implementation class is for other relatively complex business operations. Logic implementation, if the attribute information of sqlType, sqlMap, etc. is included in the configuration parameters of a certain service, the attribute information such as the implementation class name is generally not included.
  • the defaultValue field indicates the attribute value corresponding to the attribute name of the service, such as sqlType, sqlMap corresponding sqlType value, sqlMap value, sqlMap value is an address ID, this address ID reflects the execution statement of the operation database, such as query statement, delete statement , add statements, and so on.
  • the defaultValue field corresponds to the default value specified by the storage attribute name (if there is a default value), such as sqlType value, sqlMap value, database name, and the name of the specific implementation class. If there is no default value, the data transmission in the later stage is required.
  • the attribute value corresponding to the other attribute name corresponding to the businessAttributeKey field is read, and the part attribute value is generally a service parameter that needs to be delivered in the service request, and these service parameters are also parameters that need to be processed in the service request, and are specified by the specified implementation. Class or operation statement of the operation database to implement processing of business parameters.
  • an interface can process different types of services.
  • a new type of service is added, only the corresponding configuration content needs to be added to the service in the configuration file. Therefore, to prevent the interface.
  • the received service request does not have a new type of service, and the original configuration file does not have a corresponding configuration content.
  • the configuration file is saved in the local area of the terminal.
  • the content of the obtained configuration file is saved in the Map collection of the service processing system.
  • Each time a service request is received it is determined whether the configuration file saved locally by the terminal is modified after the last service processing. If the file has not been modified since the last business process, you do not need to re-read the contents of the configuration file. If the configuration file has been modified since the last business process, you need to re-read the contents of the configuration file to replace the saved in the Map collection. The contents of the original configuration file.
  • the String business field is the service ID read from the configuration file
  • the String attribute field is the read attribute name
  • the String defaultValue field is the value of the corresponding attribute name
  • the non-system default value is the service parameter that is read from the service request when the service request is post-processed. For example, if the name of the service parameter is read from the configuration file, the service parameter corresponding to the parameter name in the service request is obtained. value.
  • the step of acquiring the content of the latest configuration file corresponding to the interface in step S102 includes the following sub-steps:
  • S1021 Determine whether the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing ends.
  • reading the content of the configuration file replaces the original content in the Map set as the content of the latest configuration file corresponding to the interface.
  • the content of the configuration file saved in the Map collection is the content of the latest configuration file. Otherwise, the content of the modified configuration file needs to be read again to replace the content of the original configuration file.
  • step S1021 includes the following sub-steps:
  • S10212 Compare the currently read modification time with the modification time of the last read configuration file.
  • the service processing system receives the service request, it needs to read the modification time (that is, the latest modification time) of the configuration file saved locally in the terminal, and the modification time read each time is saved in the service processing system.
  • the modification time currently read and the modification time read last time (when the service request was last received), if the two are consistent, the configuration file has not been modified since the last business processing, otherwise Has been modified.
  • the data of the JSONObject object can be ⁇ "key1": value1, "key2", value2.... ⁇ , and a value (value) corresponds to a key (field). It is very convenient to extract the value of a corresponding field in the JSONObject object. of.
  • the Key corresponds to the name of the service parameter in the service request, and the value corresponds to the specific service parameter.
  • the key in the JSONObject object must be in the form of a string, so you need to convert the business request to a string and then convert the string to a JSONObject object.
  • the JSONObject object contains all the parameters of the business request, so the business ID and user ID can be in it.
  • the user ID is used to indicate the identity of the user
  • the service ID is used to identify which type of service the service being requested by the current service is.
  • the service parameters required for the type are defined in the configuration file, and the service parameters that do not need to be transmitted need not be obtained, and the name of the service parameter to be delivered is specified in the configuration file.
  • the corresponding service parameters are required. Therefore, the corresponding value, that is, the service parameter, is obtained by defining the name of the service parameter to be delivered in the configuration file.
  • step S105 includes the following sub-steps:
  • S1051 Search for the configuration content of the service ID corresponding type service from the content, and obtain a name of the service parameter to be delivered from the configuration content.
  • S1052 Obtain a service parameter corresponding to the name of the service parameter from the JSONObject object.
  • the obtained service parameter is temporarily stored in the information of the String defaultValue field in the Map set, and corresponds to the information of the String attribute field, that is, the Map set includes the service parameters and corresponding processing methods that need to be transmitted by the service ID.
  • the user ID is used to verify the identity of the user, and only users with operational rights can perform operations of this type of service.
  • the corresponding processing method is invoked according to the second attribute information of the service ID to process the required service parameter.
  • the attribute information in the Map set corresponding to the service request includes the service parameters to be delivered, the name of the database, and the corresponding processing method.
  • step S107 includes the following sub-steps:
  • S1071 Determine whether the second attribute information includes a sqlType field and an sqlMap field.
  • the second attribute information includes an implementation class name
  • obtain a loading object corresponding to the implementation class name and call a processing method corresponding to the loading object to process the service parameter.
  • the corresponding type of operation is performed on the database through the corresponding execution statement.
  • the sqlType value is “DEL”, that is, the service parameter in the database is deleted by using the delete statement corresponding to the sqlMap value, or the load object is loaded by loading the implementation class, and the object is loaded.
  • There is a corresponding processing program for processing the business parameter and the business parameter is processed by executing the processing program. After processing the service request, the service parameters read from the service request and temporarily stored in the Map collection are cleared, and the processing result is returned to the user.
  • the processing method of the embodiment of the present application also configures an interface, and the processing of the service request for all service types is implemented in the interface through a configuration file, and the corresponding processing method is invoked according to different request services in the configuration file.
  • a configuration file For a new service request, add the corresponding configuration content in the configuration file, and then add an implementation class or processing method for the interface, which is convenient to expand; It is convenient to see which business requests are implemented by the interface and it is convenient to manage.
  • FIG. 6 is a schematic block diagram of a service processing apparatus 100 according to an embodiment of the present application.
  • the service processing apparatus 100 includes a receiving unit 101, a first obtaining unit 102, a converting unit 103, a second obtaining unit 104, a third obtaining unit 105, a judging unit 106, and a processing unit 107.
  • the receiving unit 101 is configured to receive a service request initiated by the user by using an interface, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type.
  • the first obtaining unit 102 is configured to acquire the content of the latest configuration file corresponding to the interface, where the content includes a service ID that identifies different types of services, and first attribute information and second attribute information of the corresponding type of service.
  • the converting unit 103 is configured to convert the data carried by the service request into a JSONObject object.
  • the second obtaining unit 104 is configured to obtain the service ID and the user ID of the service request from the JSONObject object.
  • the third obtaining unit 105 is configured to obtain corresponding first attribute information from the content according to the service ID, and obtain, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object.
  • the determining unit 106 is configured to determine whether the user ID that sends the service request has an operation right for the type of service.
  • the processing unit 107 is configured to: if the user ID has an operation authority for the type of service, invoke a corresponding processing method to process the required service parameter according to the second attribute information of the service ID.
  • the configuration file is saved locally in the terminal, and the content of the obtained configuration file is saved in the Map collection.
  • the first obtaining unit 102 includes:
  • the first determining sub-unit 1021 is configured to determine whether the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing ends;
  • the first reading sub-unit 1022 is configured to: if modified, read the content of the configuration file to replace the original content in the Map set as the content of the latest configuration file corresponding to the interface.
  • the confirmation subunit 1023 is configured to read the content saved in the Map set as the content of the latest configuration file corresponding to the interface if not modified.
  • the first determining sub-unit 1021 is specifically configured to compare the currently read modification time with the modification time of the last read configuration file; if the currently read modification time is the last read If the modification time of the configuration file is consistent, it is determined that the content of the configuration file is not modified; if the currently modified modification time is inconsistent with the modification time of the last read configuration file, it is determined that the content of the configuration file has been modified.
  • the first attribute information includes a name of a service parameter to be delivered.
  • the third obtaining unit 105 includes:
  • the first obtaining subunit 1051 is configured to obtain, from the configuration content, a name of a service parameter that needs to be delivered.
  • the second obtaining sub-unit 1052 is configured to obtain a service parameter corresponding to the name of the service parameter from the JSONObject object.
  • the second attribute information includes a name of a database.
  • the processing unit 107 includes:
  • the second determining sub-unit 1071 is configured to determine whether the second attribute information includes a sqlType field and an sqlMap field.
  • the third obtaining sub-unit 1072 is configured to: if the second attribute information includes a sqlType field and an sqlMap field, obtain an sqlType value and an sqlMap value corresponding to the service ID, where the sqlType value maps an operation type of the database, The sqlMap value maps an execution statement of the operation type.
  • the operation subunit 1073 is configured to perform, by using the execution statement, an operation corresponding to the operation type on data matching the service parameter in the database.
  • the third determining sub-unit 1074 is configured to determine, if the second attribute information does not include the sqlType field and the sqlMap field, whether the second attribute information includes an implementation class name.
  • the processing sub-unit 1075 is configured to: if the second attribute information includes an implementation class name, acquire a loading object corresponding to the implementation class name, and call a processing method corresponding to the loading object to process the service parameter.
  • the above business processing apparatus 100 can be implemented in the form of a computer program that can be run on a computer device as shown in FIG.
  • FIG. 10 is a schematic block diagram of a service processing device according to an embodiment of the present application.
  • the device may be a terminal or a server, wherein the terminal may be a communication-enabled electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
  • the server can be a standalone server or a server cluster consisting of multiple servers.
  • the device is a computer device 200 comprising a processor 202 connected by a system bus 201, a non-volatile storage medium 203, an internal memory 204, and a network interface 205.
  • the non-volatile storage medium 203 of the computer device 200 can store an operating system 2031 and a computer program 2032.
  • the processor 202 can be caused to execute a service processing method.
  • the processor 202 of the computer device 200 is used to provide computing and control capabilities to support the operation of the entire computer device 200.
  • the internal memory 204 provides an environment for the operation of the computer program 2032 in the non-volatile storage medium 203, which when executed by the processor 202, causes the processor 202 to perform a business processing method.
  • the network interface 205 of the computer device 200 is used to perform network communications, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the processor 202 can execute an implementation of all of the above described business processing methods when the computer program 2032 in the non-volatile storage medium 203 is run.
  • the application further provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors, when the one or More than one program is executed by one or more processors to implement all of the embodiments of the above described business processing methods.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided are a service processing method, apparatus and device, and a computer-readable storage medium. The implementation of the service processing method only requires developing an interface, configuring a corresponding configuration file for the interface, allocating a service ID to each type of services, and after the interface receives a service request, being able to determine, according to a service ID of the service request, which type of services the service request belongs to, such that the processing of the service request is realized by invoking a corresponding processing method according to the configuration content, in the configuration file, of the type of services. By means of the method, apparatus, device and computer-readable storage medium of the present application, processing processes of all types of services are realized in the same interface, and there is no need to allocate different interfaces for different types of services, thereby preventing the redundancy and disorder of interfaces and facilitating the management of the interfaces. Furthermore, for a newly added type of services, only corresponding configuration content needs to be added to a configuration file so as to newly add a corresponding processing method for an interface, thereby facilitating the expansion of the interface.

Description

业务处理方法、装置、设备及计算机可读存储介质Business processing method, device, device and computer readable storage medium
本申请要求于2018年1月9日提交中国专利局、申请号为201810019635.4、申请名称为“业务处理方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201810019635.4, filed on Jan. 9, 2018, the entire disclosure of which is incorporated herein by reference. The citations are incorporated herein by reference.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种业务处理方法、装置、设备及计算机可读存储介质。The present application relates to the field of computer technologies, and in particular, to a service processing method, apparatus, device, and computer readable storage medium.
背景技术Background technique
为了方便业务的展开,目前很多金融企业都通过金融APP来进行业务,而一般一个企业的业务都会有多个种类,如此,金融APP要进行的业务必然包括多种,例如,按揭抵押贷款APP前端可进行多种业务请求,诸如:订单任务异常处理退回门店提交、定位跟踪订单、获取客服专员列表、获取消息详情、获取消息列表、获取最新未读消息和任务、获取任务详情、获取受影响的任务列表、登录验证、补录信息、提交预约时间、任务分配、任务节点步骤提交、订单改派、节点文件信息提交、提交文件上传等。In order to facilitate the development of the business, many financial companies currently use financial apps to conduct business. Generally, there are many types of business in a company. Therefore, the business to be carried out by financial apps must include various types. For example, the front end of mortgage mortgage APP A variety of business requests can be made, such as: order task exception handling return store submission, location tracking order, get customer service agent list, get message details, get message list, get latest unread messages and tasks, get task details, get affected Task list, login verification, replenishment information, submission appointment time, task assignment, task node step submission, order reassignment, node file information submission, submission file upload, etc.
如果对每一种业务都写一个请求接口,针对不同业务请求传递业务参数也相应地需要创建多个封装对象,然后分别对每个接口实现响应对应业务请求的处理方法,如此每增加一种业务请求便需要增加一个接口的开发,增加接口开发的工作量,而且接口过多会造成接口比较混乱,不便于管理。If a request interface is written for each type of service, and the service parameters are transmitted for different service requests, correspondingly, multiple package objects need to be created, and then each interface is separately processed in response to the corresponding service request, so that each additional service is added. The request needs to increase the development of an interface, increase the workload of interface development, and too many interfaces will make the interface more confusing and inconvenient to manage.
发明内容Summary of the invention
本申请实施例提供了一种业务处理方法、装置、设备及计算机可读存储介质,可通过同一个接口处理不同类型的业务。The embodiment of the present application provides a service processing method, device, device, and computer readable storage medium, which can process different types of services through the same interface.
第一方面,本申请实施例提供了一种业务处理方法,该方法包括:通过接口接收用户发起的业务请求,所述业务请求携带的数据包括业务参数、用户ID和标识类型的业务ID;获取所述接口对应的最新的配置文件的内容,所述内容 包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息;将所述业务请求携带的数据转换为JSONObject对象;从JSONObject对象中获取所述业务请求的业务ID和用户ID;根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数;判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限;若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。In a first aspect, the embodiment of the present application provides a service processing method, where the method includes: receiving, by an interface, a service request initiated by a user, where the data carried by the service request includes a service parameter, a user ID, and a service ID of an identifier type; The content of the latest configuration file corresponding to the interface, the content includes a service ID that identifies a different type of service, and first attribute information and second attribute information of the corresponding type of service; and converts the data carried by the service request into a JSONObject object Obtaining a service ID and a user ID of the service request from the JSONObject object; acquiring corresponding first attribute information from the content according to the service ID, and obtaining the location from the JSONObject object according to the first attribute information; Determining a service parameter that is required to be delivered by the service request; determining whether the user ID that sends the service request has an operation authority for the type of service; and if the user ID has an operation authority for the type of service, according to the service ID The second attribute information invokes a corresponding processing method to process the required delivery of the service parameter.
第二方面,本申请实施例还提供了一种业务处理装置,该装置包括用于执行上述的业务处理方法的单元。In a second aspect, the embodiment of the present application further provides a service processing apparatus, where the apparatus includes a unit for executing the foregoing service processing method.
第三方面,本申请实施例还提供了一种业务处理设备,所述设备包括存储器,以及与所述存储器相连的处理器;所述存储器,用于存储实现业务处理方法的程序数据;所述处理器,用于运行所述存储器中存储的程序数据,以执行如上述第一方面所述的方法。In a third aspect, the embodiment of the present application further provides a service processing device, where the device includes a memory, and a processor connected to the memory, and the memory is configured to store program data for implementing a service processing method; And a processor for executing program data stored in the memory to perform the method as described in the first aspect above.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现上述第一方面所述的方法。In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where the one or more program data is stored, and the one or more program data may be processed by one or more processes. The apparatus is executed to implement the method described in the first aspect above.
本申请实施例提供一种业务处理方法、装置、设备及计算机可读存储介质,通过实施本申请的业务处理方法,只需要开发一个接口,为该接口配置对应的配置文件,将每一种类型的业务分配一个业务ID,在接口接收到业务请求后能够根据业务请求的业务ID判断该业务请求属于哪一种类型的业务,从而根据配置文件中该中类型业务的配置内容调用对应的处理方法来实现对业务请求的处理,本申请的方法、装置、设备及计算机可读存储介质,将所有类型业务的处理过程都实现在同一个接口中,不需要为不同类型的业务分配不同的接口,避免接口过多和混乱,方便接口的管理,且对于新增一种类型业务,只需在配置文件中增加相应的配置内容,为统一的接口新增一个处理方法即可,方便接口的扩展。The embodiment of the present application provides a service processing method, apparatus, device, and computer readable storage medium. By implementing the service processing method of the present application, only one interface needs to be developed, and a corresponding configuration file is configured for the interface, and each type is configured. The service is assigned a service ID. After receiving the service request, the interface can determine, according to the service ID of the service request, which type of service the service request belongs to, and then invoke the corresponding processing method according to the configuration content of the medium type service in the configuration file. To implement the processing of the service request, the method, the device, the device and the computer readable storage medium of the present application implement the processing of all types of services in the same interface, and do not need to allocate different interfaces for different types of services. To avoid excessive and confusing interfaces, it is convenient to manage the interface. For a new type of service, you only need to add the corresponding configuration content to the configuration file, and add a new processing method for the unified interface to facilitate the expansion of the interface.
附图说明DRAWINGS
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要 使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are some embodiments of the present application, For the ordinary technicians, other drawings can be obtained based on these drawings without any creative work.
图1是本申请实施例提供的一种业务处理方法的流程示意图;1 is a schematic flowchart of a service processing method according to an embodiment of the present application;
图2是本申请实施例提供的一种业务处理方法的子流程示意图;2 is a schematic diagram of a sub-flow of a service processing method according to an embodiment of the present application;
图3是本申请实施例提供的一种业务处理方法的另一子流程示意图;FIG. 3 is a schematic diagram of another sub-process of a service processing method according to an embodiment of the present application;
图4是本申请实施例提供的一种业务处理方法的另一子流程示意图;4 is a schematic diagram of another sub-process of a service processing method according to an embodiment of the present application;
图5是本申请实施例提供的一种业务处理方法的另一子流程示意图;FIG. 5 is a schematic diagram of another sub-process of a service processing method according to an embodiment of the present disclosure;
图6是本申请实施例提供的一种业务处理装置的单元结构示意框图;FIG. 6 is a schematic block diagram showing a unit structure of a service processing apparatus according to an embodiment of the present disclosure;
图7是本申请实施例提供的一种业务处理装置的子单元结构示意框图;7 is a schematic block diagram showing a subunit structure of a service processing apparatus according to an embodiment of the present application;
图8是本申请实施例提供的一种业务处理装置的另一子单元结构示意框图;FIG. 8 is a schematic block diagram showing another subunit structure of a service processing apparatus according to an embodiment of the present application; FIG.
图9是本申请实施例提供的一种业务处理装置的另一子单元结构示意框图;FIG. 9 is a schematic block diagram showing another subunit structure of a service processing apparatus according to an embodiment of the present application; FIG.
图10是本申请实施例提供的一种业务处理设备的示意性框图。FIG. 10 is a schematic block diagram of a service processing device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are a part of the embodiments of the present application, and not all of the embodiments.
图1为本申请实施例提供的一种业务处理方法的流程示意图。该方法可以运行在智能设备,例如平板电脑、笔记本电脑以及智能终端中。如图1所示,该方法的步骤包括S101~S107。FIG. 1 is a schematic flowchart of a service processing method according to an embodiment of the present application. The method can run on smart devices such as tablets, laptops, and smart terminals. As shown in FIG. 1, the steps of the method include S101 to S107.
S101,通过接口接收用户发起的业务请求,所述业务请求携带的数据包括业务参数、用户ID和标识类型的业务ID。S101: Receive a service request initiated by a user by using an interface, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type.
开发工作人员开发一个接口,该接口与APP前端关联,用来实现APP前端用户的业务请求和处理。开发接口时,为该接口配置一个配置文件,该配置文件中包含了可以实现的种类的业务的配置内容,最终再处理业务请求时是通过The development staff develops an interface that is associated with the APP front end to implement the service request and processing of the APP front-end user. When the interface is developed, a configuration file is configured for the interface, and the configuration file includes the configuration content of the type of service that can be implemented, and finally the processing of the service request is passed.
S102,获取所述接口对应的最新的配置文件的内容,所所述内容包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息。S102. Acquire the content of the latest configuration file corresponding to the interface, where the content includes a service ID that identifies different types of services, and first attribute information and second attribute information of the corresponding type of service.
在配置文件中,为每一种类型的业务配置的内容的数据格式为:<entry key=″prefix.businessInterfaceId.businessAttributeKey″>defaultValue</entry>。In the configuration file, the data format of the content configured for each type of service is: <entry key=“prefix.businessInterfaceId.businessAttributeKey”>defaultValue</entry>.
其中,businessInterfaceId字段的信息即为标识业务的类型的业务ID,即表明是哪一种业务。The information of the businessInterfaceId field is the service ID of the type of the service, that is, which service is indicated.
业务的属性信息包括第一属性信息和第二属性信息,体现在businessAttributeKey字段和defaultValue字段。The attribute information of the service includes the first attribute information and the second attribute information, which are embodied in the businessAttributeKey field and the defaultValue field.
businessAttributeKey字段标明该类业务的各类属性的属性名称,一些属性名称是开发者自定义的,与该业务请求所需要传递的业务参数的名称一致,包含定义该业务类型的所需传递的业务参数的名称,为第一属性信息,另外一些属性名称则是指定统一的命名,例如,sqlType(操作类型)、sqlMap(对应执行语句)等具有特定作用的属性,数据库,或处理该业务请求的实现类等,为第二属性信息,sqlType和sqlMap这两个属性分别针对数据库的(查询、删除、添加等简单操作)具体操作类型和具体执行语句,实现类是针对其他一些相对复杂的业务操作的逻辑实现,在某一种业务的配置参数内如果包含了sqlType、sqlMap等属性信息,一般不包括实现类名称等属性信息。The businessAttributeKey field indicates the attribute name of each type of attribute of the service. Some attribute names are customized by the developer, and are consistent with the name of the service parameter to be delivered by the service request, and include the required delivery service parameters defining the service type. The name is the first attribute information, and some attribute names are specified with a uniform name, for example, sqlType (operation type), sqlMap (corresponding execution statement) and other attributes with specific functions, database, or implementation of the business request. Class, etc., for the second attribute information, sqlType and sqlMap are respectively for the database (query, delete, add, etc.) specific operation types and specific execution statements, the implementation class is for other relatively complex business operations. Logic implementation, if the attribute information of sqlType, sqlMap, etc. is included in the configuration parameters of a certain service, the attribute information such as the implementation class name is generally not included.
defaultValue字段标明该类业务的属性名称对应的属性值,例如sqlType、sqlMap对应的sqlType值、sqlMap值,sqlMap值为一个地址ID,这个地址ID反应了操作数据库的执行语句,例如查询语句、删除语句、添加语句等。The defaultValue field indicates the attribute value corresponding to the attribute name of the service, such as sqlType, sqlMap corresponding sqlType value, sqlMap value, sqlMap value is an address ID, this address ID reflects the execution statement of the operation database, such as query statement, delete statement , add statements, and so on.
defaultValue字段对应保存储属性名称指定的默认值(如果有默认值的话),例如sqlType值、sqlMap值、数据库的名称、具体的实现类对应的名称,如无默认值,则需要在后期的数据传输中读取businessAttributeKey字段对应的其他属性名称对应的属性值,这部分属性值一般为业务请求中所需传递的业务参数,这些业务参数也是在该次业务请求中需要处理的参数,通过指定的实现类或操作数据库的执行语句来实现对业务参数的处理。The defaultValue field corresponds to the default value specified by the storage attribute name (if there is a default value), such as sqlType value, sqlMap value, database name, and the name of the specific implementation class. If there is no default value, the data transmission in the later stage is required. The attribute value corresponding to the other attribute name corresponding to the businessAttributeKey field is read, and the part attribute value is generally a service parameter that needs to be delivered in the service request, and these service parameters are also parameters that need to be processed in the service request, and are specified by the specified implementation. Class or operation statement of the operation database to implement processing of business parameters.
在本申请实施例中,一个接口可以处理不同类型的业务,当新增一种类型的业务时,只需要在配置文件中为该类型的业务增加对应的配置内容即可,因此,为防止接口接收到的业务请求未新增类型的业务而原来的配置文件不具有对应的配置内容,每次接收到业务请求后都需要获取最新的配置文件的内容。配置文件保存在终端本地,获取的配置文件的内容保存在业务处理系统的Map集合中,每次接收到业务请求时需要判断终端本地保存的配置文件是否在上次业务处理后发生修改,若配置文件在上次业务处理后尚未发生修改,则不需要重新读取配置文件的内容,如果配置文件在上次业务处理后已发生修改,则需要重新读取配置文件的内容来替换保存在Map集合中的原来的配置文件的内 容。In this embodiment, an interface can process different types of services. When a new type of service is added, only the corresponding configuration content needs to be added to the service in the configuration file. Therefore, to prevent the interface. The received service request does not have a new type of service, and the original configuration file does not have a corresponding configuration content. Each time a service request is received, the content of the latest configuration file needs to be obtained. The configuration file is saved in the local area of the terminal. The content of the obtained configuration file is saved in the Map collection of the service processing system. Each time a service request is received, it is determined whether the configuration file saved locally by the terminal is modified after the last service processing. If the file has not been modified since the last business process, you do not need to re-read the contents of the configuration file. If the configuration file has been modified since the last business process, you need to re-read the contents of the configuration file to replace the saved in the Map collection. The contents of the original configuration file.
Map集合的每一种业务的数据格式为:The data format of each service of the Map collection is:
Map<String business,Map<String attribute,String defaultValue>Map<String business,Map<String attribute,String defaultValue>
String business字段为从配置文件中读取的业务ID,String attribute字段为读取到的属性名称,String defaultValue字段为对应的属性名称的值,有些是系统默认值,例如sqlType值、sqlMap值,有些非系统默认的值则是后期处理业务请求时所需的从业务请求中读取的业务参数,例如,从配置文件中读取了业务参数的名称,则获取业务请求中对应参数名称的业务参数值。The String business field is the service ID read from the configuration file, the String attribute field is the read attribute name, the String defaultValue field is the value of the corresponding attribute name, and some are system default values, such as sqlType value, sqlMap value, and some The non-system default value is the service parameter that is read from the service request when the service request is post-processed. For example, if the name of the service parameter is read from the configuration file, the service parameter corresponding to the parameter name in the service request is obtained. value.
具体的,如图2所示,步骤S102中的获取所述接口对应的最新的配置文件的内容的步骤,包括以下子步骤:Specifically, as shown in FIG. 2, the step of acquiring the content of the latest configuration file corresponding to the interface in step S102 includes the following sub-steps:
S1021,判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改。S1021: Determine whether the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing ends.
S1022,若是,则读取所述配置文件的内容替换所述Map集合中原来的内容作为所述接口对应的最新配置文件的内容。S1022. If yes, reading the content of the configuration file replaces the original content in the Map set as the content of the latest configuration file corresponding to the interface.
S1023,若否,则读取所述Map集合中保存的内容作为所述接口对应的最新的配置文件的内容。S1023. If no, the content stored in the Map set is read as the content of the latest configuration file corresponding to the interface.
若配置文件尚未被修改,则Map集合中原来保存的配置文件的内容即为最新配置文件的内容,否则需要重新读取修改后的配置文件的内容替换原配置文件的内容。If the configuration file has not been modified, the content of the configuration file saved in the Map collection is the content of the latest configuration file. Otherwise, the content of the modified configuration file needs to be read again to replace the content of the original configuration file.
通过判断配置文件是否被修改来确定是否需要更新Map集合中保存的配置文件的内容,如果配置文件未被修改则不需要更新,防止了每次接收到业务请求都需要更新Map集合的内容。It is determined whether the content of the configuration file saved in the Map collection needs to be updated by determining whether the configuration file is modified. If the configuration file is not modified, the update is not required, and the content of the Map collection needs to be updated every time the service request is received.
具体的,如图3所示,步骤S1021包括以下子步骤:Specifically, as shown in FIG. 3, step S1021 includes the following sub-steps:
S10211,读取终端本地保存的所述接口对应的配置文件的修改时间。S10211: The modification time of the configuration file corresponding to the interface saved locally by the terminal is read.
S10212,将当前读取的所述修改时间与上次读取的配置文件的修改时间进行对比。S10212: Compare the currently read modification time with the modification time of the last read configuration file.
S10213若当前读取的所述修改时间与上次读取的配置文件的修改时间一致,则判定所述配置文件的内容未被修改;若当前读取的所述修改时间与上次读取的配置文件的修改时间不一致,则判定所述配置文件的内容已被修改。S10213, if the currently read modification time is consistent with the modification time of the last read configuration file, determining that the content of the configuration file is not modified; if the currently read modification time is the last read If the modification time of the configuration file is inconsistent, it is determined that the content of the configuration file has been modified.
业务处理系统每次在接收到业务请求之后都需要去读取一次保存在终端本地的配置文件的修改时间(即最近的修改时间),每次读取到的修改时间都保存在该业务处理系统中,将当前读取到的修改时间与上次(上次接收到业务请 求的时候)读取到的修改时间,如果二者一致,则自上次业务处理之后该配置文件尚未被修改,否则已经被修改。Each time the service processing system receives the service request, it needs to read the modification time (that is, the latest modification time) of the configuration file saved locally in the terminal, and the modification time read each time is saved in the service processing system. In the middle, the modification time currently read and the modification time read last time (when the service request was last received), if the two are consistent, the configuration file has not been modified since the last business processing, otherwise Has been modified.
S103,将所述业务请求携带的数据转换为JSONObject对象。S103. Convert the data carried by the service request into a JSONObject object.
JSONObject对象的数据可是为{″key1″:value1,″key2″,value2....},一个value(值)对应一个key(字段),提取JSONObject对象中的对应某一个字段的值是非常方便的。Key对应的是业务请求中的业务参数的名称,value对应的是具体的业务参数。The data of the JSONObject object can be {"key1": value1, "key2", value2....}, and a value (value) corresponds to a key (field). It is very convenient to extract the value of a corresponding field in the JSONObject object. of. The Key corresponds to the name of the service parameter in the service request, and the value corresponds to the specific service parameter.
JSONObject对象中的key必须是字符串的形式,因此需要先将该业务请求转换为字符串,然后将字符串转化为JSONObject对象。The key in the JSONObject object must be in the form of a string, so you need to convert the business request to a string and then convert the string to a JSONObject object.
S104,从JSONObject对象中获取所述业务请求的业务ID和用户ID。S104. Obtain a service ID and a user ID of the service request from a JSONObject object.
JSONObject对象中包含了该业务请求的所有参数,因此可在其中业务ID和用户ID。The JSONObject object contains all the parameters of the business request, so the business ID and user ID can be in it.
用户ID用以表示用户的身份,业务ID用以识别当前业务请求进行的业务为哪一类型的业务。The user ID is used to indicate the identity of the user, and the service ID is used to identify which type of service the service being requested by the current service is.
S105,根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数。S105. Acquire corresponding first attribute information from the content according to the service ID, and obtain, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object.
对于每一种类型业务的业务请求,配置文件中定义了该类型所需传递的业务参数,对于不需要传递的业务参数不需要获取,配置文件中指明了所需传递的业务参数的名称,在处理业务请求的时候,需要的是对应的业务参数,因此通过在配置文件中定义所需传递的业务参数的名称来获取对应的值,即业务参数。For the service request of each type of service, the service parameters required for the type are defined in the configuration file, and the service parameters that do not need to be transmitted need not be obtained, and the name of the service parameter to be delivered is specified in the configuration file. When processing a service request, the corresponding service parameters are required. Therefore, the corresponding value, that is, the service parameter, is obtained by defining the name of the service parameter to be delivered in the configuration file.
如图4所示,步骤S105包括以下子步骤:As shown in FIG. 4, step S105 includes the following sub-steps:
S1051,从所述内容中搜索所述业务ID对应类型业务的配置内容,从所述配置内容中获取所需传递的业务参数的名称。S1051: Search for the configuration content of the service ID corresponding type service from the content, and obtain a name of the service parameter to be delivered from the configuration content.
S1052,从所述JSONObject对象中获取所述业务参数的名称对应的业务参数。S1052: Obtain a service parameter corresponding to the name of the service parameter from the JSONObject object.
获取到的业务参数暂存在所述Map集合中的String defaultValue字段的信息中,与String attribute字段的信息对应,即Map集合中包括了该业务ID所需传递的业务参数和对应的处理方法。The obtained service parameter is temporarily stored in the information of the String defaultValue field in the Map set, and corresponds to the information of the String attribute field, that is, the Map set includes the service parameters and corresponding processing methods that need to be transmitted by the service ID.
S106,判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限。S106. Determine whether the user ID that sends the service request has an operation right for the type of service.
用过用户ID来验证用户的身份,只有具有操作权限的用户才能进行该类业务的操作。The user ID is used to verify the identity of the user, and only users with operational rights can perform operations of this type of service.
S107,若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。S107. If the user ID has an operation authority for the type of service, the corresponding processing method is invoked according to the second attribute information of the service ID to process the required service parameter.
到目前为止,该业务请求对应的Map集合中的属性信息包括所需传递的业务参数、数据库的名称和对应的处理方法等。So far, the attribute information in the Map set corresponding to the service request includes the service parameters to be delivered, the name of the database, and the corresponding processing method.
具体地,如图5所示,步骤S107包括以下子步骤:Specifically, as shown in FIG. 5, step S107 includes the following sub-steps:
S1071,判断所述第二属性信息中是否包含sqlType字段和sqlMap字段。S1071: Determine whether the second attribute information includes a sqlType field and an sqlMap field.
S1072,若是,获取所述业务ID对应的sqlType值和sqlMap值,所述sqlType值映射操作所述数据库的操作类型,所述sqlMap值映射所述操作类型的执行语句;S1072, if yes, obtaining a sqlType value corresponding to the service ID and an sqlMap value, where the sqlType value maps an operation type of the database, and the sqlMap value maps an execution statement of the operation type;
S1073,利用所述执行语句对所述数据库中与所述业务参数匹配的数据执行所述操作类型对应的操作。S1073. Perform, by using the execution statement, an operation corresponding to the operation type on data matching the service parameter in the database.
S1074,若否,判断所述第二属性信息中是否包含实现类名称。S1074. If no, determine whether the implementation class name is included in the second attribute information.
S1075,若所述第二属性信息中包含实现类名称,获取所述实现类名称对应的装载对象,调用该装载对象对应的处理方法处理所述业务参数。S1075. If the second attribute information includes an implementation class name, obtain a loading object corresponding to the implementation class name, and call a processing method corresponding to the loading object to process the service parameter.
通过对应的执行语句对数据库进行相应类型的操作,例如,sqlType值为“DEL”,即利用sqlMap值对应的删除语句删除数据库中的该业务参数,或通过加载实现类对应的装载对象,装载对象具有对应的处理该业务参数的处理程序,通过执行处理程序来处理该业务参数。处理完该业务请求之后,将从业务请求中读取并暂存在Map集合中的业务参数清除掉,并向用户返回处理结果并。The corresponding type of operation is performed on the database through the corresponding execution statement. For example, the sqlType value is “DEL”, that is, the service parameter in the database is deleted by using the delete statement corresponding to the sqlMap value, or the load object is loaded by loading the implementation class, and the object is loaded. There is a corresponding processing program for processing the business parameter, and the business parameter is processed by executing the processing program. After processing the service request, the service parameters read from the service request and temporarily stored in the Map collection are cleared, and the processing result is returned to the user.
本申请实施例的也出处理方法,配置一个接口,通过一份配置文件,针对所有业务类型的业务请求的处理都实现在该接口中,根据配置文件中不同的请求业务,调用对应的处理方法,以达到处理不同的业务请求;对于新增一种业务请求,则在配置文件增加相应的配置内容,然后为该接口新增一个实现类或处理方法即可,扩展方便;通过配置文件方式,能方便看出该接口都实现了哪些业务请求,方便管理。The processing method of the embodiment of the present application also configures an interface, and the processing of the service request for all service types is implemented in the interface through a configuration file, and the corresponding processing method is invoked according to different request services in the configuration file. To achieve different business requests; for a new service request, add the corresponding configuration content in the configuration file, and then add an implementation class or processing method for the interface, which is convenient to expand; It is convenient to see which business requests are implemented by the interface and it is convenient to manage.
图6为本申请实施例提供的一种业务处理装置100的示意性框图。该业务处理装置100包括接收单元101、第一获取单元102、转换单元103、第二获取单元104、第三获取单元105、判断单元106和处理单元107。FIG. 6 is a schematic block diagram of a service processing apparatus 100 according to an embodiment of the present application. The service processing apparatus 100 includes a receiving unit 101, a first obtaining unit 102, a converting unit 103, a second obtaining unit 104, a third obtaining unit 105, a judging unit 106, and a processing unit 107.
接收单元101用于通过接口接收用户发起的业务请求,所述业务请求携带 的数据包括业务参数、用户ID和标识类型的业务ID。The receiving unit 101 is configured to receive a service request initiated by the user by using an interface, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type.
第一获取单元102用于获取所述接口对应的最新的配置文件的内容,所述内容包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息。The first obtaining unit 102 is configured to acquire the content of the latest configuration file corresponding to the interface, where the content includes a service ID that identifies different types of services, and first attribute information and second attribute information of the corresponding type of service.
转换单元103用于将所述业务请求携带的数据转换为JSONObject对象。The converting unit 103 is configured to convert the data carried by the service request into a JSONObject object.
第二获取单元104用于从JSONObject对象中获取所述业务请求的业务ID和用户ID。The second obtaining unit 104 is configured to obtain the service ID and the user ID of the service request from the JSONObject object.
第三获取单元105用于根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数。The third obtaining unit 105 is configured to obtain corresponding first attribute information from the content according to the service ID, and obtain, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object.
判断单元106用于判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限。The determining unit 106 is configured to determine whether the user ID that sends the service request has an operation right for the type of service.
处理单元107用于若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。The processing unit 107 is configured to: if the user ID has an operation authority for the type of service, invoke a corresponding processing method to process the required service parameter according to the second attribute information of the service ID.
在本申请实施例中,配置文件保存在终端本地,获取的配置文件的内容保存在Map集合中。In the embodiment of the present application, the configuration file is saved locally in the terminal, and the content of the obtained configuration file is saved in the Map collection.
如图7所示,第一获取单元102包括:As shown in FIG. 7, the first obtaining unit 102 includes:
第一判断子单元1021,用于判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改;The first determining sub-unit 1021 is configured to determine whether the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing ends;
第一读取子单元1022,用于若被修改,则读取所述配置文件的内容替换所述Map集合中原来的内容作为所述接口对应的最新配置文件的内容。The first reading sub-unit 1022 is configured to: if modified, read the content of the configuration file to replace the original content in the Map set as the content of the latest configuration file corresponding to the interface.
确认子单元1023,用于若未被修改,则读取所述Map集合中保存的内容作为所述接口对应的最新的配置文件的内容。The confirmation subunit 1023 is configured to read the content saved in the Map set as the content of the latest configuration file corresponding to the interface if not modified.
其中,第一判断子单元1021具体用于:将当前读取的所述修改时间与上次读取的配置文件的修改时间进行对比;若当前读取的所述修改时间与上次读取的配置文件的修改时间一致,则判定所述配置文件的内容未被修改;若当前读取的所述修改时间与上次读取的配置文件的修改时间不一致,则判定所述配置文件的内容已被修改。The first determining sub-unit 1021 is specifically configured to compare the currently read modification time with the modification time of the last read configuration file; if the currently read modification time is the last read If the modification time of the configuration file is consistent, it is determined that the content of the configuration file is not modified; if the currently modified modification time is inconsistent with the modification time of the last read configuration file, it is determined that the content of the configuration file has been modified.
所述第一属性信息包括所需传递的业务参数的名称。The first attribute information includes a name of a service parameter to be delivered.
如图8所示,所述第三获取单元105包括:As shown in FIG. 8, the third obtaining unit 105 includes:
搜索子单元,用于从所述内容中搜索所述业务ID对应类型业务的配置内容。Searching for a subunit for searching for configuration content of the service corresponding to the service ID from the content.
第一获取子单元1051,用于从所述配置内容中获取所需传递的业务参数的名称。The first obtaining subunit 1051 is configured to obtain, from the configuration content, a name of a service parameter that needs to be delivered.
第二获取子单元1052,用于从所述JSONObject对象中获取所述业务参数的名称对应的业务参数。The second obtaining sub-unit 1052 is configured to obtain a service parameter corresponding to the name of the service parameter from the JSONObject object.
所述第二属性信息包括数据库的名称。The second attribute information includes a name of a database.
如图9所示,所述处理单元107包括:As shown in FIG. 9, the processing unit 107 includes:
第二判断子单元1071,用于判断所述第二属性信息中是否包含sqlType字段和sqlMap字段。The second determining sub-unit 1071 is configured to determine whether the second attribute information includes a sqlType field and an sqlMap field.
第三获取子单元1072,用于若所述第二属性信息中包含sqlType字段和sqlMap字段,获取所述业务ID对应的sqlType值和sqlMap值,所述sqlType值映射操作所述数据库的操作类型,所述sqlMap值映射所述操作类型的执行语句。The third obtaining sub-unit 1072 is configured to: if the second attribute information includes a sqlType field and an sqlMap field, obtain an sqlType value and an sqlMap value corresponding to the service ID, where the sqlType value maps an operation type of the database, The sqlMap value maps an execution statement of the operation type.
操作子单元1073,用于利用所述执行语句对所述数据库中与所述业务参数匹配的数据执行所述操作类型对应的操作。The operation subunit 1073 is configured to perform, by using the execution statement, an operation corresponding to the operation type on data matching the service parameter in the database.
第三判断子单元1074,用于若所述第二属性信息中不包含sqlType字段和sqlMap字段,判断所述第二属性信息中是否包含实现类名称。The third determining sub-unit 1074 is configured to determine, if the second attribute information does not include the sqlType field and the sqlMap field, whether the second attribute information includes an implementation class name.
处理子单元1075,用于若所述第二属性信息中包含实现类名称,获取所述实现类名称对应的装载对象,调用该装载对象对应的处理方法处理所述业务参数。The processing sub-unit 1075 is configured to: if the second attribute information includes an implementation class name, acquire a loading object corresponding to the implementation class name, and call a processing method corresponding to the loading object to process the service parameter.
上述各个单元的具体实施可参考方法实施例,本申请不做赘述。For specific implementations of the foregoing various units, reference may be made to the method embodiments, which are not described herein.
上述业务处理装置100可以实现为一种计算机程序的形式,计算机程序可以在如图10所示的计算机设备上运行。The above business processing apparatus 100 can be implemented in the form of a computer program that can be run on a computer device as shown in FIG.
图10为本申请实施例提供的一种业务处理设备的示意性框图。该设备可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。FIG. 10 is a schematic block diagram of a service processing device according to an embodiment of the present application. The device may be a terminal or a server, wherein the terminal may be a communication-enabled electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be a standalone server or a server cluster consisting of multiple servers.
该设备为一种计算机设备200,包括通过系统总线201连接的处理器202、非易失性存储介质203、内存储器204和网络接口205。其中,该计算机设备200的非易失性存储介质203可存储操作系统2031和计算机程序2032,该计算机程序2032被执行时,可使得处理器202执行一种业务处理方法。该计算机设 备200的处理器202用于提供计算和控制能力,支撑整个计算机设备200的运行。该内存储器204为非易失性存储介质203中的计算机程序2032的运行提供环境,该计算机程序2032被处理器202执行时,可使得处理器202执行一种业务处理方法。计算机设备200的网络接口205用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The device is a computer device 200 comprising a processor 202 connected by a system bus 201, a non-volatile storage medium 203, an internal memory 204, and a network interface 205. The non-volatile storage medium 203 of the computer device 200 can store an operating system 2031 and a computer program 2032. When the computer program 2032 is executed, the processor 202 can be caused to execute a service processing method. The processor 202 of the computer device 200 is used to provide computing and control capabilities to support the operation of the entire computer device 200. The internal memory 204 provides an environment for the operation of the computer program 2032 in the non-volatile storage medium 203, which when executed by the processor 202, causes the processor 202 to perform a business processing method. The network interface 205 of the computer device 200 is used to perform network communications, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied. The specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
处理器202运行非易失性存储介质203中的计算机程序2032时可执行上述业务处理方法的所有实施例的实现方式。The processor 202 can execute an implementation of all of the above described business processing methods when the computer program 2032 in the non-volatile storage medium 203 is run.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,当所述一个或者一个以上程序被一个或者一个以上的处理器执行,可实现上述业务处理方法的所有实施例。The application further provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors, when the one or More than one program is executed by one or more processors to implement all of the embodiments of the above described business processing methods.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any equivalents can be easily conceived by those skilled in the art within the technical scope disclosed in the present application. Modifications or substitutions are intended to be included within the scope of the present application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Claims (20)

  1. 一种业务处理方法,其特征在于,包括:A service processing method, comprising:
    通过接口接收用户发起的业务请求,所述业务请求携带的数据包括业务参数、用户ID和标识类型的业务ID;Receiving, by the interface, a service request initiated by the user, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type;
    获取所述接口对应的最新的配置文件的内容,所述内容包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息;Acquiring the content of the latest configuration file corresponding to the interface, where the content includes a service ID that identifies different types of services, and first attribute information and second attribute information of the corresponding type of service;
    将所述业务请求携带的数据转换为JSONObject对象;Converting data carried by the business request into a JSONObject object;
    从JSONObject对象中获取所述业务请求的业务ID和用户ID;Obtaining a service ID and a user ID of the service request from a JSONObject object;
    根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数;Obtaining corresponding first attribute information from the content according to the service ID, and acquiring, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object;
    判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限;Determining whether the user ID that sends the service request has an operation right for the type of service;
    若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。If the user ID has an operation authority for the type of service, the corresponding processing method is invoked according to the second attribute information of the service ID to process the required service parameter.
  2. 根据权利要求1所述的业务处理方法,其特征在于,配置文件保存在终端本地,获取的配置文件的内容保存在Map集合中;The service processing method according to claim 1, wherein the configuration file is saved locally in the terminal, and the content of the acquired configuration file is saved in the Map collection;
    所述获取所述接口对应的最新的配置文件的内容,包括:The acquiring the content of the latest configuration file corresponding to the interface includes:
    判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改;Determining whether the configuration file corresponding to the interface saved in the terminal is modified after the last service request processing ends;
    若是,则读取所述配置文件的内容替换所述Map集合中原来的内容作为所述接口对应的最新配置文件的内容;If yes, reading the content of the configuration file replaces the original content in the Map set as the content of the latest configuration file corresponding to the interface;
    若否,则读取所述Map集合中保存的内容作为所述接口对应的最新的配置文件的内容。If not, the content saved in the Map set is read as the content of the latest configuration file corresponding to the interface.
  3. 根据权利要求2所述的业务处理方法,其特征在于,所述判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改,包括:The service processing method according to claim 2, wherein the determining whether the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing ends includes:
    读取终端本地保存的所述接口对应的配置文件的修改时间;Reading the modification time of the configuration file corresponding to the interface saved locally by the terminal;
    将当前读取的所述修改时间与上次读取的配置文件的修改时间进行对比;Comparing the currently read modification time with the modification time of the last read configuration file;
    若当前读取的所述修改时间与上次读取的配置文件的修改时间一致,则判定所述配置文件的内容未被修改;若当前读取的所述修改时间与上次读取的配置文件的修改时间不一致,则判定所述配置文件的内容已被修改。If the currently read modification time is consistent with the modification time of the last read configuration file, it is determined that the content of the configuration file is not modified; if the currently read modification time and the last read configuration If the modification time of the file is inconsistent, it is determined that the content of the configuration file has been modified.
  4. 根据权利要求1所述的业务处理方法,所述第一属性信息包括所需传递 的业务参数的名称;The service processing method according to claim 1, wherein the first attribute information includes a name of a service parameter to be delivered;
    所述根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数,包括:Obtaining the corresponding first attribute information from the content according to the service ID, and acquiring the service parameter that is required to be delivered by the service request from the JSONObject object according to the first attribute information, including:
    从所述内容中搜索所述业务ID对应类型业务的配置内容,从所述配置内容中获取所需传递的业务参数的名称;Searching, from the content, the configuration content of the service corresponding to the service ID, and obtaining the name of the service parameter to be delivered from the configuration content;
    从所述JSONObject对象中获取所述业务参数的名称对应的业务参数。Obtaining a service parameter corresponding to the name of the service parameter from the JSONObject object.
  5. 根据权利要求1所述的业务处理方法,所述第二属性信息包括数据库的名称;The service processing method according to claim 1, wherein the second attribute information includes a name of a database;
    所述根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数,包括:The invoking the corresponding processing method according to the second attribute information of the service ID to process the required delivery service parameter, including:
    判断所述第二属性信息中是否包含sqlType字段和sqlMap字段;Determining whether the second attribute information includes a sqlType field and an sqlMap field;
    若所述第二属性信息中包含sqlType字段和sqlMap字段,获取所述业务ID对应的sqlType值和sqlMap值,所述sqlType值映射操作所述数据库的操作类型,所述sqlMap值映射所述操作类型的执行语句;If the second attribute information includes a sqlType field and an sqlMap field, the sqlType value and the sqlMap value corresponding to the service ID are obtained, the sqlType value mapping operates an operation type of the database, and the sqlMap value maps the operation type Execution statement;
    利用所述执行语句对所述数据库中与所述业务参数匹配的数据执行所述操作类型对应的操作。The operation corresponding to the operation type is performed on the data in the database that matches the service parameter by using the execution statement.
  6. 根据权利要求5所述的业务处理方法,所述根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数,还包括;The service processing method according to claim 5, wherein the invoking a corresponding processing method according to the second attribute information of the service ID to process the required delivery service parameter further includes:
    若所述第二属性信息中不包含sqlType字段和sqlMap字段,判断所述第二属性信息中是否包含实现类名称;If the second attribute information does not include the sqlType field and the sqlMap field, determine whether the second attribute information includes an implementation class name;
    若所述第二属性信息中包含实现类名称,获取所述实现类名称对应的装载对象,调用该装载对象对应的处理方法处理所述业务参数。If the second attribute information includes an implementation class name, the loading object corresponding to the implementation class name is obtained, and the processing method corresponding to the loading object is invoked to process the service parameter.
  7. 一种业务处理装置,其特征在于,包括:A service processing device, comprising:
    接收单元,用于通过接口接收用户发起的业务请求,所述业务请求携带的数据包括业务参数、用户ID和标识类型的业务ID;a receiving unit, configured to receive, by using an interface, a service request initiated by a user, where the data carried by the service request includes a service parameter, a user ID, and a service ID of an identifier type;
    第一获取单元,用于获取所述接口对应的最新的配置文件的内容,所述内容包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息;a first acquiring unit, configured to acquire content of a latest configuration file corresponding to the interface, where the content includes a service ID that identifies a different type of service, and first attribute information and second attribute information of a service of a corresponding type;
    转换单元,用于将所述业务请求携带的数据转换为JSONObject对象;a converting unit, configured to convert data carried by the service request into a JSONObject object;
    第二获取单元,用于从JSONObject对象中获取所述业务请求的业务ID和用户ID;a second obtaining unit, configured to obtain a service ID and a user ID of the service request from the JSONObject object;
    第三获取单元,用于根据所述业务ID从所述内容中获取对应的第一属性信息,用于根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数;a third acquiring unit, configured to acquire corresponding first attribute information from the content according to the service ID, and configured to acquire, according to the first attribute information, a service that is required to be delivered by the service request from the JSONObject object parameter;
    判断单元,用于判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限;a determining unit, configured to determine whether the user ID that sends the service request has an operation right for the type of service;
    处理单元,用于若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。The processing unit is configured to: if the user ID has an operation authority for the type of service, invoke a corresponding processing method to process the required service parameter according to the second attribute information of the service ID.
  8. 根据权利要求7所述的业务处理装置,其特征在于,配置文件保存在终端本地,获取的配置文件的内容保存在Map集合中;The service processing apparatus according to claim 7, wherein the configuration file is saved locally in the terminal, and the content of the acquired configuration file is saved in the Map collection;
    所述第一获取单元,包括:The first acquiring unit includes:
    第一判断子单元,用于判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改;a first determining sub-unit, configured to determine whether the configuration file corresponding to the interface saved in the terminal is modified after the last service request processing ends;
    第一读取子单元,用于若保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后已被修改,则读取所述配置文件的内容替换所述Map集合中原来的内容作为所述接口对应的最新配置文件的内容;a first reading subunit, configured to: if the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing ends, read the content of the configuration file to replace the original in the Map set. The content of the content as the content of the latest configuration file corresponding to the interface;
    确认子单元,用于若保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后未被修改,则读取所述Map集合中保存的内容作为所述接口对应的最新的配置文件的内容。a confirmation subunit, configured to read, if the configuration file corresponding to the interface stored in the terminal is not modified after the last service request processing ends, read the content saved in the Map set as the latest corresponding to the interface The contents of the configuration file.
  9. 根据权利要求8所述的业务处理装置,其特征在于,所述第一判断子单元具体用于:将当前读取的所述修改时间与上次读取的配置文件的修改时间进行对比;若当前读取的所述修改时间与上次读取的配置文件的修改时间一致,则判定所述配置文件的内容未被修改;若当前读取的所述修改时间与上次读取的配置文件的修改时间不一致,则判定所述配置文件的内容已被修改。The service processing apparatus according to claim 8, wherein the first determining sub-unit is specifically configured to compare the currently read modification time with a modification time of a configuration file read last time; If the modification time currently read is consistent with the modification time of the configuration file read last time, it is determined that the content of the configuration file is not modified; if the modification time currently read and the configuration file read last time If the modification time is inconsistent, it is determined that the content of the configuration file has been modified.
  10. 根据权利要求7所述的业务处理装置,其特征在于,所述第一属性信息包括所需传递的业务参数的名称;The service processing apparatus according to claim 7, wherein said first attribute information includes a name of a service parameter to be delivered;
    所述第三获取单元,包括:The third obtaining unit includes:
    搜索子单元,用于从所述内容中搜索所述业务ID对应类型业务的配置内容;Searching a subunit, configured to search, from the content, configuration content of the service corresponding to the service ID;
    第一获取子单元,用于从所述配置内容中获取所需传递的业务参数的名称;a first obtaining subunit, configured to obtain, from the configuration content, a name of a service parameter that needs to be delivered;
    第二获取子单元,用于从所述JSONObject对象中获取所述业务参数的名称对应的业务参数。And a second obtaining subunit, configured to obtain a service parameter corresponding to the name of the service parameter from the JSONObject object.
  11. 根据权利要求7所述的业务处理装置,所述第二属性信息包括数据库的名称;The service processing apparatus according to claim 7, wherein the second attribute information includes a name of a database;
    所述处理单元包括:The processing unit includes:
    第二判断子单元,用于判断所述第二属性信息中是否包含sqlType字段和sqlMap字段;a second determining subunit, configured to determine whether the second attribute information includes a sqlType field and an sqlMap field;
    第三获取子单元,用于若所述第二属性信息中包含sqlType字段和sqlMap字段,获取所述业务ID对应的sqlType值和sqlMap值,所述sqlType值映射操作所述数据库的操作类型,所述sqlMap值映射所述操作类型的执行语句;a third obtaining subunit, configured to: if the second attribute information includes a sqlType field and an sqlMap field, obtain a sqlType value and an sqlMap value corresponding to the service ID, where the sqlType value maps an operation type of the database, The sqlMap value maps the execution statement of the operation type;
    操作子单元,用于利用所述执行语句对所述数据库中与所述业务参数匹配的数据执行所述操作类型对应的操作;An operation subunit, configured to perform, by using the execution statement, an operation corresponding to the operation type on data matching the service parameter in the database;
    第三判断子单元,用于若所述第二属性信息中不包含sqlType字段和sqlMap字段,判断所述第二属性信息中是否包含实现类名称;a third determining subunit, configured to: if the second attribute information does not include the sqlType field and the sqlMap field, determine whether the second attribute information includes an implementation class name;
    处理子单元,用于若所述第二属性信息中包含实现类名称,获取所述实现类名称对应的装载对象,调用该装载对象对应的处理方法处理所述业务参数。The processing subunit is configured to: if the second attribute information includes an implementation class name, obtain a loading object corresponding to the implementation class name, and call a processing method corresponding to the loading object to process the service parameter.
  12. 一种业务处理设备,其特征在于,所述设备包括存储器,以及与所述存储器相连的处理器;A service processing device, characterized in that the device comprises a memory, and a processor connected to the memory;
    所述存储器,用于存储业务处理程序数据;The memory is configured to store service processor data;
    所述处理器,用于运行所述存储器中存储的程序数据,以执行:以下步骤:The processor is configured to execute program data stored in the memory to perform: the following steps:
    通过接口接收用户发起的业务请求,所述业务请求携带的数据包括业务参数、用户ID和标识类型的业务ID;Receiving, by the interface, a service request initiated by the user, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type;
    获取所述接口对应的最新的配置文件的内容,所述内容包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息;Acquiring the content of the latest configuration file corresponding to the interface, where the content includes a service ID that identifies different types of services, and first attribute information and second attribute information of the corresponding type of service;
    将所述业务请求携带的数据转换为JSONObject对象;Converting data carried by the business request into a JSONObject object;
    从JSONObject对象中获取所述业务请求的业务ID和用户ID;Obtaining a service ID and a user ID of the service request from a JSONObject object;
    根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数;Obtaining corresponding first attribute information from the content according to the service ID, and acquiring, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object;
    判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限;Determining whether the user ID that sends the service request has an operation right for the type of service;
    若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。If the user ID has an operation authority for the type of service, the corresponding processing method is invoked according to the second attribute information of the service ID to process the required service parameter.
  13. 根据权利要求12所述的业务处理设备,其特征在于,配置文件保存在终端本地,获取的配置文件的内容保存在Map集合中;The service processing device according to claim 12, wherein the configuration file is saved locally in the terminal, and the content of the acquired configuration file is saved in the Map collection;
    在执行所述获取所述接口对应的最新的配置文件的内容的步骤中具体执行以下步骤:Performing the following steps in the step of performing the obtaining the content of the latest configuration file corresponding to the interface:
    判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束 后是否被修改;Determining whether the configuration file corresponding to the interface saved in the terminal is modified after the last service request processing ends;
    若是,则读取所述配置文件的内容替换所述Map集合中原来的内容作为所述接口对应的最新配置文件的内容;If yes, reading the content of the configuration file replaces the original content in the Map set as the content of the latest configuration file corresponding to the interface;
    若否,则读取所述Map集合中保存的内容作为所述接口对应的最新的配置文件的内容。If not, the content saved in the Map set is read as the content of the latest configuration file corresponding to the interface.
  14. 根据权利要求13所述的业务处理设备,其特征在于,在执行所述判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改的步骤中具体执行以下步骤:The service processing device according to claim 13, wherein the step of performing the determining whether the configuration file corresponding to the interface stored in the terminal is modified after the last service request processing is completed is performed in the following steps. :
    读取终端本地保存的所述接口对应的配置文件的修改时间;Reading the modification time of the configuration file corresponding to the interface saved locally by the terminal;
    将当前读取的所述修改时间与上次读取的配置文件的修改时间进行对比;Comparing the currently read modification time with the modification time of the last read configuration file;
    若当前读取的所述修改时间与上次读取的配置文件的修改时间一致,则判定所述配置文件的内容未被修改;若当前读取的所述修改时间与上次读取的配置文件的修改时间不一致,则判定所述配置文件的内容已被修改。If the currently read modification time is consistent with the modification time of the last read configuration file, it is determined that the content of the configuration file is not modified; if the currently read modification time and the last read configuration If the modification time of the file is inconsistent, it is determined that the content of the configuration file has been modified.
  15. 根据权利要求12所述的业务处理设备,其特征在于,所述第一属性信息包括所需传递的业务参数的名称;The service processing device according to claim 12, wherein said first attribute information comprises a name of a service parameter to be delivered;
    在执行所述根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数的步骤中具体执行以下步骤:And executing, in the step of acquiring, according to the service ID, the corresponding first attribute information from the content, and acquiring, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object Perform the following steps:
    从所述内容中搜索所述业务ID对应类型业务的配置内容,从所述配置内容中获取所需传递的业务参数的名称;Searching, from the content, the configuration content of the service corresponding to the service ID, and obtaining the name of the service parameter to be delivered from the configuration content;
    从所述JSONObject对象中获取所述业务参数的名称对应的业务参数。Obtaining a service parameter corresponding to the name of the service parameter from the JSONObject object.
  16. 根据权利要求12所述的业务处理设备,其特征在于,所述第二属性信息包括数据库的名称;The service processing device according to claim 12, wherein said second attribute information comprises a name of a database;
    在执行所述根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数的步骤中具体执行以下步骤:And performing the following steps in the step of executing the processing parameter that is required to be processed according to the second attribute information of the service ID to process the required delivery:
    判断所述第二属性信息中是否包含sqlType字段和sqlMap字段;Determining whether the second attribute information includes a sqlType field and an sqlMap field;
    若所述第二属性信息中包含sqlType字段和sqlMap字段,获取所述业务ID对应的sqlType值和sqlMap值,所述sqlType值映射操作所述数据库的操作类型,所述sqlMap值映射所述操作类型的执行语句;If the second attribute information includes a sqlType field and an sqlMap field, the sqlType value and the sqlMap value corresponding to the service ID are obtained, the sqlType value mapping operates an operation type of the database, and the sqlMap value maps the operation type Execution statement;
    利用所述执行语句对所述数据库中与所述业务参数匹配的数据执行所述操作类型对应的操作;Performing, by using the execution statement, an operation corresponding to the operation type on data matching the service parameter in the database;
    若所述第二属性信息中不包含sqlType字段和sqlMap字段,判断所述第二 属性信息中是否包含实现类名称;If the second attribute information does not include the sqlType field and the sqlMap field, determine whether the second attribute information includes an implementation class name;
    若所述第二属性信息中包含实现类名称,获取所述实现类名称对应的装载对象,调用该装载对象对应的处理方法处理所述业务参数。If the second attribute information includes an implementation class name, the loading object corresponding to the implementation class name is obtained, and the processing method corresponding to the loading object is invoked to process the service parameter.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现以下步骤:A computer readable storage medium, wherein the computer readable storage medium stores one or more program data, the one or more program data being executable by one or more processors to implement the following step:
    通过接口接收用户发起的业务请求,所述业务请求携带的数据包括业务参数、用户ID和标识类型的业务ID;Receiving, by the interface, a service request initiated by the user, where the data carried by the service request includes a service parameter, a user ID, and a service ID of the identifier type;
    获取所述接口对应的最新的配置文件的内容,所述内容包括标识不同类型业务的业务ID以及对应类型业务的第一属性信息和第二属性信息;Acquiring the content of the latest configuration file corresponding to the interface, where the content includes a service ID that identifies different types of services, and first attribute information and second attribute information of the corresponding type of service;
    将所述业务请求携带的数据转换为JSONObject对象;Converting data carried by the business request into a JSONObject object;
    从JSONObject对象中获取所述业务请求的业务ID和用户ID;Obtaining a service ID and a user ID of the service request from a JSONObject object;
    根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数;Obtaining corresponding first attribute information from the content according to the service ID, and acquiring, according to the first attribute information, a service parameter that is required to be delivered by the service request from the JSONObject object;
    判断发送所述业务请求的所述用户ID是否具有对该类型业务的操作权限;Determining whether the user ID that sends the service request has an operation right for the type of service;
    若所述用户ID具有对该类型业务的操作权限,根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数。If the user ID has an operation authority for the type of service, the corresponding processing method is invoked according to the second attribute information of the service ID to process the required service parameter.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,配置文件保存在终端本地,获取的配置文件的内容保存在Map集合中;The computer readable storage medium according to claim 17, wherein the configuration file is saved locally in the terminal, and the content of the acquired configuration file is saved in the Map collection;
    在实现所述获取所述接口对应的最新的配置文件的内容的步骤中具体执行以下步骤:Performing the following steps in the step of implementing the content of acquiring the latest configuration file corresponding to the interface:
    判断保存在终端本地的所述接口对应的配置文件在上次业务请求处理结束后是否被修改;Determining whether the configuration file corresponding to the interface saved in the terminal is modified after the last service request processing ends;
    若是,则读取所述配置文件的内容替换所述Map集合中原来的内容作为所述接口对应的最新配置文件的内容;If yes, reading the content of the configuration file replaces the original content in the Map set as the content of the latest configuration file corresponding to the interface;
    若否,则读取所述Map集合中保存的内容作为所述接口对应的最新的配置文件的内容。If not, the content saved in the Map set is read as the content of the latest configuration file corresponding to the interface.
  19. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述第一属性信息包括所需传递的业务参数的名称;The computer readable storage medium of claim 17, wherein the first attribute information comprises a name of a service parameter to be delivered;
    在实现所述根据所述业务ID从所述内容中获取对应的第一属性信息,根据所述第一属性信息从所述JSONObject对象中获取所述业务请求所需传递的业务参数的步骤中具体执行以下步骤:Determining, in the step of obtaining the corresponding first attribute information from the content according to the service ID, obtaining the service parameter required to be delivered by the service request from the JSONObject object according to the first attribute information Perform the following steps:
    从所述内容中搜索所述业务ID对应类型业务的配置内容,从所述配置内容中获取所需传递的业务参数的名称;Searching, from the content, the configuration content of the service corresponding to the service ID, and obtaining the name of the service parameter to be delivered from the configuration content;
    从所述JSONObject对象中获取所述业务参数的名称对应的业务参数。Obtaining a service parameter corresponding to the name of the service parameter from the JSONObject object.
  20. 根据权利要求17所述的业务处理设备,其特征在于,所述第二属性信息包括数据库的名称;The service processing device according to claim 17, wherein said second attribute information comprises a name of a database;
    在实现执行所述根据所述业务ID的第二属性信息调用对应的处理方法处理所述所需传递的业务参数的步骤中具体执行以下步骤:Performing the following steps in the step of implementing the processing method that is required to process the required delivery according to the second attribute information of the service ID:
    判断所述第二属性信息中是否包含sqlType字段和sqlMap字段;Determining whether the second attribute information includes a sqlType field and an sqlMap field;
    若所述第二属性信息中包含sqlType字段和sqlMap字段,获取所述业务ID对应的sqlType值和sqlMap值,所述sqlType值映射操作所述数据库的操作类型,所述sqlMap值映射所述操作类型的执行语句;If the second attribute information includes a sqlType field and an sqlMap field, the sqlType value and the sqlMap value corresponding to the service ID are obtained, the sqlType value mapping operates an operation type of the database, and the sqlMap value maps the operation type Execution statement;
    利用所述执行语句对所述数据库中与所述业务参数匹配的数据执行所述操作类型对应的操作;Performing, by using the execution statement, an operation corresponding to the operation type on data matching the service parameter in the database;
    若所述第二属性信息中不包含sqlType字段和sqlMap字段,判断所述第二属性信息中是否包含实现类名称;If the second attribute information does not include the sqlType field and the sqlMap field, determine whether the second attribute information includes an implementation class name;
    若所述第二属性信息中包含实现类名称,获取所述实现类名称对应的装载对象,调用该装载对象对应的处理方法处理所述业务参数。If the second attribute information includes an implementation class name, the loading object corresponding to the implementation class name is obtained, and the processing method corresponding to the loading object is invoked to process the service parameter.
PCT/CN2018/077139 2018-01-09 2018-02-24 Service processing method, apparatus and device, and computer-readable storage medium WO2019136800A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810019635.4A CN108196879A (en) 2018-01-09 2018-01-09 Method for processing business, device, equipment and computer readable storage medium
CN201810019635.4 2018-01-09

Publications (1)

Publication Number Publication Date
WO2019136800A1 true WO2019136800A1 (en) 2019-07-18

Family

ID=62588915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077139 WO2019136800A1 (en) 2018-01-09 2018-02-24 Service processing method, apparatus and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN108196879A (en)
WO (1) WO2019136800A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400032A (en) * 2020-03-02 2020-07-10 杭州迪普信息技术有限公司 Resource allocation method and device

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985072A (en) 2018-07-16 2018-12-11 北京百度网讯科技有限公司 Operate defence method, device, equipment and computer-readable medium
CN109327499B (en) * 2018-08-01 2022-01-28 平安科技(深圳)有限公司 Service interface management method and device, storage medium and terminal
CN110865797A (en) * 2018-08-28 2020-03-06 北京京东尚科信息技术有限公司 Method and device for processing dynamic attributes of services
CN110162560A (en) * 2019-04-16 2019-08-23 深圳壹账通智能科技有限公司 Finance data interface butt joint method, device, computer equipment and storage medium
CN110297823A (en) * 2019-05-22 2019-10-01 深圳壹账通智能科技有限公司 Field management method, device, computer equipment and storage medium
CN112422476A (en) * 2019-08-20 2021-02-26 北京嗨动视觉科技有限公司 Data processing method, device and system
CN110851209B (en) * 2019-11-08 2023-07-21 北京字节跳动网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN113760341B (en) * 2020-06-11 2023-12-05 北京京东振世信息技术有限公司 Data processing method, device and equipment
CN114422343B (en) * 2020-10-13 2023-12-29 腾讯科技(深圳)有限公司 Service configuration method, device, system and computer readable storage medium
CN112417020B (en) * 2020-11-25 2023-08-18 武汉联影医疗科技有限公司 Service expansion realization method, device, computer equipment and storage medium
CN112950370A (en) * 2021-02-25 2021-06-11 未鲲(上海)科技服务有限公司 Service processing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717179A (en) * 2013-12-13 2015-06-17 中国移动通信集团河南有限公司 Communication service processing method and device
CN105930138A (en) * 2015-12-25 2016-09-07 中国银联股份有限公司 Message processing method and apparatus
CN106850830A (en) * 2017-02-28 2017-06-13 北京神州绿盟信息安全科技股份有限公司 A kind of service request processing method, device, system and associated server
US20170177699A1 (en) * 2015-12-22 2017-06-22 Yahoo! Inc. Size-optimized data interchange method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4487891B2 (en) * 2005-09-16 2010-06-23 日本電気株式会社 Business processing system, business processing method, and business processing program
CN103944902B (en) * 2010-08-13 2017-11-24 华为技术有限公司 Realize the method, apparatus and equipment of business polymerization Mashup business
CN104657158B (en) * 2013-11-20 2018-02-23 北京先进数通信息技术股份公司 The method and apparatus of business processing in a kind of operation system
CN104715309A (en) * 2013-12-11 2015-06-17 阿里巴巴集团控股有限公司 Service control method and device
CN107392766A (en) * 2017-07-25 2017-11-24 上海壹账通金融科技有限公司 Method for processing business, adapter and computer-readable recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717179A (en) * 2013-12-13 2015-06-17 中国移动通信集团河南有限公司 Communication service processing method and device
US20170177699A1 (en) * 2015-12-22 2017-06-22 Yahoo! Inc. Size-optimized data interchange method and system
CN105930138A (en) * 2015-12-25 2016-09-07 中国银联股份有限公司 Message processing method and apparatus
CN106850830A (en) * 2017-02-28 2017-06-13 北京神州绿盟信息安全科技股份有限公司 A kind of service request processing method, device, system and associated server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400032A (en) * 2020-03-02 2020-07-10 杭州迪普信息技术有限公司 Resource allocation method and device

Also Published As

Publication number Publication date
CN108196879A (en) 2018-06-22

Similar Documents

Publication Publication Date Title
WO2019136800A1 (en) Service processing method, apparatus and device, and computer-readable storage medium
CN108737325B (en) Multi-tenant data isolation method, device and system
CN109617646B (en) Message conversion method and device, computer equipment and computer readable storage medium
US20150046519A1 (en) Programming model for synchronizing browser caches across devices and web services
US20110289499A1 (en) Techniques to automatically update software applications
CN111400061A (en) Data processing method and system
CN109617647B (en) Message conversion method and device, computer equipment and computer readable storage medium
US20150331923A1 (en) Crm-based data migration system and method
US11991094B2 (en) Metadata driven static determination of controller availability
JP6266588B2 (en) Synchronizing local and remote data
WO2019223136A1 (en) Data acquisition method and apparatus, and computer device and storage medium
WO2019109519A1 (en) Service rule management method, apparatus and device, and computer-readable storage medium
CN111782652B (en) Data calling method, device, computer equipment and storage medium
CN110677462A (en) Access processing method, system, device and storage medium for multi-block chain network
CN111371851B (en) Connection method, connection device, electronic equipment and storage medium
WO2019161620A1 (en) Application dependency update method, terminal and device, and storage medium
CN111385255B (en) Asynchronous call implementation method and device, server and server cluster
CN114328097A (en) File monitoring method and device, electronic equipment and storage medium
US11595493B2 (en) System and method for namespace masking in an integration flow
CN115774700A (en) File sharing method and device, computer equipment and storage medium
WO2021232860A1 (en) Communication method, apparatus and system
US11757976B2 (en) Unified application management for heterogeneous application delivery
US20170364293A1 (en) Method and apparatus for data processing
WO2022133827A1 (en) Method and apparatus for processing task processing request, and blockchain node device
CN110083509B (en) Method and device for arranging log data

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: 18900462

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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 12.10.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18900462

Country of ref document: EP

Kind code of ref document: A1