CN116521279A - Service calling method, service generating method, device, equipment and medium - Google Patents
Service calling method, service generating method, device, equipment and medium Download PDFInfo
- Publication number
- CN116521279A CN116521279A CN202310474604.9A CN202310474604A CN116521279A CN 116521279 A CN116521279 A CN 116521279A CN 202310474604 A CN202310474604 A CN 202310474604A CN 116521279 A CN116521279 A CN 116521279A
- Authority
- CN
- China
- Prior art keywords
- service
- target
- calling
- interface
- instruction
- 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 77
- 230000006870 function Effects 0.000 claims description 48
- 239000012634 fragment Substances 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 16
- 238000004891 communication Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 239000011230 binding agent Substances 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000008571 general function Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
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/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a service calling method, a service generating method, a device, equipment and a medium. The service calling method comprises the following steps: receiving a service call instruction sent by an application program through a client in a general service framework unit; acquiring service calling interface identification information from a service calling instruction through a client, and sending the service calling interface identification information to a server in the universal service framework unit; receiving the service calling interface identification information through the service end, and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces; and calling the target service interface through the service end to realize the service provided by the target service interface. By the technical scheme, the generation and the calling of the newly added service in the application program can be realized, and the service development and the calling efficiency of the application program are improved.
Description
Technical Field
The present invention relates to the field of application services, and in particular, to a service calling method, a service generating method, a device, equipment, and a medium.
Background
The hong Mongolian operating system is a brand new full-scene-oriented distributed operating system, organically connects people, equipment and scenes together, and provides scene experience by using proper equipment.
In the prior art, when generating and calling a new service of an application program based on the whole architecture of a hong-involved operating system, the whole architecture of the hong-involved operating system is generally required to be encoded and called through JS (javascript) > NAPI (new application program interface, application programming interface) > PROXY (lightweight distributed application framework) > SERVER) > driver- > kernel, wherein JS, NAPI are application processes, PROXY and SERVER are system service functions, and in general, PROXY is opened by an application in the form of a dynamic library, and is communicated between PROXY and SERVER through a binder mechanism, so that a set of PROXY and SERVER applicable to the new service needs to be written for each new system service of the application program to realize the generation and calling of the new service of the application program.
The inventors have found that the following problems exist in the prior art in the process of implementing the present invention: the eventhandle (event handler), IPC (Inter-Process Communication ), SA (Standalone Access, independent access) processing parts contained in PROXY and SERVER are similar in each system service. Because each newly added system service needs to re-edit a set of PROXY and SERVER when the system service is newly added, the similar parts of the PROXY and SERVER increase codes by a plurality of repeated parts, which is not beneficial to the development and the call of the newly added service of the system service logic.
Disclosure of Invention
The invention provides a service calling method, a service generating method, a device, equipment and a medium, which can reduce the development difficulty of generating a new service in an application program and the calling difficulty of calling the new service, simplify the service development and calling processes and improve the service development efficiency of the application program.
In a first aspect, the present invention provides a service invocation method performed by a generic service framework unit configured in a hong-Meng operating system, the generic service framework unit implemented using a client-server architecture, the method comprising:
receiving a service call instruction sent by an application program through a client in a general service framework unit;
acquiring service calling interface identification information from the service calling instruction through the client, and sending the service calling interface identification information to a server in the universal service framework unit;
receiving the service calling interface identification information through the service end, and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces;
and calling the target service interface through the service end to realize the service provided by the target service interface.
In a second aspect, the present invention provides a service generation method performed by a generic service framework unit configured in a hong-Meng operating system, the generic service framework unit implemented using a client-server architecture, the method comprising:
receiving a target configuration instruction of target service through a client in a general service frame unit, and sending the target configuration instruction to a server in the general service frame unit; the target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service;
matching dynamic configuration logic in a target configuration instruction with a pre-configured dynamic library through the server to obtain each bottom logic segment corresponding to the dynamic configuration logic;
and the service end is used for assembling and generating the target service based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and locally storing a service call interface matched with the target service.
In a third aspect, the present invention provides a service invocation apparatus for execution by a generic service framework unit deployed in a hong-Meng operating system, the generic service framework unit implemented using a client-server architecture, the apparatus comprising:
The service calling instruction receiving module is used for receiving a service calling instruction sent by an application program through a client in the universal service framework unit;
the interface identification information sending module is used for obtaining service calling interface identification information from the service calling instruction through the client and sending the service calling interface identification information to the service end in the universal service framework unit;
the target service interface acquisition module is used for receiving the service calling interface identification information through the service end and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces;
and the interface calling module is used for calling the target service interface through the service end so as to realize the service provided by the target service interface.
In a fourth aspect, the present invention provides a service generation apparatus for execution by a generic service framework unit deployed in a hong-Meng operating system, the generic service framework unit implemented using a client-server architecture, the apparatus comprising:
the target configuration instruction receiving module is used for receiving a target configuration instruction of target service through a client in the universal service frame unit and sending the target configuration instruction to a server in the universal service frame unit; the target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service;
The logic segment acquisition module is used for matching the dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library through the server to acquire each bottom logic segment corresponding to the dynamic configuration logic;
and the target service generation module is used for generating the target service by assembling the server based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and locally storing a service call interface matched with the target service.
In a fifth aspect, the present invention provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the service invocation method and the service generation method according to any of the embodiments of the present invention.
In a sixth aspect, the present invention provides a computer readable storage medium storing computer instructions for implementing the service invocation method and the service generation method according to any of the embodiments of the present invention when executed by a processor.
According to the technical scheme, a client in the general service frame unit receives a service call instruction sent by an application program, service call interface identification information is obtained in the service call instruction through the client, then the service call interface identification information is sent to a service end in the general service frame unit, service call interface identification information is received through the service end, finally a target service interface matched with the service call interface identification information is obtained in all currently stored service call interfaces, the service end calls the target service interface, and the client in the general service frame unit receives a target configuration instruction for the target service, and sends the target configuration instruction to the service end in the general service frame unit, dynamic configuration logic in the target configuration instruction is matched with a pre-configured dynamic library through the service end, each bottom logic fragment corresponding to the dynamic configuration logic is obtained, finally the service end is used for generating the target service based on each bottom logic fragment, the dynamic configuration logic and the target configuration function, the service call interface matched with the target service is stored locally, the generation and call of the new service in the application program are realized, the difficulty of generating and calling the new service in the application program is reduced, the development of the new service and the development of the application program is improved, and the service development difficulty of the new service is increased.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a service invocation method provided according to a first embodiment of the present invention;
FIG. 2a is a flow chart of a service generation method applicable according to a second embodiment of the present invention;
FIG. 2b is a schematic diagram of a service generation method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a service calling device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a service generating apparatus according to a fourth embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an electronic device implementing a service invocation method and a service generation method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a service calling method according to an embodiment of the present invention, where the method may be applied to a case of calling a service of an application program, and the method may be performed by a generic service framework unit configured in a hong-and-Monte operating system, where the generic service framework unit is implemented by a client-server architecture, and the service framework unit may be implemented in hardware and/or software, and the service framework unit may be configured in a terminal or a server having a hong-and-Monte operating system architecture. As shown in fig. 1, the method includes:
s110, receiving a service call instruction sent by an application program through a client in the universal service framework unit.
The general service framework consists of a client and a server; further, the client of the generic service framework may be a lightweight distributed application framework, which is used to perform other operations that the application program cannot directly perform, i.e. by receiving and analyzing a service call instruction, the application program is assisted to complete a service function that matches the service call instruction.
The application program comprises a terminal program which can be compatible with a hong Mongolian operating system and can complete certain or more specific works, and the terminal program runs in a user mode, can interact with a user and has a visual user interface.
Further, the service calling instruction is an instruction which is generated by interaction with an application program by a user and can call a specific service; further, the service call instruction is a C++ format instruction; specifically, after a user interacts with an application program to generate a service calling instruction for calling a specific service, the service calling instruction is firstly sent to the NAPI, and the NAPI forwards the service calling instruction to a client in the universal service framework unit to call the specific service.
In this embodiment, the application may be used to invoke a plurality of application services that match the application; for example, if the application program is an e-book reader, the application service matched with the application program may be e-book reading, reading background replacement, reading brightness adjustment, and the like.
S120, acquiring service calling interface identification information from the service calling instruction through the client, and sending the service calling interface identification information to the server in the universal service framework unit.
The interfaces can be reference types and other types of implementation interfaces which define agreements so as to ensure that the interfaces support certain operations, namely, the interfaces can be called to support the application program to complete the service matched with the service call instruction.
Wherein the service invocation interface may be for: the service calling interface is called to complete the application service corresponding to the service calling interface; further, the service call interface identification information may be used to identify which of the matched service call interfaces the service needs to call to complete its function; for example, if the call interface identification information included in the service call instruction is port No. 3, that is, the specific service matched with the service call instruction needs to call port No. 3 to be completed.
Note that in this embodiment, the client has only a function of acquiring a service call interface identification information in the service call instruction, and does not have a function of calling a corresponding interface with respect to the content of the service call interface identification information.
S130, receiving the service calling interface identification information through the service end, and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces.
The service calling interface stores edited target service; further, the target service can be operated by calling the service calling interface.
Further, each service call interface is provided with an interface number matched with each service call interface; specifically, the server side can acquire a target service interface matched with the service calling interface identification information through the interface number in the received calling interface identification information, and call the target service interface.
S140, calling the target service interface through the service end to realize the service provided by the target service interface.
The service end calls the target service interface to further enable the target service interface to operate so as to achieve the service provided by the target service interface.
In this embodiment, after the target service interface is called by the server, the method further includes: acquiring a service interface calling result matched with the target service interface through the service end; sending the service interface calling result to the client through the server; and feeding back the service interface calling result to the application program which sends the service calling instruction through the client.
Wherein, the interface calling result may include: interface call success results and interface call failure results; in this embodiment, if the service end calls the target service interface successfully, that is, the current application program can complete the service matched with the service call instruction, the service end generates an interface call result with the content being the interface call success, and transmits the interface call result to the client end in the universal service framework unit through communication connection, and then the client end feeds back the information content of the "interface call success" to the application program sending the service call instruction through communication connection to display, so that a user can conveniently obtain the result provided by the service of the application program in real time.
According to the technical scheme, the client in the general service framework unit receives the service calling instruction sent by the application program, the client obtains the service calling interface identification information in the service calling instruction, then the service calling interface identification information is sent to the service end in the general service framework unit, the service end receives the service calling interface identification information, finally the target service interface matched with the service calling interface identification information is obtained in all currently stored service calling interfaces, and the service end calls the target service interface, so that the calling of the service in the application program is realized, the calling difficulty of the service in the application program is reduced, the service calling process is simplified, and the service calling efficiency of the application program is improved.
Example two
Fig. 2a is a flowchart of a service generation method according to a second embodiment of the present invention, where the method may be applied to a case of generating a new service of an application program, and the method may be performed by a generic service framework unit configured in a hong-mo operating system, where the generic service framework unit is implemented by a client-server architecture, and the service framework unit may be implemented in a form of hardware and/or software, and the service framework unit may be configured in a terminal or a server having a hong operating system architecture. As shown in fig. 2, the method includes:
Accordingly, as shown in fig. 2a, the method comprises:
s210, receiving a target configuration instruction of a target service through a client in a general service framework unit, and sending the target configuration instruction to a server in the general service framework unit.
The target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service; specifically, the target configuration instruction is a C++ format instruction obtained by translating the application program through a native application program interface NAPI module based on JavaScript.
In this embodiment, the target service may be a service that a developer wants to add to the application program; further, the dynamic configuration logic may be a logic configuration that the application program needs to perform when the target service is running; for example, taking the target service as an example of modifying the background of the electronic book, the dynamic configuration logic may perform other operations for an electronic book application program to open-enter a program-open a setting interface-open a background setting interface-select a background picture-save an application setting-close a setting interface; in this embodiment, since the target service is to modify the e-book background, the "open background setting interface-select background picture-save application setting" in the dynamic logic configuration may be a main operation for implementing the target service, and the operations such as opening, entering a program, and opening a setting interface of an application program may be a general service, that is, the service needs to be performed during the current completion of the target service, and other operations, such as adjusting the brightness of an e-book backlight, need to be performed when the service is completed, where the general service has no running specificity when the application program is performed, so in this embodiment, in order to avoid a situation that the codes caused by frequent codes related to the general service are repeated, the general service is manually edited in the target configuration instruction in the form of dynamic configuration logic, and the specific service existing for a certain added specific function is manually edited in the target configuration instruction in the form of the target configuration function.
Further, the target configuration function is a function for realizing a function corresponding to the target configuration instruction.
The target configuration function is a complete programming function statement in the C++ language, and the programming function statement can complete a certain service capability when the target configuration function runs independently.
S220, matching the dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library through the server to obtain each bottom logic segment corresponding to the dynamic configuration logic.
Wherein the dynamic library is pre-stored with at least one underlying logical fragment with a signature.
In this embodiment, the dynamic library may be a dynamic name library, which is one of the most common files under Linux; further, when the application program runs, the dynamic name library copies codes required by the running of the target service corresponding to the application program into the corresponding memory.
Further, each bottom logic segment is a coding function capable of completing each general service; the signature of the bottom logic fragment can be a storage address of the corresponding bottom logic fragment in a dynamic name library; when needing to be noted, in the embodiment, each bottom logic fragment stored in the dynamic library is a coding function which is manually edited and stored in advance; further, the encoding function may be an encoding function corresponding to an existing general function of the application program, or may be an encoding function corresponding to an application extension service newly added by a subsequent developer.
S230, assembling and generating the target service through the server based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and locally storing a service call interface matched with the target service.
In this embodiment, because the signature of the bottom layer logic segment has uniqueness, each bottom layer logic segment corresponding to the dynamic configuration logic can be obtained according to each segment signature stored in the dynamic configuration logic. The server side assembles and generates the target service based on the bottom logic fragments, the dynamic configuration logic and the target configuration function; for example, if the content included in the dynamic logic configuration is S1-S2-target configuration function-S3-S4, the server side invokes the dynamic library, invokes the coding functions stored in the storage addresses of S1, S2, S3 and S4 in the dynamic library, assembles each coding function fragment with the pre-configured target configuration function according to the sequential relationship of each coding function in the dynamic configuration logic, and generates the target service matched with the target configuration instruction.
As shown in fig. 2b, in one specific implementation manner of this embodiment, a developer encodes, through JavaScript encoding, a target service and an operation logic of the target service to generate a pre-target configuration instruction, then translates the pre-target configuration instruction into a target configuration instruction in a c++ language form through a NAPI module, and sends the target configuration instruction to a client in the generic service framework unit, the client identifies the target configuration instruction and sends the target configuration instruction to a server in the generic service framework unit, and then matches, through the server, dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library to obtain each bottom logic segment corresponding to the dynamic configuration logic, and assembles each bottom logic segment with the target configuration function based on a sequential relationship of each encoding function in the dynamic configuration logic, so as to finally obtain a target service with complete service processing logic.
According to the technical scheme, the client side in the general service framework unit receives the target configuration instruction of the target service, and sends the target configuration instruction to the server side in the general service framework unit, then the server side matches dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library to obtain each bottom logic segment corresponding to the dynamic configuration logic, finally the server side assembles and generates the target service based on each bottom logic segment, the dynamic configuration logic and the target configuration function, and locally stores a service calling interface matched with the target service, so that the generation of the new service in the application program is realized, the development difficulty of the new service generated in the application program is reduced, the service development flow is simplified, and the service development efficiency of the application program is improved.
Example III
Fig. 3 is a schematic structural diagram of a service invocation device according to a third embodiment of the present invention, which is implemented by a generic service framework unit configured in a hong-and-Monte operating system, wherein the generic service framework unit is implemented by a client-server architecture.
As shown in fig. 3, the apparatus includes:
a service call instruction receiving module 310, configured to receive a service call instruction sent by an application program through a client in a generic service framework unit;
The interface identification information sending module 320 is configured to obtain, by using the client, service call interface identification information in the service call instruction, and send the service call interface identification information to a server in the generic service framework unit;
the target service interface obtaining module 330 is configured to receive the service call interface identification information through the server, and obtain, from all currently stored service call interfaces, a target service interface that matches the service call interface identification information;
and the interface calling module 340 is configured to call the target service interface through the service end, so as to implement a service provided by the target service interface.
According to the technical scheme, the client in the general service framework unit receives the service calling instruction sent by the application program, the client obtains the service calling interface identification information in the service calling instruction, then the service calling interface identification information is sent to the service end in the general service framework unit, the service end receives the service calling interface identification information, finally the target service interface matched with the service calling interface identification information is obtained in all currently stored service calling interfaces, and the service end calls the target service interface, so that the calling of the service in the application program is realized, the calling difficulty of the service in the application program is reduced, the service calling process is simplified, and the service calling efficiency of the application program is improved.
On the basis of the above embodiment, the device further includes a call result feedback module, configured to obtain, by the server, a service interface call result that matches the target service interface after the target service interface is called by the server; sending the service interface calling result to the client through the server; and feeding back the service interface calling result to the application program which sends the service calling instruction through the client.
The service calling device provided by the embodiment of the invention can execute the service calling method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of a service generating device according to a fourth embodiment of the present invention, which is implemented by a generic service framework unit configured in a hong-and-Monte operating system, wherein the generic service framework unit is implemented by a client-server architecture.
As shown in fig. 4, the apparatus includes:
the target configuration instruction receiving module 410 is configured to receive, by a client in a generic service framework unit, a target configuration instruction for a target service, and send the target configuration instruction to a server in the generic service framework unit; the target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service;
The logic segment obtaining module 420 is configured to match the dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library through the server, so as to obtain each bottom logic segment corresponding to the dynamic configuration logic;
and the target service generating module 430 is configured to generate the target service by assembling the service end based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and store a service call interface matched with the target service locally.
According to the technical scheme, the client side in the general service framework unit receives the target configuration instruction of the target service, and sends the target configuration instruction to the server side in the general service framework unit, then the server side matches dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library to obtain each bottom logic segment corresponding to the dynamic configuration logic, finally the server side assembles and generates the target service based on each bottom logic segment, the dynamic configuration logic and the target configuration function, and locally stores a service calling interface matched with the target service, so that the generation of the new service in the application program is realized, the development difficulty of the new service generated in the application program is reduced, the service development flow is simplified, and the service development efficiency of the application program is improved.
The service generating device provided by the embodiment of the invention can execute the service generating method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, personal digital assistants, data, blade data, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as a service call method and a service generation method.
Correspondingly, the service calling method comprises the following steps:
receiving a service call instruction sent by an application program through a client in a general service framework unit;
Acquiring service calling interface identification information from the service calling instruction through the client, and sending the service calling interface identification information to a server in the universal service framework unit;
receiving the service calling interface identification information through the service end, and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces;
and calling the target service interface through the service end to realize the service provided by the target service interface.
The service generation method comprises the following steps:
receiving a target configuration instruction of target service through a client in a general service frame unit, and sending the target configuration instruction to a server in the general service frame unit; the target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service;
matching dynamic configuration logic in a target configuration instruction with a pre-configured dynamic library through the server to obtain each bottom logic segment corresponding to the dynamic configuration logic;
and the service end is used for assembling and generating the target service based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and locally storing a service call interface matched with the target service.
In some embodiments, the service invocation method and the service generation method may be implemented as computer programs tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the service invocation method and the service generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the service invocation method and the service generation method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. A computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or data.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as data), or that includes a middleware component (e.g., application data), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include a client and data. The client and data are generally remote from each other and typically interact through a communication network. The relationship of client and data arises by virtue of computer programs running on the respective computers and having a client-data relationship to each other. The data can be cloud data, also called cloud computing data or cloud hosts, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
Claims (10)
1. A service invocation method performed by a generic service framework unit deployed in a hong-Meng operating system, the generic service framework unit implemented using a client-server architecture, the method comprising:
receiving a service call instruction sent by an application program through a client in a general service framework unit;
Acquiring service calling interface identification information from the service calling instruction through the client, and sending the service calling interface identification information to a server in the universal service framework unit;
receiving the service calling interface identification information through the service end, and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces;
and calling the target service interface through the service end to realize the service provided by the target service interface.
2. The method of claim 1, further comprising, after invoking the target service interface by the server:
acquiring a service interface calling result matched with the target service interface through the service end;
sending the service interface calling result to the client through the server;
and feeding back the service interface calling result to the application program which sends the service calling instruction through the client.
3. A service generation method performed by a generic service framework unit configured in a hong-Meng operating system, the generic service framework unit implemented using a client-server architecture, the method comprising:
Receiving a target configuration instruction of target service through a client in a general service frame unit, and sending the target configuration instruction to a server in the general service frame unit; the target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service;
matching dynamic configuration logic in a target configuration instruction with a pre-configured dynamic library through the server to obtain each bottom logic segment corresponding to the dynamic configuration logic;
and the service end is used for assembling and generating the target service based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and locally storing a service call interface matched with the target service.
4. A method according to claim 3, wherein the dynamic library is pre-stored with at least one underlying logical fragment with a signature.
5. A method according to claim 3, characterized in that:
the dynamic configuration logic consists of at least one signature matched with the bottom logic fragment in the dynamic library, wherein the signatures are sequentially arranged according to the logic sequence of the target configuration instruction;
The target configuration function is a function for realizing the function corresponding to the target configuration instruction.
6. The method of claim 3, wherein the target configuration instruction is a c++ format instruction that the application translates through a JavaScript-based native application interface NAPI module.
7. A service invocation apparatus executed by a generic service framework unit configured in a hong-Meng operating system, the generic service framework unit implemented in a client-server architecture, the apparatus comprising:
the service calling instruction receiving module is used for receiving a service calling instruction sent by an application program through a client in the universal service framework unit;
the interface identification information sending module is used for obtaining service calling interface identification information from the service calling instruction through the client and sending the service calling interface identification information to the service end in the universal service framework unit;
the target service interface acquisition module is used for receiving the service calling interface identification information through the service end and acquiring a target service interface matched with the service calling interface identification information from all currently stored service calling interfaces;
And the interface calling module is used for calling the target service interface through the service end so as to realize the service provided by the target service interface.
8. A service creation device implemented by a generic service framework unit deployed in a hong-Meng operating system, the generic service framework unit implemented in a client-server architecture, the device comprising:
the target configuration instruction receiving module is used for receiving a target configuration instruction of target service through a client in the universal service frame unit and sending the target configuration instruction to a server in the universal service frame unit; the target configuration instruction comprises dynamic configuration logic and a target configuration function of the target service;
the logic segment acquisition module is used for matching the dynamic configuration logic in the target configuration instruction with a pre-configured dynamic library through the server to acquire each bottom logic segment corresponding to the dynamic configuration logic;
and the target service generation module is used for generating the target service by assembling the server based on the bottom logic fragments, the dynamic configuration logic and the target configuration function, and locally storing a service call interface matched with the target service.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the service invocation method and the service generation method of any of claims 1-6.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the service invocation method and the service generation method of any one of claims 1-6 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310474604.9A CN116521279A (en) | 2023-04-27 | 2023-04-27 | Service calling method, service generating method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310474604.9A CN116521279A (en) | 2023-04-27 | 2023-04-27 | Service calling method, service generating method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116521279A true CN116521279A (en) | 2023-08-01 |
Family
ID=87393573
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310474604.9A Pending CN116521279A (en) | 2023-04-27 | 2023-04-27 | Service calling method, service generating method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116521279A (en) |
-
2023
- 2023-04-27 CN CN202310474604.9A patent/CN116521279A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113312037B (en) | Data processing method, device, equipment and storage medium applied to micro-service | |
CN113808231B (en) | Information processing method and device, image rendering method and device, and electronic device | |
CN113923474B (en) | Video frame processing method, device, electronic equipment and storage medium | |
CN115309470B (en) | Method, device, equipment and storage medium for loading widget | |
CN114035865B (en) | Method, device and equipment for starting small program and storage medium | |
CN114374703B (en) | Cloud mobile phone information acquisition method, device, equipment and storage medium | |
CN112860566B (en) | Applet detection method, device, electronic equipment and readable medium | |
KR102686643B1 (en) | Applet page rendering methods, devices, electronic equipment and storage media | |
US11379201B2 (en) | Wrapping method, registration method, device, and rendering apparatus | |
WO2023169193A1 (en) | Method and device for generating smart contract | |
CN114095758B (en) | Cloud image intercepting method and related device | |
CN114721740B (en) | Message triggering method, device, equipment and storage medium | |
CN116521279A (en) | Service calling method, service generating method, device, equipment and medium | |
CN112540804B (en) | Applet running method and device, electronic equipment and medium | |
CN114090118A (en) | Method, device and equipment for starting small program and storage medium | |
CN113535187B (en) | Service online method, service updating method and service providing method | |
CN114461502B (en) | Model monitoring method and device | |
CN117407044A (en) | Configuration method, device, equipment and medium of cross-terminal assembly | |
CN114051046B (en) | Cloud data issuing method, related device and computer program product | |
CN113157360B (en) | Method, apparatus, device, medium, and article for processing an API | |
CN117453206A (en) | Interface calling method, device, equipment and medium | |
CN116521170A (en) | Conversion method, device, equipment and medium of client native application | |
CN117632343A (en) | OCX module calling method, device, equipment and storage medium | |
CN115576713A (en) | GRPC service application method and device based on class library | |
CN114968200A (en) | Software development kit assembly method, related device and computer program product |
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 |