Access development method, device, system, and medium for multiple subsystem access

By automatically generating request and response conversion classes, it solves the problem of low development efficiency caused by differences in formats of different service protocols, realizes automated interface development for multi-subsystem access, improves development efficiency and reduces costs.

CN113778721BActive Publication Date: 2024-09-10BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111132393.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-27
Publication Date
2024-09-10
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

Different protocol formats between different software and hardware services require manual encapsulation of complex classes when calling services, which reduces development efficiency and increases development costs.

Method used

By automatically generating request conversion classes and response conversion classes based on the request parameters of the external server and the access protocol of the subsystem to be accessed, and generating access files, the need for developers to manually encapsulate classes is reduced.

Benefits of technology

It improves development efficiency, reduces development difficulty and cost, and realizes automated interface development for multi-subsystem access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113778721B
    Figure CN113778721B
Patent Text Reader

Abstract

The embodiment of the present invention discloses an access development method, device, system, and medium for accessing multiple subsystems. In a specific implementation, the method includes: automatically generating a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed; sending the request conversion class to the subsystem to be accessed to obtain the response parameters of the subsystem to be accessed, and generating a response conversion class for the subsystem to be accessed to respond to the call of the external server according to the access protocol and response parameters of the subsystem to be accessed; and generating an access file according to the request conversion class and the response conversion class. This implementation automatically generates a request conversion class based on the request parameters and the access protocol of the subsystem to be accessed, and generates a response conversion class based on the access protocol and response parameters, so that the access file can be automatically generated by the development end, which reduces the workload of developers and improves the work efficiency of developers, and has broad application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more specifically, to an access development method, device, system, and medium for accessing multiple subsystems. Background Art

[0002] With the rapid development of the intelligent Internet of Things, the combination of different software and hardware services is gradually increasing. When calling third-party services, it is necessary to encapsulate the request parameters according to the protocol format specified by the service. However, each end service has its own protocol format, and most of the protocol formats are different, which leads to the need to adapt the protocol during the mutual call process. Often, complex classes must be manually encapsulated for a simple function, which leads to low development efficiency and undoubtedly increases the development cost of the service call process. Summary of the invention

[0003] The object of the present invention is to provide an access development method, device, system, and medium for multiple subsystem accesses to solve at least one of the problems existing in the prior art.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] A first aspect of the present invention provides an access development method for multiple subsystems, which is applied to a development end and includes:

[0006] Automatically generate a request conversion class for the external server to call the subsystem to be accessed based on the request parameters of the external server and the access protocol of the subsystem to be accessed;

[0007] Send the request conversion class to the subsystem to be connected to obtain the response parameters of the subsystem to be connected, and generate a response conversion class for the subsystem to be connected to respond to the external server call according to the access protocol and response parameters of the subsystem to be connected;

[0008] Generate access files based on the request conversion class and response conversion class.

[0009] In some optional embodiments,

[0010] The request conversion class for automatically generating the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed further includes:

[0011] Parse the access protocol to generate an intermediate conversion class;

[0012] Map the intermediate conversion class line by line using reflection to determine the location where the request parameter is bound in the intermediate conversion class; and

[0013] Bind the request parameters to the location and compile to generate the request conversion class.

[0014] The response conversion class for generating a response from the subsystem to be accessed to the external server call according to the access protocol and response parameters of the subsystem to be accessed further includes:

[0015] Bind the response parameters in the position and compile to generate the response conversion class.

[0016] In some optional embodiments,

[0017] The request conversion class for automatically generating the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed further includes:

[0018] The access protocol is parsed to generate an intermediate conversion class and an annotation file of the intermediate conversion class. The intermediate conversion class also includes a protocol string. The protocol string represents the hierarchical structure of the access protocol in the form of a parent tag.

[0019] Using annotation files to determine where request parameters will be bound based on the intermediate conversion class; and

[0020] Bind the request parameters to the location and compile to generate the request conversion class.

[0021] The request conversion class for automatically generating the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed further includes:

[0022] The response parameters are bound in the location and compiled to generate the response conversion class.

[0023] In some optional embodiments, the intermediate conversion class includes a nested hierarchical structure.

[0024] In some optional embodiments, the access protocol is parsed based on one of the DOM method, the SAX method, and the STAX method.

[0025] In some optional embodiments, when the format of the access protocol is JSON format, before automatically generating a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed, the method further includes:

[0026] Convert the access protocol format to XML format.

[0027] A second aspect of the present invention provides an application service method based on multiple subsystem access, which is applied to a server, comprising:

[0028] Generate a request protocol according to the service request and the pre-stored access file and send it to the subsystem to be accessed, the service request including request parameters;

[0029] Obtaining the response value of the subsystem to be accessed, and generating a response protocol according to the access file and the response value, wherein the response value includes response parameters;

[0030] Among them, the access file is generated by the access development method described above.

[0031] A third aspect of the present invention provides an access development device for implementing the access development method described above, comprising:

[0032] The request conversion module automatically generates a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed;

[0033] A response conversion module generates a response conversion class for the subsystem to be accessed to respond to the external server call according to the access protocol of the subsystem to be accessed and the response parameters received from the subsystem to be accessed; and

[0034] The file generation module generates access files according to the request conversion class and the response conversion class.

[0035] A fourth aspect of the present invention provides an application service system for implementing the application service method described above, comprising an application layer for receiving user operations, and an access layer for accessing a subsystem to be accessed, wherein the access layer is configured as follows:

[0036] Generate a request protocol based on a service request generated by a user operation received by the application layer and a pre-stored access file;

[0037] Generate a response protocol according to the access protocol of the subsystem to be accessed and the response value received from the subsystem to be accessed;

[0038] Complete the access to the subsystem to be accessed according to the response protocol so that the application layer calls the application service of the subsystem to be accessed according to the received user operation,

[0039] Among them, the access file is generated by the access development method described above.

[0040] A fifth aspect of the present invention provides a computer device, comprising:

[0041] one or more processors;

[0042] a storage device having one or more programs stored thereon;

[0043] When one or more programs are executed by one or more processors, the one or more processors implement the access development method described above or the application service method described above.

[0044] A sixth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the access development method as described above or the application service method as described above is implemented.

[0045] The beneficial effects of the present invention are as follows:

[0046] In view of the existing problems, the present invention develops an access development method, device, system, and medium for accessing multiple subsystems, and automatically generates a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed, and generates a response conversion class according to the access protocol and response parameters of the subsystem to be accessed, so that the development end can automatically generate an access file, so that developers no longer need to manually encapsulate the complex classes of various subsystems according to the protocol format, which reduces the workload of developers in developing interfaces, while reducing the development difficulty, greatly improving the development efficiency, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings.

[0048] Figure 1 A flow chart showing an access development method for multiple subsystem access according to an embodiment of the present invention;

[0049] Figure 2 A schematic structural block diagram of an access development system for implementing an access development method according to an embodiment of the present invention is shown;

[0050] Figure 3a and Figure 3b A schematic diagram showing a user interaction interface of an access development device according to an embodiment of the present invention;

[0051] Figure 4 A schematic flow chart showing a parsing process in an access development method according to an embodiment of the present invention;

[0052] Figure 5 A schematic file list of an intermediate conversion class in an access development method according to an embodiment of the present invention is shown;

[0053] Figure 6 A schematic hierarchical relationship diagram of an intermediate conversion class in an access development method according to an embodiment of the present invention is shown;

[0054] Figure 7 A schematic structural block diagram showing an application service system according to an embodiment of the present invention; and

[0055] Figure 8 A schematic structural diagram of a computer device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0056] In order to explain the present invention more clearly, the present invention is further described below in conjunction with embodiments and drawings. Similar components in the drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and the protection scope of the present invention should not be limited thereto.

[0057] For at least one of the above questions, such as Figure 1 As shown, an embodiment of the present invention provides an access development method for multiple subsystems, which is applied to a development end and includes:

[0058] Automatically generate a request conversion class for the external server to call the subsystem to be accessed based on the request parameters of the external server and the access protocol of the subsystem to be accessed;

[0059] Sending the request conversion class to the subsystem to be accessed to obtain the response parameters of the subsystem to be accessed, and generating a response conversion class for the subsystem to be accessed to respond to the external server call according to the access protocol and response parameters of the subsystem to be accessed;

[0060] Generate access files based on the request conversion class and response conversion class.

[0061] In this embodiment, a request conversion class for the external server to call the subsystem to be accessed is automatically generated according to the request parameters of the external server and the access protocol of the subsystem to be accessed, and a response conversion class is generated according to the access protocol and response parameters of the subsystem to be accessed. Thus, the development end can automatically generate an access file, so that developers no longer need to manually encapsulate complex classes of various subsystems according to the protocol format, which reduces the workload of interface development personnel and reduces the difficulty of development. It greatly improves development efficiency and has broad application prospects.

[0062] In order to better understand the implementation process of the access development method for multiple subsystems of the present invention, firstly, Figure 2 Describe the structure of the application service system that affects the overall implementation of the application service method.

[0063] like Figure 2 As shown, the application service system includes a service end 100, a development end 200, and multiple subsystems 300-1, 300-2, ..., and 300-n (where n is an integer, n≥2). In the description of this article, when there is no need to distinguish, the subsystem is represented by the number 300. The application service system can be applied to various IoT scenarios such as smart home appliances, smart parks, smart cities, and smart transportation.

[0064] Among them, the server 100 can be an application service system composed of one or more servers, and the server can be a cloud server or a local server. The server includes an application layer and an access layer with a user interaction interface. The server 100 can generate a service request to call a service to an external subsystem based on the user operation of the user on the user interaction interface. The development end 200 can be a server equipped with an integrated development environment (IDE), which can be a desktop computer, a laptop computer and other devices used by developers. The IDE can be an integrated development platform based on Java language such as IDEA and VSCode. In particular, in order to implement the access development method of the present invention, a parsing plug-in for automatically generating access files is also integrated in the IDE of the development end, wherein the parsing plug-in is a plug-in library published to the development platform, and the published format is a zip package or a jar package. When used, the plug-in library is downloaded and installed in the IDE of the development end, so that the access file is automatically generated by calling the parsing plug-in during the development process; the automatically generated access file refers to a hierarchical .JavaBean file generated according to the access protocol file, and the file format is .java. The included file is called according to specific business needs during the development process, which can reduce errors caused by manual writing, thereby improving development efficiency.

[0065] In addition, multiple subsystems 300-1, 300-2, ..., and 300-n represent various Internet of Things management subsystems that can be called and managed by the server 100. For example, subsystem 300 can be a camera management subsystem that can manage and control the behavior of the camera, such as bit rate adjustment, direction adjustment, etc. In this example, each subsystem can be a plurality of camera management subsystems 300-1, 300-2, ..., and 300-n produced by different manufacturers. Of course, subsystem 300 can also represent other management subsystems, and each subsystem 300-1, 300-2, ..., and 300-n in subsystem 300 can also represent different types of Internet of Things management subsystems produced by different manufacturers, for example, subsystem 300-1 represents a camera management subsystem produced by manufacturer A, subsystem 300-1 represents an indicator light management subsystem produced by manufacturer B, ..., and 300-n represents a display screen management subsystem produced by manufacturer N, etc., which are not specifically limited here.

[0066] The access protocols used by the subsystem communication interfaces produced by different manufacturers may be different. For example, subsystem 300-1 is a communication interface using the HTTP protocol, and subsystem 300-2 is a communication interface using the TCP protocol. Therefore, developers are required to develop interfaces on the development side. In an embodiment of the present invention, by integrating the parsing plug-in designed and developed in advance by the developer into the IDE, the interface developer does not have to manually write code to encapsulate the interface files one by one, but can automatically generate access files for the access protocols of different subsystems, and upload the access files generated in this embodiment to the server side, that is, the application service calls between the server side 100 and each subsystem can be realized in the actual application service call process, which reduces the workload and complexity of interface development and improves development efficiency.

[0067] Combine the following Figures 3a to 6 The specific implementation of the access development method for multiple subsystem access is described in detail with a more specific embodiment, and the access development method is described by taking the developer developing the interface of the subsystem 300-1 to be accessed to the development client 100 as an example.

[0068] In this article, relative to the overall scenario with multiple subsystems connected, the subsystem may also be referred to as a subsystem to be connected to distinguish it from other subsystems, which will not be further explained in this article.

[0069] In step S1, a request conversion class for the external server to call the subsystem to be accessed is automatically generated according to the request parameters of the external server and the access protocol of the subsystem to be accessed.

[0070] In actual development, this step includes parsing and parameter binding process, and compilation process. The parsing and parameter binding process is completed by the parsing plug-in developed by the developer, and the compilation process is completed by the compiler in the IDE.

[0071] Specifically, at the beginning of the interface development project, the developer first starts the IDE installed on the development terminal 200, and runs the parsing plug-in developed by the developer in the IDE. When the parsing plug-in runs, the following information will be displayed in the IDE window: Figure 3a The user interaction interface shown. Those skilled in the art should understand that Figure 3a Only a schematic diagram of the user interaction interface is shown, and the specific form is not limited to this, that is, the interface titles "Automatically parse access protocol", "Protocol file storage path" and "Example object generation path" can also be other expressions with the same meaning. In addition, those skilled in the art should also understand that when executing a development project for the first time, if the parsing plug-in is not installed in the IDE, the developer can download the installation package in the corresponding download path to install the parsing plug-in, and then start the IDE and run the parsing plug-in. The specific process will not be repeated here.

[0072] Reference Figure 3b As shown, the developer introduces the interface protocol of the subsystem 300-1 in the "Protocol File Storage Path" column in the user interaction interface. For example, the developer can introduce the storage address of the interface protocol from the path list according to the storage location of the interface protocol by clicking on the blank space of the address introduction column, so as to facilitate the parsing of the plug-in call. The interface protocol is usually an interface protocol that is pre-acquired and saved from the developer of the subsystem after determining the type of subsystem to be connected to the server 100, which represents the protocol logic and encoding and decoding format of the subsystem interface. In an embodiment of the present invention, the interface protocol is essentially a protocol template that is parsed as a parsing plug-in. The interface protocol of the subsystem is usually a file in XML format. In some cases, depending on the subsystem developer, the interface protocol can also be a JSON file.

[0073] Continue to refer to Figure 3b In the user interface, the developer introduces the storage location of the file generated after the subsystem 300-1 interface protocol is parsed in the "Instance Object Generation Path" column. The developer can choose the storage location by himself. Usually, for the IDE, in order to smoothly proceed with the subsequent process, the file generated after the parsing should be stored in the project directory of the interface development project. Those skilled in the art should understand that the path can be either a local path or a cloud path.

[0074] After the "protocol file storage path" and "instance object generation storage path" are introduced, the developer clicks the "start parsing" button, and the development end 200 uses the parsing plug-in to automatically generate a request conversion class for the server end 100 to call the subsystem 300-1.

[0075] Specifically, when the "analysis button" is clicked, the development end 200 uses the analysis plug-in to first parse the access protocol to generate an intermediate conversion class, and bind the request parameters to the intermediate conversion class. The request parameters are the request parameters obtained from the server end 100 in advance before the analysis is performed, and the request parameters represent the interface call information of the server end in array form.

[0076] In the development stage, the request parameter does not actually indicate the meaning of requesting a specific service. It is intended to obtain a form corresponding to the call parameter structure of the server 100. However, for the server 100, it is sending a service request to the development end 200. Therefore, in this article, the development stage only uses the request parameter to indicate the service request obtained from the server 200 to distinguish it from the specific service request sent in the actual application service stage. However, in the specific service call stage, the service request itself should include the request parameter indicating the call parameter structure, which will not be described in detail below.

[0077] More specifically, refer to Figure 4As shown, during the parsing process performed by the parsing plug-in, when the "Start Parsing" button is clicked, the parsing plug-in obtains the access protocol of subsystem 300-1, that is, its protocol template, according to the storage location introduced in the "Protocol File Storage Path"; determines whether the access protocol meets the format requirements. In the embodiment of the present application, the access protocol is parsed based on one of the DOM method, the SAX method, and the STAX method. Therefore, the parsing plug-in determines whether the access protocol meets the XML format. If it does, the access protocol is parsed using one of the above methods to generate an intermediate conversion class. The intermediate conversion class is based on Figure 3b The path set in is stored in the corresponding location; if it is not satisfied, an error warning message will be prompted. The developer needs to check whether there is an error code in the access protocol provided by the developer, and then repeat the parsing steps after modification.

[0078] It is worth noting that the judgment of whether the format requirements are met in the above steps is performed under the premise that the access protocol is XML, and whether there are error codes in the XML format file. Considering that the interface protocol format provided by the developer of the subsystem is not always in XML format, for example, some developers provide the interface protocol format in JSON format. Optionally, when the format of the access protocol is in JSON format, before step S1, the access development method also includes: converting the format of the access protocol into XML format, so that the method of the invention can be applied to the access development of various subsystems.

[0079] It should be noted that in the embodiments of the present application, the interface development is performed using an IDE based on the Java language, and the "class" is represented by a special class Bean in Java. Those skilled in the art should understand that the meaning of Bean is a reusable Java component. In the present application, the interface protocol is parsed and expressed as a class (Bean) to represent the structural meaning of the interface protocol. Among them, the intermediate conversion class (Bean) is a class file that directly represents the hierarchical logical structure of the access protocol in the format of JavaBean. The file list of the generated intermediate conversion class is as follows: Figure 5 shown.

[0080] Optionally, the intermediate conversion class includes a nested hierarchical structure. For example, Figure 6 As shown, Figure 5 Each code file given in the category has Figure 6The hierarchical structure shown in . However, those skilled in the art should understand that the hierarchical structure is used to specify the segmentation method for expressing the interface protocol after parsing, that is, to set it equal to the nesting rules of the access protocol, so as to reflect the hierarchical relationship in the intermediate conversion class and avoid the subsequent execution of the program being independent of the access protocol. The parsing plug-in will determine the location where the request parameters will be bound according to this segmentation method. The specific segmentation method of the hierarchical structure is not limited to this, that is, the present application does not intend to limit the hierarchical structure of the intermediate conversion class generated after parsing the access protocol in the parsing plug-in to the following: Figure 6 In the specific form described above, the developer of the parsing plug-in may also specify a two-level or three-level hierarchical structure in the design, as long as the parsing plug-in can determine the binding position during the binding process of the request parameters.

[0081] After the intermediate conversion class is obtained through parsing, the plug-in binding request parameters are parsed. Those skilled in the art should understand that the parsing and binding processes are automatically completed after the developer of the interface clicks the "Start Parsing" button.

[0082] Specifically, the reflection method is used to map the intermediate conversion class line by line to determine the position where the request parameters are bound in the intermediate conversion class; the request parameters are bound to the position and compiled to generate the request conversion class. Through the above settings, the access protocol of subsystem 300-1 is used as a template to parse and generate the structural logic of the access protocol represented by the intermediate conversion class, and the request parameters are bound according to the hierarchical structure of the intermediate conversion class, that is, Figure 6 The nested relationship in the binds the request parameters to Figure 5 in the corresponding code file in the file list shown.

[0083] However, the reflection method is to reflectively read each line of code in the intermediate conversion class line by line in a mapping manner, and search for the location where the request parameters need to be bound. Each line of code reading process will take time. Specifically, Java's reflection mechanism refers to a way for back-end development to obtain and use class information in the running state of the program without the need for front-end cooperation. Java's reflection mechanism can construct objects of any class and call the properties and methods of any object. The java.lang.reflect package in Java provides various methods required for reflection.

[0084] Taking this into consideration, in an optional embodiment, a hard-coded method is used instead of a reflection method to determine the binding position of the request parameters. Specifically, in step S2, the request conversion class for the external server to call the subsystem to be accessed is automatically generated according to the request parameters of the external server and the access protocol of the subsystem to be accessed, further including: parsing the access protocol to generate an intermediate conversion class and an annotation file of the intermediate conversion class, the intermediate conversion class also includes a protocol string, and the protocol string represents the hierarchical structure of the protocol template in the form of a parent tag; using the annotation file to determine the position where the request parameters will be bound based on the intermediate conversion class; and binding the request parameters to the position. Among them, the format of the annotation file is the same as that of the access file, both of which are .java files.

[0085] For example, if the access protocol in XML format is as follows:

[0086]

[0087] Then, the protocol string representing the hierarchical structure of the access protocol in the form of a parent tag is as follows:

[0088] private String xmlStr=″ <message> <devices>< / devices> <userid>< / userid> < / message> ";

[0089] private String xmlStr=″<UserID token=\″\″> ";

[0090] private String xalStr = " <devices> <device> <animal>< / animal> <car>< / car> <test>< / test> < / devices> ";

[0091] private String xmlStr=″<Device 1d=\"\"> <name>< / name> <nrxconf> <nic>< / nic> ";

[0092] private String xmlStr=″ <Animal > <cat>< / cat> < / An1mal>";

[0093] private String xmlStr=″ <Car 1d=\″\″ >< / Car>";

[0094] private String xmlStr=″<Cat 1d=\″\″> ";

[0095] private String xmlStr=″ <nic> <port>< / port> < / nic> ″;

[0096] private String xmlstr=″ < Port index=\″\″1p=\″\″>”;

[0097] private String xmlStr=″ <nrxconf> <vd1splay> <fiberout>< / fiberout> <usb>< / usb> < / vd1splay> < / nrxconf> ";

[0098] private string xmlstr=″<VDisplay d1s_tp1x=\″\″fps=\″\″> ";.

[0099] From the above examples, it can be seen that by including the protocol string in the intermediate conversion class, the format and meaning of each section of the access protocol in XML format can be reflected in the form of a parent tag, that is, each section of the access protocol is represented directly by the string of the parent tag in a hard-coded manner. At the same time, the file and code segment meaning of the intermediate conversion class are determined with the help of the annotation file of the intermediate conversion class, so that the location where the request parameter is bound in the intermediate conversion class can be quickly determined with the help of the protocol string and the annotation file of the intermediate conversion class, and the request parameter is bound to this location.

[0100] This method greatly shortens the generation time of the request conversion class compared to the reflection method of line-by-line mapping, and further improves the efficiency of interface development.

[0101] Next, the developer uses the compiler in the IDE to compile the intermediate conversion class after binding the request parameters and splice the protocol string into a complete request conversion class. Those skilled in the art should understand that the request parameters in the development stage do not have the calling meaning of the actual application service. At this time, the file compiled after binding the request parameters cannot be directly equated to the request protocol with the actual application service calling meaning. It is only intended to represent the logical relationship of the request protocol when calling the service in the future. Therefore, in this article, in order to distinguish it from the request protocol, it is called a request conversion class.

[0102] In step S2, the development end 200 sends the request conversion class to the subsystem to be accessed (in this example, the subsystem to be accessed is subsystem 300-1) to obtain the response parameters of the subsystem to be accessed, and generates a response conversion class for the subsystem to be accessed to respond to the call of the external server according to the access protocol and response parameters of the subsystem to be accessed.

[0103] After being sent to subsystem 300-1, for the subsystem, because the request conversion class is actually a file that binds the request parameters according to the structural relationship of the interface protocol of the subsystem 300-1, the interface protocol can parse the meaning of the file and generate response parameters. Of course, because the request parameters bound in the request conversion class do not have the actual meaning of the application service call, the response parameters returned by subsystem 300-1 are not specific response protocols for a certain application service. The response parameters are the interface response information of the server represented in an array.

[0104] Optionally, after receiving the response parameters, the parsing plug-in binds the response parameters to the binding positions of the parameters determined in step S1, and compiles and generates the response conversion class. Among them, the intermediate conversion class is still the intermediate conversion class that is not bound to the request parameters after the parsing plug-in parses the access protocol in step S1. After the binding is completed, the developer compiles the intermediate conversion class bound to the corresponding parameters through the compiler to generate a response conversion class. The response conversion class generated by this setting is a file representing the logical structure of the access protocol of subsystem 300-1.

[0105] In step S3, an access file is generated according to the request conversion class and the response conversion class.

[0106] Specifically, the request conversion class and the corresponding conversion class can be packaged by using an IDE to generate an access file. Those skilled in the art can understand that the access file includes a request conversion class bound with request parameters, in which the server 100 calls the subsystem 300-1, and a response conversion class bound with response parameters, in which the subsystem 300-1 responds to the server 100. Because the request conversion class is generated by binding request parameters at the corresponding position of the intermediate conversion class, and the intermediate conversion class is a JavaBean that expresses the hierarchical structure of the access protocol generated on the basis of parsing the access protocol of the subsystem 300-1, the request conversion class is equivalent to forming a Java component that describes its access protocol using a parsing plug-in. Similarly, the response conversion class is equivalent to forming a Java component that describes its access protocol using a parsing plug-in. The access file formed in this way enables the server 100 to read and bind request parameters in the request protocol, and read response parameters in the response protocol, so as to implement the call to the subsystem 300-1.

[0107] In the access development method in the embodiment of the present invention, the client can use the parsing plug-in to automatically parse the access protocol of the subsystem to form an intermediate conversion class with a logical structure representing the hierarchical structure of the access protocol, and bind the request parameters and response parameters respectively in the intermediate conversion class to form an access file, thereby realizing the automatic generation of access files, greatly reducing the workload of developers in developing interfaces, saving labor costs, and improving development efficiency.

[0108] Corresponding to the access development method, an embodiment of the present invention further provides an access development device for implementing the access development method described above, comprising:

[0109] The request conversion module automatically generates a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed;

[0110] A response conversion module generates a response conversion class for the subsystem to be accessed to respond to the external server call according to the access protocol of the subsystem to be accessed and the response parameters received from the subsystem to be accessed; and

[0111] The file generation module generates access files according to the request conversion class and the response conversion class.

[0112] In this embodiment, a request conversion class for the external server to call the subsystem to be accessed is automatically generated according to the request parameters of the external server and the access protocol of the subsystem to be accessed, and a response conversion class is generated according to the access protocol and response parameters of the subsystem to be accessed. Thus, the development end can automatically generate an access file, so that developers no longer need to manually encapsulate complex classes of various subsystems according to the protocol format, which reduces the workload of interface development personnel and reduces the difficulty of development. It greatly improves development efficiency and has broad application prospects.

[0113] On the other hand, the access file generated by the above access development method can be uploaded and stored in the client 200 through the communication between the development end 200 and the server 100, so as to implement the application service method based on multiple subsystem access when the service is called.

[0114] Another embodiment of the present invention provides an application service method based on multiple subsystem access, which is applied to a server, including:

[0115] Generate a request protocol according to the external request and the pre-stored access file and send it to the subsystem to be accessed, the external request including request parameters;

[0116] Obtaining the response value of the subsystem to be accessed, and generating a response protocol according to the access file and the response value, wherein the response value includes response parameters;

[0117] Among them, the access file is generated by the access development method of the embodiment described above.

[0118] In this embodiment, the server can use the access file generated in the above development method to complete the service call of the server to various subsystems. The access file is automatically generated by the client using the parsing plug-in, automatically parsing the access protocol of the subsystem to form an intermediate conversion class representing the logical structure of the hierarchical structure of the access protocol, and binding the request parameters and response parameters to the intermediate conversion class respectively, which reduces the R&D cost of the service call of each subsystem by the server, saves labor costs, and has broad application prospects.

[0119] Hardware system reference for implementing this application service method Figure 7 shown. Figure 7 The hardware architecture of the functional relationship between the application service system implementing the application service method based on multiple subsystem access and multiple subsystems 300-1, 300-2, 300-2, ..., and 300-n is shown.

[0120] The application service system provided by the embodiment of the present invention includes: an application layer 101 for receiving user operations, and an access layer 102 for accessing a subsystem to be accessed, wherein the access layer is configured as follows:

[0121] Generate a request protocol according to an external request of a user operation received by the application layer and a pre-stored access file;

[0122] Generate a response protocol according to the access protocol of the subsystem to be accessed and the response value received from the subsystem to be accessed;

[0123] Complete the access of the subsystem to be accessed according to the response protocol so that the application layer calls the application service of the subsystem to be accessed according to the received user operation,

[0124] Among them, the access file is generated by the access development method described above.

[0125] In this embodiment, the server can complete the service call of the server to various subsystems based on the user operation and the access file generated in the above development method. The access file is automatically generated by the client using the parsing plug-in to automatically parse the access protocol of the subsystem to form an intermediate conversion class of the logical structure representing the hierarchical structure of the access protocol, and the request parameters and response parameters are respectively bound to the intermediate conversion class, which reduces the R&D cost of the service calling each subsystem, saves labor costs, and has broad application prospects.

[0126] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: automatically generating a request conversion class for the external server to call the subsystem to be accessed based on the request parameters of the external server and the access protocol of the subsystem to be accessed; sending the request conversion class to the subsystem to be accessed to obtain the response parameters of the subsystem to be accessed, and generating a response conversion class for the subsystem to be accessed to respond to the call of the external server based on the access protocol and response parameters of the subsystem to be accessed; and generating an access file based on the request conversion class and the response conversion class.

[0127] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: generating a request protocol based on an external request and a pre-stored access file and sending it to the subsystem to be accessed, wherein the external request includes request parameters; obtaining a response value of the subsystem to be accessed, and generating a response protocol based on the access file and the response value, wherein the response value includes response parameters; wherein the access file is generated by the access development method described above.

[0128] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0129] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0130] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0131] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0132] like Figure 8 As shown, a structural schematic diagram of a computer device provided by another embodiment of the present invention. Figure 8 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0133] like Figure 8 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0134] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0135] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0136] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0137] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0138] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Figure 8 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0139] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing an access development method for multiple subsystem access or an application service method based on multiple subsystem access provided by an embodiment of the present invention.

[0140] It should be noted that the sequence of steps of the eye tracking method provided in the embodiment of the present invention can be appropriately adjusted, and the steps can be increased or decreased accordingly according to the circumstances. Any technical personnel familiar with the technical field can easily come up with changes within the technical scope disclosed in this invention, and these changes should be covered within the scope of protection of the present invention, so they will not be described in detail.

[0141] In view of the existing problems, the present invention develops an access development method, device, system, and medium for accessing multiple subsystems, and automatically generates a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed, and generates a response conversion class according to the access protocol and response parameters of the subsystem to be accessed, so that the development end can automatically generate an access file, so that developers no longer need to manually encapsulate the complex classes of various subsystems according to the protocol format, which reduces the workload of developers in developing interfaces, while reducing the development difficulty, greatly improving the development efficiency, and has broad application prospects.

[0142] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the embodiments here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.< / nrxconf>

Claims

1. A method for accessing multiple subsystems, applied to the development end, It is characterized in that include: Automatically generate a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed; Send the request conversion class to the subsystem to be accessed to obtain the response parameters of the subsystem to be accessed, and generate a response conversion class for the subsystem to be accessed to respond to the external server call according to the access protocol of the subsystem to be accessed and the response parameters; Generate an access file according to the request conversion class and the response conversion class, The step of automatically generating a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed further comprises: Parsing the access protocol to generate an intermediate conversion class; Mapping the intermediate conversion class line by line in a reflection manner to determine the location where the request parameter is bound in the intermediate conversion class; and The request parameters are bound to the location and compiled to generate the request conversion class, wherein the step of generating the response conversion class of the subsystem to be accessed in response to the external server call according to the access protocol of the subsystem to be accessed and the response parameters further comprises: The response parameters are bound to the location and compiled to generate the response conversion class.

2. The access development method according to claim 1, It is characterized in that The step of automatically generating a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed further comprises: Parsing the access protocol to generate the intermediate conversion class and an annotation file of the intermediate conversion class, wherein the intermediate conversion class also includes a protocol string, and the protocol string represents a hierarchical structure of the access protocol in the form of a parent tag; Determining the location where the request parameter is to be bound based on the intermediate conversion class using the annotation file; and The request parameters are bound to the location and compiled to generate the request conversion class, wherein the step of automatically generating the request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed further comprises: The response parameters are bound in the location and compiled to generate the response conversion class.

3. The access development method according to claim 1 or 2, It is characterized in that The intermediate conversion class includes a nested hierarchical structure.

4. The access development method according to claim 1 or 2, It is characterized in that The access protocol is parsed based on one of a DOM method, a SAX method, and a STAX method.

5. The access development method according to claim 1, It is characterized in that When the format of the access protocol is JSON format, before automatically generating a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed, the method further includes: The format of the access protocol is converted into XML format.

6. An application service method based on multiple subsystem access, applied to the server, It is characterized in that include: Generate a request protocol according to the service request and the pre-stored access file and send it to the subsystem to be accessed, wherein the service request includes request parameters; Acquire a response value of the subsystem to be accessed, and generate a response protocol according to the access file and the response value, wherein the response value includes a response parameter; Wherein, the access file is generated by the access development method described in any one of claims 1-5.

7. An access development device for implementing the access development method according to any one of claims 1 to 5, It is characterized in that include: A request conversion module, which automatically generates a request conversion class for the external server to call the subsystem to be accessed according to the request parameters of the external server and the access protocol of the subsystem to be accessed; A response conversion module, which generates a response conversion class for the subsystem to be accessed to respond to the external server call according to the access protocol of the subsystem to be accessed and the response parameters received from the subsystem to be accessed; as well as A file generation module generates an access file according to the request conversion class and the response conversion class.

8. An application service system for implementing the application service method according to claim 6, It is characterized in that It includes an application layer for receiving user operations and an access layer for accessing a subsystem to be accessed, wherein the access layer is configured as follows: Generate a request protocol based on an external request generated by a user operation and a pre-stored access file received by the application layer; Generate a response protocol according to the access protocol of the subsystem to be accessed and the response value received from the subsystem to be accessed; completing the access of the subsystem to be accessed according to the response protocol so that the application layer calls the application service of the subsystem to be accessed according to the received user operation, Wherein, the access file is generated by the access development method described in any one of claims 1-5.

9. A computer device, It is characterized in that include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5 or the method according to claim 6.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that in, When the program is executed by a processor, the method according to any one of claims 1 to 5 or the method according to claim 6 is implemented.