CN105159974A - Method for automatically generating cross-data-source web service - Google Patents
Method for automatically generating cross-data-source web service Download PDFInfo
- Publication number
- CN105159974A CN105159974A CN201510534277.7A CN201510534277A CN105159974A CN 105159974 A CN105159974 A CN 105159974A CN 201510534277 A CN201510534277 A CN 201510534277A CN 105159974 A CN105159974 A CN 105159974A
- Authority
- CN
- China
- Prior art keywords
- web services
- configuration
- web service
- data
- rreturn value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种跨数据源的web服务自动生成方法,属于web服务生成方法领域。本发明所述方法根据用户的配置依次动态生成返回结果类,web服务及配置文件,然后发布web服务。与现有技术相比,本发明方法能够极大地提高新web服务需求的响应时间,具有很好的推广和应用价值。The invention discloses a cross-data source web service automatic generation method, which belongs to the field of web service generation methods. The method of the present invention dynamically generates the return result class, web service and configuration file sequentially according to the configuration of the user, and then publishes the web service. Compared with the prior art, the method of the invention can greatly improve the response time of new web service requirements, and has good promotion and application value.
Description
技术领域 technical field
本发明涉及web服务生成方法领域,具体地说是一种跨数据源的web服务自动生成方法。 The invention relates to the field of web service generating methods, in particular to a method for automatically generating web services across data sources.
背景技术 Background technique
近年来各单位组织逐渐加大对信息化建设的投入,与此同时,信息技术逐渐发展成熟。在这样的背景下,各单位建成了众多具有不同功能的信息化系统。这些系统相对独立,却又互相依赖各自的功能,为了实现各系统间的互动操作,人们往往选择开放web服务。 In recent years, various units and organizations have gradually increased their investment in informatization construction. At the same time, information technology has gradually matured. In this context, various units have built many information systems with different functions. These systems are relatively independent, but depend on each other for their functions. In order to realize the interactive operation between the systems, people often choose to open web services.
区别于本地服务,web服务通过网络调用其他系统的资源。由此,web服务具有三个优点:平台无关、编程语言无关、升级和维护简单。不管在什么平台下都可以使用web服务;只要遵循相关协议,就可以使用任意编程语言来向其他系统请求web服务;因为不需要考虑客户端的兼容性问题,web服务的部署、升级和维护都比较简单。 Different from local services, web services call resources of other systems through the network. Therefore, web services have three advantages: platform-independent, programming language-independent, easy to upgrade and maintain. Web services can be used regardless of the platform; as long as the relevant protocols are followed, any programming language can be used to request web services from other systems; because there is no need to consider client compatibility issues, the deployment, upgrade and maintenance of web services are relatively easy. Simple.
Web服务在使用方式上主要有两种,一种是基于json的restful接口方式,一种是基于WSDL文件的webservice方式。由于json的轻量和restful接口的易用,基于json的restful接口方式已经成为主流。在此之前,各系统普遍采用基于WSDL文件的webservice方式进行互操作。 There are two main ways to use Web services, one is the restful interface method based on json, and the other is the webservice method based on WSDL files. Due to the light weight of json and the ease of use of the restful interface, the restful interface method based on json has become the mainstream. Prior to this, various systems generally adopted the webservice method based on WSDL files for interoperability.
系统的设计者会根据当下或者预期的需求对系统开放相应的web服务。然而随着系统的运行,不可避免地会产生新的web服务需求,此时人们往往是根据这些新的需求进行开发,然后再部署到线上。这种方式对新需求较少的系统还可以接受,但对于频繁产生新需求的系统而言,灵活性太差。需求方需要等待web服务开发、测试、部署完毕才可以使用,另一方面,对于提供方也需要投入专门的人力来完成上述工作。 The system designer will open corresponding web services to the system according to the current or expected needs. However, with the operation of the system, new web service requirements will inevitably be generated. At this time, people often develop according to these new requirements and then deploy them online. This method is acceptable for systems with few new requirements, but for systems that frequently generate new requirements, the flexibility is too poor. The demand side needs to wait for the web service to be developed, tested, and deployed before it can be used. On the other hand, the provider also needs to invest in specialized manpower to complete the above work.
发明内容 Contents of the invention
本发明的技术任务是针对上述现有技术的不足,提供一种跨数据源的web服务自动生成方法。 The technical task of the present invention is to provide a method for automatically generating web services across data sources in view of the above-mentioned deficiencies in the prior art.
本发明的技术任务是按以下方式实现的:一种跨数据源的web服务自动生成方法,其特点是根据用户的配置依次动态生成返回结果类,web服务及配置文件,然后发布web服务,包括以下具体步骤: The technical task of the present invention is realized in the following manner: a method for automatically generating web services across data sources, which is characterized in that the return result class, web services and configuration files are dynamically generated successively according to the configuration of the user, and then the web services are issued, including The following specific steps:
1)配置生成web服务需要的信息 1) Configure the information needed to generate web services
需要的配置信息包括:操作类型、请求参数和返回值、结果过滤条件; The required configuration information includes: operation type, request parameters and return value, and result filter conditions;
2)根据配置生成可执行的sql语句 2) Generate executable sql statements according to the configuration
根据步骤1)中配置的操作类型、请求参数和返回值、结果过滤条件动态生成sql语句; According to the operation type configured in step 1), request parameters and return values, and result filter conditions, dynamically generate SQL statements;
3)保存配置的web服务信息和sql语句 3) Save the configured web service information and sql statement
将步骤2)中生成的sql语句及web服务配置信息持久化存储; Persistently store the sql statement and web service configuration information generated in step 2);
4)生成用于保存单条数据记录的数据模型 4) Generate a data model for saving a single data record
根据配置的返回值信息动态生成用于保存单条数据记录的数据模型代码; Dynamically generate the data model code for saving a single data record according to the configured return value information;
5)生成服务返回值类; 5) Generate service return value class;
6)生成web服务及相关配置文件; 6) Generate web services and related configuration files;
7)发布web服务。 7) Publish the web service.
作为优选,步骤1)中,需要的配置信息还包括web服务需要的数据源、web服务名称及URL、版本号、服务描述。 Preferably, in step 1), the required configuration information also includes the data source required by the web service, the name and URL of the web service, the version number, and the service description.
步骤1)中所述操作类型指添加、修改、删除或查询。 The operation type mentioned in step 1) refers to add, modify, delete or query.
步骤5)中所述返回值类包括返回值状态码,返回值描述,总页数,当前页数及具体数据。 The return value category described in step 5) includes return value status code, return value description, total number of pages, current page number and specific data.
与现有技术相比,本发明的跨数据源的web服务自动生成方法具有以下有益效果: Compared with the prior art, the cross-data source web service automatic generation method of the present invention has the following beneficial effects:
(一)在产生新的web服务需求时,通过管理员简单的配置即可自动产生满足需求的web服务,灵活、高效,极大地提高了新web服务需求的响应时间。 (1) When a new web service requirement is generated, the web service that meets the requirement can be automatically generated through simple configuration by the administrator, which is flexible and efficient, and greatly improves the response time of the new web service requirement.
(二)该方法可以提供一致的web服务实现方案,对web服务使用方更加友好。 (2) This method can provide a consistent web service implementation solution, which is more friendly to web service users.
(三)该方法使得数据库操作更加安全、可控。 (3) This method makes the database operation more secure and controllable.
具体实施方式 Detailed ways
以具体实施例对本发明的跨数据源的web服务自动生成方法作以下详细地说明。 The method for automatically generating web services across data sources of the present invention will be described in detail below with specific embodiments.
实施例: Example:
实现本发明跨数据源的web服务自动生成方法根据用户的配置依次动态生成返回结果类,web服务及配置文件,然后发布web服务。至此,可以通过restful方式或者WSDL方式使用web服务,从而避免了手动编写web服务。 Realize the cross-data-source web service automatic generation method of the present invention to dynamically generate return result class, web service and configuration file sequentially according to the configuration of the user, and then publish the web service. So far, web services can be used in restful or WSDL mode, thus avoiding manual writing of web services.
实现上述方法的具体步骤为: The specific steps to realize the above method are:
1)配置生成web服务需要的信息 1) Configure the information needed to generate web services
需要的配置信息包括:web服务需要的数据源、操作类型、请求参数和返回值、结果过滤条件、web服务名称及URL、版本号、服务描述。其中操作类型是指添加、修改、删除或者查询; The required configuration information includes: data source required by the web service, operation type, request parameters and return value, result filter conditions, web service name and URL, version number, and service description. The operation type refers to add, modify, delete or query;
2)根据配置生成可执行的sql语句 2) Generate executable sql statements according to the configuration
根据步骤1)中配置的操作类型、请求参数、返回值、过滤条件动态生成sql语句; Dynamically generate SQL statements according to the operation type, request parameters, return value, and filter conditions configured in step 1);
3)保存配置的web服务信息和sql语句 3) Save the configured web service information and sql statement
将步骤2)中生成的sql语句及其它web服务配置信息持久化存储; Persistently store the sql statement and other web service configuration information generated in step 2);
4)生成用于保存单条数据记录的数据模型 4) Generate a data model for saving a single data record
根据配置的返回值信息动态生成用于保存单条数据记录的数据模型代码; Dynamically generate the data model code for saving a single data record according to the configured return value information;
5)生成服务返回值类 5) Generate service return value class
返回值类包括返回值状态码,返回值描述,总页数,当前页数,具体数据; The return value class includes return value status code, return value description, total page number, current page number, and specific data;
6)生成web服务及相关配置文件 6) Generate web services and related configuration files
根据配置,生成web服务需要的其它配置文件; According to the configuration, generate other configuration files required by the web service;
7)自动发布web服务。 7) Automatically publish web services.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510534277.7A CN105159974A (en) | 2015-08-27 | 2015-08-27 | Method for automatically generating cross-data-source web service |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510534277.7A CN105159974A (en) | 2015-08-27 | 2015-08-27 | Method for automatically generating cross-data-source web service |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105159974A true CN105159974A (en) | 2015-12-16 |
Family
ID=54800830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510534277.7A Pending CN105159974A (en) | 2015-08-27 | 2015-08-27 | Method for automatically generating cross-data-source web service |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105159974A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106815371A (en) * | 2017-02-06 | 2017-06-09 | 浪潮通用软件有限公司 | A kind of method for reading data realized by visual configuration across data source |
CN108959537A (en) * | 2018-06-29 | 2018-12-07 | 新华三大数据技术有限公司 | Web service interface acquisition methods and device |
CN109086148A (en) * | 2018-08-01 | 2018-12-25 | 山东浪潮通软信息科技有限公司 | A kind of cross-platform method for calling Web Service service |
CN109522139A (en) * | 2018-11-23 | 2019-03-26 | 杭州数梦工场科技有限公司 | A kind of tables of data service creation call method, device, equipment and storage medium |
CN109871289A (en) * | 2019-02-01 | 2019-06-11 | 北京顺丰同城科技有限公司 | A kind of remote procedure call service creation method and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040117425A1 (en) * | 2002-12-17 | 2004-06-17 | Ibm Corporation | Apparatus and method for flexible web service deployment |
US20070067384A1 (en) * | 2005-09-21 | 2007-03-22 | Angelov Dimitar V | System and method for web services configuration creation and validation |
CN1955957A (en) * | 2005-10-27 | 2007-05-02 | 北京航空航天大学 | Database Automation Operation Method Based on Web Service |
CN101690123A (en) * | 2007-05-18 | 2010-03-31 | 国际商业机器公司 | Apparatus, system, and method for a data server-managed web services runtime |
CN101807204A (en) * | 2010-03-05 | 2010-08-18 | 武汉大学 | Dynamic creation method of processing Web service with remote sensing image |
CN102316128A (en) * | 2010-06-29 | 2012-01-11 | 阿尔卡特朗讯 | A kind ofly be used to generate network service method and device |
CN103034690A (en) * | 2012-11-28 | 2013-04-10 | 华南理工大学 | Self-customizing method of mobile terminal client application program based on web service |
CN103136263A (en) * | 2011-11-23 | 2013-06-05 | 英业达股份有限公司 | Method of automatically generating SQL statement |
-
2015
- 2015-08-27 CN CN201510534277.7A patent/CN105159974A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040117425A1 (en) * | 2002-12-17 | 2004-06-17 | Ibm Corporation | Apparatus and method for flexible web service deployment |
US20070067384A1 (en) * | 2005-09-21 | 2007-03-22 | Angelov Dimitar V | System and method for web services configuration creation and validation |
CN1955957A (en) * | 2005-10-27 | 2007-05-02 | 北京航空航天大学 | Database Automation Operation Method Based on Web Service |
CN101690123A (en) * | 2007-05-18 | 2010-03-31 | 国际商业机器公司 | Apparatus, system, and method for a data server-managed web services runtime |
CN101807204A (en) * | 2010-03-05 | 2010-08-18 | 武汉大学 | Dynamic creation method of processing Web service with remote sensing image |
CN102316128A (en) * | 2010-06-29 | 2012-01-11 | 阿尔卡特朗讯 | A kind ofly be used to generate network service method and device |
CN103136263A (en) * | 2011-11-23 | 2013-06-05 | 英业达股份有限公司 | Method of automatically generating SQL statement |
CN103034690A (en) * | 2012-11-28 | 2013-04-10 | 华南理工大学 | Self-customizing method of mobile terminal client application program based on web service |
Non-Patent Citations (2)
Title |
---|
张峰: "一种基于Web Services的数据库资源服务化方法", 《山东大学学报(理学版)》 * |
黄妍琴: "web服务失效问题研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106815371A (en) * | 2017-02-06 | 2017-06-09 | 浪潮通用软件有限公司 | A kind of method for reading data realized by visual configuration across data source |
CN108959537A (en) * | 2018-06-29 | 2018-12-07 | 新华三大数据技术有限公司 | Web service interface acquisition methods and device |
CN109086148A (en) * | 2018-08-01 | 2018-12-25 | 山东浪潮通软信息科技有限公司 | A kind of cross-platform method for calling Web Service service |
CN109522139A (en) * | 2018-11-23 | 2019-03-26 | 杭州数梦工场科技有限公司 | A kind of tables of data service creation call method, device, equipment and storage medium |
CN109871289A (en) * | 2019-02-01 | 2019-06-11 | 北京顺丰同城科技有限公司 | A kind of remote procedure call service creation method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105159974A (en) | Method for automatically generating cross-data-source web service | |
CN103064664B (en) | Hadoop parameter automatic optimization method and system based on performance pre-evaluation | |
CN104991791B (en) | The increment upgrading dissemination method and device of a kind of file | |
JP5916959B2 (en) | Dynamic data acquisition method and system | |
US10754971B2 (en) | Referenced access control list | |
CN102150150A (en) | Techniques for resource location and migration across data centers | |
CN103473287A (en) | Method and system for automatically distributing, running and updating executable programs | |
WO2015110062A1 (en) | Distributed data storage method, device and system | |
CN103338135A (en) | Real-time monitoring method of cluster storage capacity | |
CN104933188A (en) | Data synchronism system and method of patent individuation index | |
CN103942108B (en) | Resource parameters optimization method under Hadoop isomorphism cluster | |
CN107092502B (en) | Automatic application configuration method and device based on cloud operating system | |
CN104219226B (en) | A kind of method of optimal communication agent node number in determination cloud platform | |
CN103685517A (en) | Storage hierarchical scheduling method and system based on service class characteristics | |
CN104360842A (en) | Service dynamic process arrangement method based on JBPM (Java business process management) | |
CN102147809A (en) | Parallel file system and management method thereof | |
CN107609109A (en) | A kind of report form generation method, device and system | |
CN102932416B (en) | A kind of intermediate data storage method of information flow task, processing method and device | |
CN112019577A (en) | Exclusive cloud storage implementation method and device, computing equipment and computer storage medium | |
CN114997414B (en) | Data processing method, device, electronic equipment and storage medium | |
CN103677845A (en) | Website application deployment method | |
CN106547916A (en) | A kind of user's portrait tag queries method and device | |
CN104714983B (en) | The generation method and device of distributed index | |
CN103095833B (en) | Cloud service system update method and device | |
US20130138683A1 (en) | Systems and methods of automatic generation and execution of database queries |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20151216 |
|
WD01 | Invention patent application deemed withdrawn after publication |