CN111367686A - Service interface calling method and device, computer equipment and storage medium - Google Patents
Service interface calling method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111367686A CN111367686A CN202010126824.9A CN202010126824A CN111367686A CN 111367686 A CN111367686 A CN 111367686A CN 202010126824 A CN202010126824 A CN 202010126824A CN 111367686 A CN111367686 A CN 111367686A
- Authority
- CN
- China
- Prior art keywords
- calling
- json
- task type
- json file
- code
- 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
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012544 monitoring process Methods 0.000 claims abstract description 24
- 238000012800 visualization Methods 0.000 claims abstract description 18
- 230000008569 process Effects 0.000 claims description 29
- 238000004590 computer program Methods 0.000 claims description 18
- 238000005516 engineering process Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 11
- 230000002159 abnormal effect Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 6
- 230000006835 compression Effects 0.000 description 5
- 238000007906 compression Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000003780 insertion Methods 0.000 description 4
- 230000037431 insertion Effects 0.000 description 4
- 238000004806 packaging method and process Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000006837 decompression Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- IWEDIXLBFLAXBO-UHFFFAOYSA-N dicamba Chemical compound COC1=C(Cl)C=CC(Cl)=C1C(O)=O IWEDIXLBFLAXBO-UHFFFAOYSA-N 0.000 description 2
- 238000005538 encapsulation Methods 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 238000007639 printing Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a calling method and a calling device of a service interface, computer equipment and a storage medium, wherein the method comprises the following steps: dragging events of a plurality of identifications by monitoring a visualization tool on a page, and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification; storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces, and the code blocks correspond to the service interfaces one by one; storing the JSON file to a system cache region; and calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface. According to the invention, the calling of the service interface is replaced by calling the code component, so that the technical problems that the calling of the service interface is inconvenient and the like due to the complex service logic of the service interface in the related technology are solved.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for calling a service interface, a computer device, and a storage medium.
Background
At present, when a platform on the market is butted with the services of various hospitals or institutions, customized interface development is carried out according to different services of different institutions, once the butted services on the line are changed or abnormal, emergency problems need to be repaired and then the repaired services are redistributed to the line, or when a new institution is accessed, if the service is different from the original service logic, a large amount of manpower needs to be invested again to carry out code customized development, and then the process is repeated; when an abnormal condition occurs and the abnormal problem is monitored by printing several rows of logs, the process of releasing the version is required to be carried out once, and the service is restarted once when the abnormal condition occurs, so that the whole process consumes too long time, and other online services can be influenced by frequently restarting the service; as the accessed business logic becomes more and more complex, the code becomes more difficult to maintain, and a large amount of repeated content exists in the code, which eventually results in that the system cannot be maintained.
Therefore, the related art has the technical problems of difficult code and system maintenance, frequent service restart, increased cost and the like caused by the complexity of business logic when an abnormal condition occurs.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for calling a service interface, computer equipment and a storage medium, which are used for at least solving the technical problems that the service interface is inconvenient to call due to the complex service logic of the service interface in the related technology.
According to an embodiment of the present invention, a method for calling a service interface is provided, including: dragging events of a plurality of identifications by monitoring a visualization tool on a page, and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification; storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces, and the code blocks correspond to the service interfaces one by one; storing the JSON file to a system cache region; and calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface.
Optionally, dragging the events of the multiple identifiers by monitoring a visualization tool on the page, and combining the multiple code components corresponding to the multiple identifiers includes: when an event that a visualization tool drags a plurality of identifiers on a page is monitored, recording the identifiers and the dragging sequence of the identifiers; combining a plurality of component contents of the plurality of code components based on the plurality of identifications and the drag order.
Optionally, combining the plurality of code components corresponding to the plurality of identifiers further includes: receiving a calling request for calling a service interface, wherein the calling request carries a flow identifier, and the flow identifier is used for indicating a dragging sequence of a plurality of identifiers corresponding to the service interface; and combining a plurality of code components corresponding to the plurality of identifications according to the flow identification.
Optionally, combining the plurality of code components corresponding to the plurality of identifiers further includes: receiving a trigger instruction, wherein the trigger instruction carries preset time information and preset frequency information for dragging the multiple identifiers; combining a plurality of code components corresponding to the plurality of identifications according to preset time and preset frequency
Optionally, calling the JSON file in the system cache region based on the task type of the JSON file includes: monitoring a task type of JSON content in the JSON file through a file monitor, wherein the task type comprises a timing task type and a request task type, the timing task type represents a plurality of code components of the service interface combined according to preset time and preset frequency, and the request task type represents a plurality of code components of the service interface combined according to a calling request; and calling the JSON file in the system cache region according to the task type.
Optionally, when the task type is a timing task type, calling the JSON file in the system cache region according to the task type includes: creating a thread, wherein the thread is used for running JSON contents in the JSON file; associating the thread with a timer, wherein the timer is used for timing the starting time of running the thread; and running the thread according to the starting time.
Optionally, when the task type is a request task type, invoking the JSON file in the system cache region according to the task type includes: acquiring a flow identifier carried in the calling request; searching the JSON file in the system cache region according to the process identification; and running the JSON content in the JSON file.
According to an embodiment of the present invention, there is provided a calling device of a service interface, including: the combination module is used for dragging events of a plurality of identifications through a visualization tool on a monitoring page and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification; the first storage module is used for storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces, and the code blocks correspond to the service interfaces one to one; the second storage module is used for storing the JSON file to a system cache region; and the calling module is used for calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface.
Optionally, the combining module includes: the recording unit is used for recording the multiple identifications and the dragging sequence of the multiple identifications when an event that the visualization tool drags the multiple identifications on the page is monitored; a combining unit for combining a plurality of component contents of the plurality of code components based on the plurality of identifications and the drag order.
Optionally, the combining module further includes: the system comprises a first receiving unit, a second receiving unit and a processing unit, wherein the first receiving unit is used for receiving a calling request for calling a service interface, the calling request carries a process identifier, and the process identifier is used for indicating a dragging sequence of a plurality of identifiers corresponding to the service interface; and the first combination unit is used for combining a plurality of code components corresponding to the plurality of identifications according to the process identification.
Optionally, the combining module further includes: the second receiving unit is used for receiving a trigger instruction, wherein the trigger instruction carries preset time information and preset frequency information for dragging the plurality of identifiers; and the second combination unit is used for combining the code components corresponding to the identifiers according to preset time and preset frequency.
Optionally, the invoking module includes: the monitoring unit is used for monitoring task types of JSON contents in the JSON file through a file monitor, wherein the task types comprise a timing task type and a request task type, the timing task type represents a plurality of code components of the service interface combined according to preset time and preset frequency, and the request task type represents a plurality of code components of the service interface combined according to a calling request; and the calling unit is used for calling the JSON file in the system cache region according to the task type.
Optionally, when the task type is a timing task type, the invoking unit includes: a creating subunit, configured to create a thread, where the thread is used to run JSON content in the JSON file; the association subunit is used for associating the thread with a timer, wherein the timer is used for running the starting time of the thread at fixed time; and the first operation subunit is used for operating the thread according to the starting time.
Optionally, when the task type is a request task type, the invoking unit includes: an obtaining subunit, configured to obtain a flow identifier carried in the call request; the searching subunit is used for searching the JSON file in the system cache region according to the process identifier; and the second operation subunit is used for operating the JSON content in the JSON file.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps in any of the apparatus embodiments described above when executed.
According to yet another embodiment of the present invention, there is also provided a computer device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.
According to the method and the device, the plurality of code components of the service interface are configured through the visual tool of the page, the plurality of code components are stored in the code block, the calling of the service interface is replaced by the calling of the code block, a program corresponding to the service interface can be constructed through simple operation of dragging the components, codes do not need to be rewritten, the program is directly called according to the calling request of the service interface, and the technical problems that the calling of the service interface is inconvenient and the like due to complex service logic of the service interface in the related technology are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure in which a method for calling a service interface according to an embodiment of the present invention is applied to a computer terminal;
FIG. 2 is a flow chart of a method for invoking a service interface according to an embodiment of the present invention;
FIG. 3 is a flow diagram of an engine for invoking a business interface provided in accordance with an embodiment of the present invention;
fig. 4 is a block diagram of a calling device of a service interface according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a server, a computer terminal, or a similar computing device. Taking the operation on a computer terminal as an example, fig. 1 is a hardware structure block diagram of a service interface calling method applied to a computer terminal according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the calling methods of the service interfaces in the embodiments of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the methods described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for calling a service interface is provided, and fig. 2 is a flowchart of a method for calling a service interface according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, dragging events of a plurality of identifications by monitoring a visualization tool on a page, and combining a plurality of code components corresponding to the plurality of identifications, wherein each code component corresponds to one identification;
in this embodiment, each code component is identified in the component library by a text or a picture.
Step S204, storing a plurality of code components into code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces, and the code blocks correspond to the service interfaces one to one;
the code blocks in this embodiment all have unique identification numbers, and each code block number corresponds to one service interface.
Step S206, storing the JSON file to a system cache region;
and step S208, calling the JSON file in the system cache region based on the task type of the JSON file so as to realize calling of the service interface.
Through the steps, the plurality of identifications are dragged through the visualization tool of the page, the plurality of code components of the service interface are combined, the JSON file is generated based on the plurality of code components and is stored in the code block, a program corresponding to the service interface can be constructed through simple operation of dragging the components, the code does not need to be rewritten, the program is directly called according to the calling request of the service interface, and the technical problems that the calling of the service interface is inconvenient and the like due to the fact that the service logic of the service interface is complex in the related technology are solved.
In an optional embodiment, dragging a plurality of identified events by listening to a visualization tool on a page, and combining a plurality of code components corresponding to the plurality of identifiers comprises: recording the dragging sequence of the multiple identifications and the dragging sequence of the multiple identifications when monitoring an event that the visualization tool drags the multiple identifications on the page; a plurality of component contents of the plurality of code components are combined based on the plurality of identifications and the drag order.
In this embodiment, the background calls a plurality of code components according to an operation sequence (i.e., the above-mentioned drag sequence) of the front-end user, records the operation sequence, and combines the plurality of code components according to the operation sequence, so as to determine a service logic of the service interface, for example: starting JSON analysis, database insertion and ending; wherein, the 'start' and 'end' are pre-configured general-purpose components, and the 'JSON parsing' and 'database insertion' are code components selected by a user according to requirements.
According to the embodiment, the service logic for determining the service interface is determined by the service scene, and the service scene includes multiple types, for example, a gateway scene, a security gateway scene, a message compression scene, data format conversion, JSON and XML format interconversion, data reception and storage, data import and export between tables, network monitoring, and the like.
Wherein, the service logic corresponding to the service scene at least comprises:
(1) in the gateway scenario, the corresponding service logic is: the pure forwarding of the data is realized without any processing;
(2) in the security gateway scenario, the corresponding service logic is: encrypting the data; forwarding the encrypted data; receiving return data; decrypting the returned data and responding to the request;
(3) in a message compression scenario, the corresponding service logic is as follows: compressing the data; forwarding the compressed data; receiving return data; decompressing the returned data and responding to the request;
(4) and (3) converting the data format, wherein the corresponding service logic is as follows: the JSON file in one JSON format can be converted into a JSON file in another JSON format; or, data in one XML format may be converted into data in another XML format;
(5) the JSON and XML formats are mutually converted, and the corresponding business logic is as follows: the XML format data can be converted into JSON format data, and the JSON format data can also be converted into XML format data;
(6) receiving data and storing the data in a warehouse, wherein the corresponding business logic is as follows: analyzing the received data by a message, and then falling into a specified database;
(7) and importing and exporting data between tables, wherein the corresponding business logic is as follows: taking out data from one database table and falling into another database table;
(8) network monitoring, the corresponding business logic is: and monitoring whether the network is unblocked.
Before calling the code components, the approximate function of each component is determined, for example, a JSON encapsulation component is used for encapsulating irregular data into a JSON string in a target format, a decision component is used for carrying out condition judgment, a database component is used for executing a DML script, after understanding of the bases, the actual service is combined to judge whether the service contains the actions, and if so, the corresponding component is required to be used.
The code components in this embodiment include at least: functional components, flow components, common functions, and the like;
optionally, the functional components at least include: case parsing, mail packaging, list matching, class (class file) calling, http sending, log printing, assignment component, encryption/decryption, signature/signature verification, JSON parsing, JSON packaging, database insertion, database modification, database query, storage process calling, message compression, message decompression, xml packaging, xml parsing, separator packaging, separator parsing, exception throwing and thread sleeping;
optionally, the flow component at least includes: calling a process, traversing Map, a dowile loop, a whileDo loop, a loop List (List), a decision, a while loop and exception capture;
optionally, the common functions at least include: character string interception, splitting, character string type number addition, subtraction, multiplication, division, date formatting, numerical value formatting, telnet (remote terminal protocol), ping (internet packet explorer).
(1) Gateway scenario: start > > send http > > end;
(2) security gateway scenario: start > > encrypt component > > send http > > decrypt component > > end;
(3) message compression scenario: start > > message compression > > send http > > message decompression > > end;
(4) data format conversion:
start > > JSON parse > > JSON encapsulate > > end;
start > > xml parse > > xml package > > end;
(5) the JSON and XML formats are converted into each other:
start > > JSON parse > > xml package > > end;
start > > xml parsing > > JSON encapsulation > > end;
(6) receiving data and storing the data in a warehouse: start > > JSON parse > > database insert > > end;
(7) data import and export between tables: start > > database query > > database insertion > > end;
(8) network monitoring start > > decision component (configure telnet function) > > end.
In this embodiment, each functional component and each process component have respective unique types, the corresponding types are stored in the JSON file produced by the drag process according to the drag sequence, and when the Pandora engine executes, which type is encountered will call the corresponding code block; meanwhile, the Pandora engine also integrates an open-source Aviator (a high-performance and lightweight java-based expression engine) expression. For example, when a decision component is configured, a condition for determination needs to be configured, and a common function, for example, count (list) >0, is used for all the determination conditions, and when a Pandora engine runs the decision component, a code block inside the decision component executes the condition using an Aviator expression, so that the effect of using the function is achieved.
In an optional embodiment, saving the plurality of code components to the code block to obtain the JSON file in the JSON format includes: and respectively storing the component content corresponding to each code component to the code block according to the combination sequence of the plurality of code components.
In this embodiment, each functional component or flow component has its own type, the finally generated JSON file stores the corresponding component content according to the configuration sequence of each component on the page, and when running in the background, which type is encountered will call a method of the specified type. Through visual dragging components on a page, each component used for dragging is a basic unit forming a program, and after the components are dragged and combined, a program is constructed, various simple functions are dragged, and codes do not need to be written.
In an optional embodiment, combining the plurality of code components corresponding to the plurality of identities further comprises: receiving a calling request for calling a service interface, wherein the calling request carries a flow identifier, and the flow identifier is used for indicating a dragging sequence of a plurality of identifiers corresponding to the service interface; and combining a plurality of code components corresponding to the plurality of identifications according to the flow identification.
In another optional embodiment, combining the plurality of code components corresponding to the plurality of identities further comprises: receiving a trigger instruction, wherein the trigger instruction carries preset time information and preset frequency information for dragging a plurality of identifiers; and combining a plurality of code components corresponding to the plurality of identifications according to the preset time and the preset frequency.
In this embodiment, the assembly includes at least two types of flow modes: one is an external call internal type, and the flow of the type does not actively run, but is in a state of waiting to be called, and once an external system calls (namely, receives a call request), the flow is run; the other type is a timing task type, specific time and frequency for starting the timing task need to be configured, and after the configuration is completed, the engine can receive a trigger instruction according to the configured time and frequency and then automatically run the process.
Optionally, calling the JSON file in the system cache region based on the task type of the JSON file includes: monitoring task types of JSON contents in a JSON file through a file monitor, wherein the task types comprise a timing task type and a request task type, the timing task type represents a plurality of code components of a service interface combined according to preset time and preset frequency, and the request task type represents a plurality of code components of a service interface combined according to a call request; and calling the JSON file in the system cache region according to the task type.
According to the embodiment, after the JSON file is saved in the code block, the Pandora engine monitors the task type of the JSON content: if the starting configuration process is to combine a plurality of code components of the service interface according to the preset time and the preset sequence, the task type of the code block is a timing task type; if the configuration flow is started by combining a plurality of code components of the service interface according to the received external call request, the task type of the code block is the request type (namely the called-out internal type).
The method comprises the steps that after a JSON file is stored, the JSON file can be captured by a file monitoring function in a Pandora engine, JSON content corresponding to a code block can be stored in a cache region after the JSON file is captured, the corresponding content in the cache can be updated in real time when the file changes, wherein the flow of the type of a timing task can be added into a timer, the timer monitors whether the starting time of the timing task is up, and if the starting time is up, the timing task is automatically started.
Optionally, when the task type is a timing task type, the invoking the JSON file in the system cache region according to the task type includes: creating a thread, wherein the thread is used for operating JSON content in the JSON file; associating the thread with a timer, wherein the timer is used for timing the starting time of the running thread; and running the thread according to the starting time.
In this embodiment, the Pandora engine includes a file listener, and when the timed task type configures the component automatically and timely, the component is dragged by the front end to form a JSON file and the JSON file is saved, the JSON file is monitored by the listener; the file listener judges whether the task type of the JSON content in the JSON file is a timing task type, if so, a new thread (the thread is responsible for running the JSON content) is created, then the thread is put into a timer, the binding of the thread and the timer is realized, and the timer can automatically start the thread according to the designated time.
Optionally, the calling the JSON file in the system cache region according to the call request of the service interface includes: when the task type is a request task type, calling the JSON file in the system cache region according to the task type comprises the following steps: acquiring a flow identifier carried in a calling request; searching a JSON file in a system cache region according to the process identifier; and executing the JSON content in the JSON file.
In the scheme, time configured by a user (namely the preset time) is finally stored in a JSON file and is obtained by reading the JSON file, the process content is the type, parameters and the like of a corresponding component stored after a page is dragged by the component, namely the content in the JSON file, and the process ID (namely the process identifier) is used for marking a unique process, namely a program.
The timer in the Pandora engine automatically runs the process according to the time configured by the user or is triggered according to the call request of the service interface, and the running process content is acquired in the cache region according to the process ID. When a request enters, the engine acquires the flow content corresponding to the ID from the cache region according to the parameter flow ID attached to the request to perform code operation.
In an optional example of this embodiment, ID of JSON content is a unique ID of a process, that is, a process ID seen on a page, type is a type used to mark a process, a process of a sample is an in-callout type, component is a component type dragged by a mark user, and a component in the sample is a log component dragged. For example:
fig. 3 is an engine flow chart for calling a service interface according to a specific embodiment of the present invention, as shown in fig. 3, various simple functions are dragged out by a visual dragging component on a page, a JSON file is generated and stored in a code block, and then stored in a system cache region, a Pandora engine directly obtains and runs JSON content from the system cache region, and further completes corresponding service logic, and a code does not need to be written, and if the service logic changes or there is an abnormal situation, a configured flow can be directly adjusted, and after the flow is created by Pandora, a service restart is not needed, and the page can be timely validated after deployment.
Example 2
In this embodiment, a service interface invoking device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, which have already been described and are not described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a structure of a calling apparatus of a service interface according to an embodiment of the present invention, and as shown in fig. 4, a combining module 40 is configured to combine multiple code components corresponding to multiple identifiers by dragging events of the multiple identifiers through a visualization tool on a monitoring page, where each code component corresponds to one identifier; a first storage module 42, connected to the combination module 40, configured to store a plurality of code components into code blocks, so as to obtain a JSON file in a JSON format, where the code blocks are used to implement call of service interfaces, and the code blocks correspond to the service interfaces one to one; a second storage module 44, connected to the first storage module 42, for storing the JSON file in the system cache region; and the calling module 46 is connected to the second storage module 44, and is configured to call the JSON file in the system cache region based on the task type of the JSON file, so as to implement calling of the service interface.
Optionally, the combining module 40 includes: the recording unit is used for recording the dragging sequence of the multiple identifications and the multiple identifications when monitoring an event that the visualization tool drags the multiple identifications on the page; a combining unit for combining a plurality of component contents of the plurality of code components based on the plurality of identifications and the drag order.
Optionally, the combining module 40 further includes: the first receiving unit is used for receiving a calling request for calling the service interface, wherein the calling request carries a flow identifier, and the flow identifier is used for indicating the dragging sequence of a plurality of identifiers corresponding to the service interface; and the first combination unit is used for combining a plurality of code components corresponding to the plurality of identifications according to the process identification.
Optionally, the combining module 40 further includes: the second receiving unit is used for receiving a trigger instruction, wherein the trigger instruction carries preset time information and preset frequency information for dragging a plurality of identifiers; and the second combination unit is used for combining a plurality of code components corresponding to the plurality of identifications according to the preset time and the preset frequency.
Optionally, the invoking module 46 includes: the monitoring unit is used for monitoring task types of JSON contents in the JSON file through the file monitor, wherein the task types comprise a timing task type and a request task type, the timing task type represents a plurality of code components of a service interface combined according to preset time and preset frequency, and the request task type represents a plurality of code components of a service interface combined according to a call request; and the calling unit is used for calling the JSON file in the system cache region according to the task type.
Optionally, when the task type is a timing task type, the invoking unit includes: the creating subunit is used for creating a thread, wherein the thread is used for operating JSON contents in the JSON file; the association subunit is used for associating the thread with a timer, wherein the timer is used for timing the starting time of the running thread; and the first operation subunit is used for operating the thread according to the starting time.
Optionally, when the task type is a request task type, the invoking unit includes: the acquiring subunit is used for acquiring the flow identifier carried in the calling request; the searching subunit is used for searching the JSON file in the system cache region according to the process identifier; and the second operation subunit is used for operating the JSON content in the JSON file.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, dragging events of a plurality of identifications through a visualization tool on a monitoring page, and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification;
s2, storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces and correspond to the service interfaces one by one;
s3, storing the JSON file to a system cache region;
and S4, calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, dragging events of a plurality of identifications through a visualization tool on a monitoring page, and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification;
s2, storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces and correspond to the service interfaces one by one;
s3, storing the JSON file to a system cache region;
and S4, calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for calling a service interface, comprising:
dragging events of a plurality of identifications by monitoring a visualization tool on a page, and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification;
storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces, and the code blocks correspond to the service interfaces one by one;
storing the JSON file to a system cache region;
and calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface.
2. The method of claim 1, wherein the combining the plurality of code components corresponding to the plurality of identifiers by listening for events for which a visualization tool on a page drags the plurality of identifiers comprises:
when an event that a visualization tool drags a plurality of identifiers on a page is monitored, recording the identifiers and the dragging sequence of the identifiers;
combining a plurality of component contents of the plurality of code components based on the plurality of identifications and the drag order.
3. The method of claim 1, wherein combining the plurality of identified corresponding plurality of code components further comprises:
receiving a calling request for calling a service interface, wherein the calling request carries a flow identifier, and the flow identifier is used for indicating a dragging sequence of a plurality of identifiers corresponding to the service interface;
and combining a plurality of code components corresponding to the plurality of identifications according to the flow identification.
4. The method of claim 1, wherein combining the plurality of identified corresponding plurality of code components further comprises:
receiving a trigger instruction, wherein the trigger instruction carries preset time information and preset frequency information for dragging the multiple identifiers;
and combining a plurality of code components corresponding to the plurality of identifications according to preset time and preset frequency.
5. The method of claim 1, wherein invoking the JSON file in the system cache based on the task type of the JSON file comprises:
monitoring a task type of JSON content in the JSON file through a file monitor, wherein the task type comprises a timing task type and a request task type, the timing task type represents a plurality of code components of the service interface combined according to preset time and preset frequency, and the request task type represents a plurality of code components of the service interface combined according to a calling request;
and calling the JSON file in the system cache region according to the task type.
6. The method according to claim 5, wherein when the task type is a timed task type, calling the JSON file in the system cache according to the task type comprises:
creating a thread, wherein the thread is used for running JSON contents in the JSON file;
associating the thread with a timer, wherein the timer is used for timing the starting time of running the thread;
and running the thread according to the starting time.
7. The method according to claim 5, wherein when the task type is a request task type, calling the JSON file in the system cache region according to the task type comprises:
acquiring a flow identifier carried in the calling request;
searching the JSON file in the system cache region according to the process identification;
and running the JSON content in the JSON file.
8. An apparatus for invoking a service interface, comprising:
the combination module is used for dragging events of a plurality of identifications through a visualization tool on a monitoring page and combining a plurality of code components corresponding to the identifications, wherein each code component corresponds to one identification;
the first storage module is used for storing the code components to code blocks to obtain a JSON file in a JSON format, wherein the code blocks are used for realizing calling of service interfaces, and the code blocks correspond to the service interfaces one to one;
the second storage module is used for storing the JSON file to a system cache region;
and the calling module is used for calling the JSON file in the system cache region based on the task type of the JSON file so as to realize the calling of the service interface.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer storage medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010126824.9A CN111367686A (en) | 2020-02-28 | 2020-02-28 | Service interface calling method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010126824.9A CN111367686A (en) | 2020-02-28 | 2020-02-28 | Service interface calling method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111367686A true CN111367686A (en) | 2020-07-03 |
Family
ID=71210046
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010126824.9A Pending CN111367686A (en) | 2020-02-28 | 2020-02-28 | Service interface calling method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111367686A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113031947A (en) * | 2021-03-05 | 2021-06-25 | 苏州帝博信息技术有限公司 | Configuration data management method and device used in interface design tool |
CN117312117A (en) * | 2023-11-30 | 2023-12-29 | 沐曦集成电路(杭州)有限公司 | Dotting data processing method, dotting data processing device, dotting data processing equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103870260A (en) * | 2012-12-14 | 2014-06-18 | 腾讯科技(深圳)有限公司 | Method and system for service interface development |
CN105988815A (en) * | 2015-03-04 | 2016-10-05 | 银联商务有限公司 | Business process development method and system |
CN106445556A (en) * | 2016-10-18 | 2017-02-22 | 中国银行股份有限公司 | Visualized code generation method and system thereof |
CN109508191A (en) * | 2018-11-22 | 2019-03-22 | 北京腾云天下科技有限公司 | A kind of code generating method and system |
-
2020
- 2020-02-28 CN CN202010126824.9A patent/CN111367686A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103870260A (en) * | 2012-12-14 | 2014-06-18 | 腾讯科技(深圳)有限公司 | Method and system for service interface development |
CN105988815A (en) * | 2015-03-04 | 2016-10-05 | 银联商务有限公司 | Business process development method and system |
CN106445556A (en) * | 2016-10-18 | 2017-02-22 | 中国银行股份有限公司 | Visualized code generation method and system thereof |
CN109508191A (en) * | 2018-11-22 | 2019-03-22 | 北京腾云天下科技有限公司 | A kind of code generating method and system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113031947A (en) * | 2021-03-05 | 2021-06-25 | 苏州帝博信息技术有限公司 | Configuration data management method and device used in interface design tool |
CN117312117A (en) * | 2023-11-30 | 2023-12-29 | 沐曦集成电路(杭州)有限公司 | Dotting data processing method, dotting data processing device, dotting data processing equipment and medium |
CN117312117B (en) * | 2023-11-30 | 2024-03-01 | 沐曦集成电路(杭州)有限公司 | Dotting data processing method, dotting data processing device, dotting data processing equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107704360B (en) | Monitoring data processing method, equipment, server and storage medium | |
CN111414416B (en) | Data processing method, device, equipment and storage medium | |
WO2017101606A1 (en) | System and method for collecting and analyzing data | |
CN108400909B (en) | Traffic statistical method, device, terminal equipment and storage medium | |
US8938534B2 (en) | Automatic provisioning of new users of interest for capture on a communication network | |
WO2020248375A1 (en) | Method and system for synchronizing data between databases, computer device and storage medium | |
CN111400127B (en) | Service log monitoring method and device, storage medium and computer equipment | |
CN112714047A (en) | Industrial control protocol flow based test method, device, equipment and storage medium | |
CN112434039A (en) | Data storage method, device, storage medium and electronic device | |
CN113553310B (en) | Data acquisition method and device, storage medium and electronic equipment | |
CN110932918B (en) | Log data acquisition method and device and storage medium | |
CN103546343A (en) | Network flow display method and system for network flow analyzing systems | |
CN110858192A (en) | Log query method and system, log checking system and query terminal | |
CN111367686A (en) | Service interface calling method and device, computer equipment and storage medium | |
CN111818041B (en) | Real-time message processing system and method based on network layer message analysis | |
CN112017007A (en) | User behavior data processing method and device, computer equipment and storage medium | |
CN109783330B (en) | Log processing method, log display method, and related device and system | |
FI124815B (en) | Processing of call data records | |
CN108833500B (en) | Service calling method, service providing method, data transmission method and server | |
CN113434742A (en) | Account screening method and device, storage medium and electronic device | |
CN108228417A (en) | Car networking log processing method and processing unit | |
CN111741007A (en) | Financial business real-time monitoring system and method based on network layer message analysis | |
CN111818154B (en) | Service pushing system and method based on network layer message analysis | |
CN116260742A (en) | Signaling capturing method and device, nonvolatile storage medium and electronic equipment | |
CN115510012A (en) | Service data processing method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220525 Address after: 518000 China Aviation Center 2901, No. 1018, Huafu Road, Huahang community, Huaqiang North Street, Futian District, Shenzhen, Guangdong Province Applicant after: Shenzhen Ping An medical and Health Technology Service Co.,Ltd. Address before: Room 12G, Area H, 666 Beijing East Road, Huangpu District, Shanghai 200001 Applicant before: PING AN MEDICAL AND HEALTHCARE MANAGEMENT Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200703 |