CN113821331A - Service acquisition method, device, terminal equipment and medium - Google Patents

Service acquisition method, device, terminal equipment and medium Download PDF

Info

Publication number
CN113821331A
CN113821331A CN202010561088.XA CN202010561088A CN113821331A CN 113821331 A CN113821331 A CN 113821331A CN 202010561088 A CN202010561088 A CN 202010561088A CN 113821331 A CN113821331 A CN 113821331A
Authority
CN
China
Prior art keywords
service
container
searching
instance
searched
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
Application number
CN202010561088.XA
Other languages
Chinese (zh)
Inventor
刘德平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010561088.XA priority Critical patent/CN113821331A/en
Publication of CN113821331A publication Critical patent/CN113821331A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

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

Abstract

The disclosure discloses a service acquisition method, a service acquisition device, terminal equipment and a medium. The method comprises the following steps: acquiring a service acquisition request; searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship; and transmitting the searched service. By using the method, the service acquisition speed can be effectively improved.

Description

Service acquisition method, device, terminal equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular, to a service acquisition method, a service acquisition device, a terminal device and a medium.
Background
When the application program displays the page, the application program needs to acquire the service required by the page and inject the acquired service into the class corresponding to the page to realize the display of the page. For example, when a page is shot for display, the login service may need to be relied on, that is, the login service is firstly obtained, and then the login service is injected into the class corresponding to the page to complete the display of the page.
However, in the prior art, some basic services are registered in a container shared by the application programs, and then dynamic search is realized. This leads to a technical problem of slow service acquisition.
Disclosure of Invention
The embodiment of the disclosure provides a service acquisition method, a service acquisition device, a terminal device and a medium, which effectively improve the service acquisition speed.
In a first aspect, an embodiment of the present disclosure provides a service acquisition method, including:
acquiring a service acquisition request;
searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship;
and transmitting the searched service.
In a second aspect, an embodiment of the present disclosure further provides a service acquisition apparatus, including:
an acquisition module for acquiring a service acquisition request;
the searching module is used for searching the service corresponding to the service acquisition request from a predetermined container tree according to the hierarchical relationship;
and the transmission module is used for transmitting the searched service.
In a third aspect, an embodiment of the present disclosure further provides a terminal device, including:
one or more processing devices;
storage means for storing one or more programs;
the one or more programs are executed by the one or more processing devices, so that the one or more processing devices implement the service acquisition method provided by the embodiment of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processing device, implements the service acquisition method provided by the disclosed embodiments.
The embodiment of the disclosure provides a service acquisition method, a service acquisition device, a terminal device and a medium, wherein a service acquisition request is firstly acquired; then, searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship; and finally transmitting the searched service. By utilizing the technical scheme, the service acquisition speed can be effectively improved.
Drawings
Fig. 1 is a schematic flowchart of a service acquisition method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a service acquisition method according to a second embodiment of the present disclosure;
fig. 2a is a schematic diagram of a container tree according to a second embodiment of the disclosure;
fig. 3 is a schematic structural diagram of a service acquisition device according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution. Furthermore, the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
Example one
Fig. 1 is a schematic flowchart of a service acquisition method provided in an embodiment of the present disclosure, where the method is applicable to a case of acquiring a service, and the method may be executed by a service acquisition apparatus, where the apparatus may be implemented by software and/or hardware and is generally integrated on a terminal device, and in this embodiment, the terminal device includes but is not limited to: mobile phones, computers, personal digital assistants, and the like.
As shown in fig. 1, a service acquisition method provided in a first embodiment of the present disclosure includes the following steps:
and S110, acquiring a service acquisition request.
In the present embodiment, the service acquisition request may be regarded as a request for acquiring a service. The service acquisition request may be triggered by the application. The service acquisition method provided by the present disclosure can be regarded as a framework running at the lower layer of the application program, and each application program acquires the service to display the page.
The content included in the service acquisition request is not limited, and for example, the service acquisition request may include identification information of the service, so as to identify the service to be acquired; one or more of the initial container identification and the custom parameter may also be included in the service acquisition request. The initial container identification may be considered the identification of the container for which the service lookup was first made. When the service is searched, the service corresponding to the service acquisition request can be searched in the container corresponding to the initial container identifier. The custom parameters may be considered parameters that enable service customization. The application program can determine the corresponding self-defined parameters based on the required service and then acquire the corresponding service based on the self-defined parameters so as to realize the acquisition of the customized service.
And S120, searching the service corresponding to the service acquisition request from a predetermined container tree according to the hierarchical relationship.
The container tree may be based on a tree constructed from different containers. Different containers can correspond to different services, and parent-child relationships can be constructed among different containers, so that the hierarchical relationship of the container tree is formed. The method and the device can search the service based on the container tree so as to improve the service searching speed.
For example, when the service is searched, the primary container identifier is searched first, and if there is no corresponding service, the corresponding service is sequentially searched for the upper-level container based on the hierarchical relationship of the container tree.
The primary container identifier may be included in the service acquisition request, or may store a correspondence between the service acquisition request and the initial container identifier in a terminal device that executes the service acquisition method. For example, after the service acquisition request is acquired, the corresponding initial container identifier is determined based on the service identifier information included in the service acquisition request, and then the containers are sequentially searched from the initial container identifier to acquire the corresponding service.
It is noted that stored in the container may be an identification of the service; instantiated services may also be stored, without limitation. When the identifier is stored, the corresponding service may be acquired as the found service based on the identifier.
And S130, transmitting the searched service.
After the service is found, the found service can be fed back to the application program sending the service acquisition request, so that the application program can perform corresponding processing based on the service.
In a service acquisition method provided in a first embodiment of the present disclosure, a service acquisition request is first acquired; secondly, searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship; and then transmits the found service. By the method, the service acquisition speed can be effectively improved.
On the basis of the above-described embodiment, a modified embodiment of the above-described embodiment is proposed, and it is to be noted herein that, in order to make the description brief, only the differences from the above-described embodiment are described in the modified embodiment.
In one embodiment, the service acquisition request includes identification information of the service and an initial container identification.
The initial container identification may be used to determine the container from which to start the lookup service. The identification information of the service may be used to perform a lookup of the service.
Example two
Fig. 2 is a schematic flow chart of a service acquisition method provided in the second embodiment of the present disclosure, and the second embodiment is embodied on the basis of various alternatives in the foregoing embodiments. In this embodiment, searching for a service corresponding to the service acquisition request according to a hierarchical relationship from a predetermined container tree specifically includes: and sequentially searching services corresponding to the identification information according to the hierarchical relationship from the container corresponding to the initial container identification in the predetermined container tree.
Further, the method further comprises: based on the corresponding relation between the page and the service, the service identifiers or service instances corresponding to different services are divided into containers of different levels to form a container tree.
Please refer to the first embodiment for a detailed description of the present embodiment.
As shown in fig. 2, a service acquisition method provided in the second embodiment of the present disclosure includes the following steps:
s210, based on the corresponding relation between the page and the service, dividing service identifiers or service instances corresponding to different services into containers of different levels to form a container tree.
Prior to obtaining the service acquisition request, the present disclosure may first construct a container tree to facilitate service lookup. When the container tree is constructed, the service identifiers or the service instances corresponding to different services can be divided into containers of different levels based on the corresponding relation between the services and the pages. Such as storing the service identification or service instance directly into the corresponding container; or building the corresponding relation between different containers and service identifications or service instances.
S220, acquiring a service acquisition request.
And S230, sequentially searching services corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree.
In this step, a container corresponding to the initial container identifier may be first searched, and if the service corresponding to the identification information of the service is not found in the container, the container is sequentially searched for a higher-level container of the container corresponding to the initial container identifier based on the hierarchical relationship until the service corresponding to the identification information of the service is determined.
And S240, transmitting the searched service.
The service acquisition method provided by the second embodiment of the present disclosure embodies the operation of searching for a service, and further optimizes the operation including determining a container tree. By the method, the service corresponding to the service acquisition request can be quickly found through the initial container identifier and the pre-constructed container tree, and the service searching efficiency is improved.
On the basis of the above-described embodiment, a modified embodiment of the above-described embodiment is proposed, and it is to be noted herein that, in order to make the description brief, only the differences from the above-described embodiment are described in the modified embodiment.
In one embodiment, sequentially searching for services corresponding to the identification information according to a hierarchical relationship starting from a container corresponding to the initial container identification in a predetermined container tree, includes:
sequentially searching service identifiers corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identifier in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the service instance corresponding to the service identifier, taking the service instance corresponding to the user-defined parameter as the service determined by searching; otherwise, initializing the to-be-initialized instance corresponding to the service identifier based on the self-defined parameters, and determining the initialized service instance as the service determined by searching; wherein the service acquisition request includes the custom parameter.
The embodiment can realize the search of the customized service. When searching for a service, the present embodiment may first determine whether there is a service identifier corresponding to the identification information, where the service identifier may be regarded as an identifier corresponding to the container or an identifier stored in the container, and different identifiers may be used to identify different services. In this embodiment, the container tree may be constructed in advance based on correspondence between different service identifiers and different containers.
If the service instance corresponding to the custom parameter exists in the service instance corresponding to the service identifier corresponding to the found corresponding identifier information, the service instance corresponding to the custom parameter can be directly used as the service determined by searching. The service instance corresponding to the service identifier can be distinguished based on different custom parameters.
If the service corresponding to the service identifier corresponding to the found identification information does not have the service instance corresponding to the user-defined parameter, the to-be-initialized instance corresponding to the service identifier can be initialized based on the user-defined parameter, and the initialized service instance is determined as the service determined by the search.
After initializing the to-be-initialized instance, the corresponding relationship among the initialized service, the customized parameter, the service identifier and the identification information can be constructed, and the corresponding relationship is stored in a corresponding container, so that when the service corresponding to the identification information and the customized parameter is searched, the initialization operation is not required to be performed again.
The service acquisition in the embodiment can be realized by Objective-C language.
In one embodiment, the method further comprises: further comprising: and constructing the corresponding relation among the initialized service instance, the customized parameters and the service identifier, and storing the corresponding relation into a corresponding container.
In one embodiment, sequentially searching for services corresponding to the identification information according to a hierarchical relationship starting from a container corresponding to the initial container identification in a predetermined container tree, includes:
sequentially searching service instances corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the searched service instance, determining the service instance corresponding to the user-defined parameter as the searched service; otherwise, updating the searched service instance based on the self-defined parameters, and determining the updated service instance as the searched and determined service.
The embodiment can realize the search of the customized service. When searching for a service, the present embodiment may first determine whether there is a service instance corresponding to the identification information. A service instance may be considered a service that corresponds to or is stored in a container. In this embodiment, the container tree may be constructed in advance based on the correspondence between different service instances and different containers.
If the service instance corresponding to the self-defined parameter exists in the searched service instance, the service instance corresponding to the self-defined parameter can be directly determined as the searched service. Different service instances may have a correspondence with the identification information and the custom parameters. After the service instance is initially screened based on the identification information, the corresponding service can be searched again based on the custom parameters.
If the service instance corresponding to the custom parameter does not exist in the searched service instance, the searched service instance can be updated based on the custom parameter to realize the customization of the service, and the updated service instance is used as the service determined by searching. After the searched service instance is updated, the corresponding relationship among the updated service instance, the user-defined parameter and the identification information can be established, and the corresponding relationship is stored in the container, so that when the service corresponding to the identification information and the user-defined parameter is searched again in the follow-up process, the updating operation is executed again.
The service acquisition in this embodiment may be implemented by a Swift language.
In one embodiment, the method further comprises: and constructing a corresponding relation among the updated service instance, the custom parameter and the identification information, and storing the corresponding relation into a corresponding container.
The following describes an exemplary service acquisition method provided by the present disclosure:
the service acquisition method provided by the present disclosure can be regarded as a framework design scheme depending on injection, and the prior art provides a container depending on an injection framework or control inversion, and registers some basic services into the container for dynamic search. However, the whole application program shares one container, and cannot provide more detailed service splitting, and the whole application program shares services, so that all services are always in the memory, and unused services cannot be destroyed. In the prior art, when the service is searched, the initialized service cannot be searched in the container directly, and the transmission of the custom parameters cannot be realized. The method and the device realize finer-grained service splitting and carry out module service container level division. In addition, the user-defined parameters are transmitted in, and the user-defined parameters are transmitted in the process of searching the service. The method supports Swift and Objective-C languages, and supports search in runtime and native registration. Native registration is supported by Swift, as runtime lookup is supported by Objective-C.
The registration maintenance of the service disclosed by the invention needs a concept of module division, for example, the service is divided into different containers based on the page applied by the service, and the service registered by the A page can be prevented from being taken to the A page when the A page is destroyed. It should be noted that, dividing the services into different containers, the services can be directly stored in the containers; the identification information corresponding to the service may also be stored in a container.
In constructing the container tree, a parent container, namely, a parentContainer parameter may be provided for the purpose of hierarchical lookup in service discovery, namely, service acquisition. For example, (instancetype) initwithpartcontainer (nullable IESContainer) container.
In the process of service discovery, when the container can not find the service, the container can be searched according to the container tree of the pre-sequence piece. Fig. 2a is a schematic diagram of an architecture of a container tree according to a second embodiment of the present disclosure, and referring to fig. 2a, the bottommost container may include a sound recording container, an editing container, and a publishing container. The topmost container may be an application dependent injection container. The present disclosure may perform partitioning of containers based on services to which the containers correspond. The division of the service may be based on the page to which the service applies. Such as services that apply to one or a class of pages, can be divided into one container. If a service is applied to a plurality of pages, the service may be divided into upper level containers corresponding to the plurality of pages.
The method and the device can customize the incoming parameters during service discovery, for example, include the customized parameters in the service acquisition request, so as to realize customization of the service. For example, - (id) resolveObject (Protocol) Protocol alignment list (nullable NSArray) alignment.
The present disclosure may support both swift and Objective-C languages, where a container may be called by a register in swift by a- (Class) registry Class (Class) adapter provider for Protocol. And taking the definitions parameter in the callback of the provider, and initializing the self-defined parameter.
A ResolveObjectWithInitializer function can be called in Objective-C to pass class, initialization SEL and arguments, and the function automatically triggers the initialization method. Such as id resolveObjectWithInitializer (Class aClass, SEL initializer, NSArray) identifiers.
The present disclosure provides a macro IESModuleBegin inside iesinjectdefines.h, which is used to unify service and implementation management without intruding into the implementation.
The IESProvidesSingleton automatically generates a protocol method, which can be automatically generated in a code environment and subjected to compiler checks.
The method for automatically generating the Container category according to the protocol and the life cycle of the service in the service unified management, and if the service is not registered during the service discovery, the service can be statically searched in the Container.
Each module will share one IESServiceProvider, and each component inside the module gets to the Provider to execute the resolve method to get to the instance. Meanwhile, a macro IESAutoInline is provided, and the macro can be directly called to carry out service lookup.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a service acquiring apparatus, which is applicable to the case of acquiring a service, according to a third embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware and is generally integrated on a terminal device.
As shown in fig. 3, the apparatus includes:
an obtaining module 31, configured to obtain a service obtaining request;
the searching module 32 is configured to search for a service corresponding to the service acquisition request according to a hierarchical relationship from a predetermined container tree;
and a transmission module 33, configured to transmit the found service.
In this embodiment, the apparatus first obtains a service obtaining request through the obtaining module 31; secondly, searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship through a searching module 32; the found service is then transmitted through the transmission module 33.
The embodiment provides a service acquisition device, which can effectively improve the acquisition speed of the service.
Further, the service acquisition request includes identification information of the service and an initial container identification.
Further, the search module 32 is specifically configured to:
and sequentially searching services corresponding to the identification information according to the hierarchical relationship from the container corresponding to the initial container identification in the predetermined container tree.
Further, the search module 32 is specifically configured to:
sequentially searching service identifiers corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identifier in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the service instance corresponding to the service identifier, taking the service instance corresponding to the user-defined parameter as the service determined by searching; otherwise, initializing the to-be-initialized instance corresponding to the service identifier based on the self-defined parameters, and determining the initialized service instance as the service determined by searching; wherein the service acquisition request includes the custom parameter.
Further, the apparatus further comprises: and the first construction module is used for constructing the corresponding relation among the initialized service instance, the customized parameter and the service identifier and storing the corresponding relation into a corresponding container.
Further, the search module 32 is specifically configured to:
sequentially searching service instances corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the searched service instance, determining the service instance corresponding to the user-defined parameter as the searched service; otherwise, updating the searched service instance based on the self-defined parameters, and determining the updated service instance as the searched and determined service.
Further, the apparatus further comprises: and the second construction module is used for constructing the corresponding relation among the updated service instance, the user-defined parameter and the identification information and storing the corresponding relation into a corresponding container.
Further, the apparatus further comprises: a partitioning module to:
based on the corresponding relation between the page and the service, the service identifiers or service instances corresponding to different services are divided into containers of different levels to form a container tree.
The service acquisition device can execute the service acquisition method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present disclosure. Fig. 4 shows a schematic structural diagram of a terminal device 400 suitable for implementing an embodiment of the present disclosure. The terminal Device 400 in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a vehicle mounted terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The terminal device 400 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the terminal device 400 may include one or more processing means (e.g., a central processing unit, a graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. The one or more processing devices 401 implement a service acquisition method as provided by the present disclosure. In the RAM403, various programs and data necessary for the operation of the terminal apparatus 400 are also stored. The processing device 401, the ROM402, and the RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408, including, for example, magnetic tape, hard disk, etc., storage 408 for storing one or more programs; and a communication device 409. The communication means 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates a terminal apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer-readable medium may be contained in the terminal device 400; or may exist separately without being assembled into the terminal device 400.
The computer readable medium stores one or more computer programs which, when executed by a processing device, implement the method of:
acquiring a service acquisition request;
searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship;
and transmitting the searched service.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable 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. 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.
Example 1 provides a service acquisition method according to one or more embodiments of the present disclosure, including:
acquiring a service acquisition request;
searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship;
and transmitting the searched service.
Example 2 in accordance with one or more embodiments of the present disclosure, the method of example 1,
the service acquisition request includes identification information of the service and an initial container identification.
Example 3 in accordance with one or more embodiments of the present disclosure, the method of example 2,
searching the service corresponding to the service acquisition request according to the hierarchical relationship from a predetermined container tree, wherein the searching comprises the following steps:
and sequentially searching services corresponding to the identification information according to the hierarchical relationship from the container corresponding to the initial container identification in the predetermined container tree.
Example 4 in accordance with one or more embodiments of the present disclosure, the method of example 3,
sequentially searching services corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree, wherein the services comprise:
sequentially searching service identifiers corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identifier in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the service instance corresponding to the service identifier, taking the service instance corresponding to the user-defined parameter as the service determined by searching; otherwise, initializing the to-be-initialized instance corresponding to the service identifier based on the self-defined parameters, and determining the initialized service instance as the service determined by searching; wherein the service acquisition request includes the custom parameter.
Example 5 the method of example 4, in accordance with one or more embodiments of the present disclosure, further comprising: and constructing the corresponding relation among the initialized service instance, the customized parameters and the service identifier, and storing the corresponding relation into a corresponding container.
Example 6 in accordance with one or more embodiments of the present disclosure, the method of example 3,
sequentially searching services corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree, wherein the services comprise:
sequentially searching service instances corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the searched service instance, determining the service instance corresponding to the user-defined parameter as the searched service; otherwise, updating the searched service instance based on the self-defined parameters, and determining the updated service instance as the searched and determined service.
Example 7 the method of example 6, in accordance with one or more embodiments of the present disclosure, further comprising:
and constructing a corresponding relation among the updated service instance, the custom parameter and the identification information, and storing the corresponding relation into a corresponding container.
Example 8 the method of any one of claims 1-7, in accordance with one or more embodiments of the present disclosure, further comprising:
based on the corresponding relation between the page and the service, the service identifiers or service instances corresponding to different services are divided into containers of different levels to form a container tree.
Example 9 provides, in accordance with one or more embodiments of the present disclosure, a service acquisition apparatus comprising:
an acquisition module for acquiring a service acquisition request;
the searching module is used for searching the service corresponding to the service acquisition request from a predetermined container tree according to the hierarchical relationship;
and the transmission module is used for transmitting the searched service.
Example 10 provides, in accordance with one or more embodiments of the present disclosure, a terminal device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of any of examples 1-8.
Example 11 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing apparatus, implements the method of any of examples 1-8, in accordance with one or more embodiments of the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (11)

1. A method for service acquisition, comprising:
acquiring a service acquisition request;
searching a service corresponding to the service acquisition request from a predetermined container tree according to a hierarchical relationship;
and transmitting the searched service.
2. The method of claim 1, wherein the service acquisition request comprises identification information of a service and an initial container identification.
3. The method of claim 2, wherein searching for the service corresponding to the service acquisition request according to a hierarchical relationship from a predetermined container tree comprises:
and sequentially searching services corresponding to the identification information according to the hierarchical relationship from the container corresponding to the initial container identification in the predetermined container tree.
4. The method according to claim 3, wherein sequentially searching for services corresponding to the identification information according to a hierarchical relationship starting from a container corresponding to the initial container identification in a predetermined container tree comprises:
sequentially searching service identifiers corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identifier in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the service instance corresponding to the service identifier, taking the service instance corresponding to the user-defined parameter as the service determined by searching; otherwise, initializing the to-be-initialized instance corresponding to the service identifier based on the self-defined parameters, and determining the initialized service instance as the service determined by searching; wherein the service acquisition request includes the custom parameter.
5. The method of claim 4, further comprising: and constructing the corresponding relation among the initialized service instance, the customized parameters and the service identifier, and storing the corresponding relation into a corresponding container.
6. The method according to claim 3, wherein sequentially searching for services corresponding to the identification information according to a hierarchical relationship starting from a container corresponding to the initial container identification in a predetermined container tree comprises:
sequentially searching service instances corresponding to the identification information according to a hierarchical relationship from a container corresponding to the initial container identification in a predetermined container tree;
if the service instance corresponding to the user-defined parameter exists in the searched service instance, determining the service instance corresponding to the user-defined parameter as the searched service; otherwise, updating the searched service instance based on the self-defined parameters, and determining the updated service instance as the searched and determined service.
7. The method of claim 6, further comprising:
and constructing a corresponding relation among the updated service instance, the custom parameter and the identification information, and storing the corresponding relation into a corresponding container.
8. The method of any of claims 1-7, further comprising:
based on the corresponding relation between the page and the service, the service identifiers or service instances corresponding to different services are divided into containers of different levels to form a container tree.
9. A service acquisition apparatus, comprising:
an acquisition module for acquiring a service acquisition request;
the searching module is used for searching the service corresponding to the service acquisition request from a predetermined container tree according to the hierarchical relationship;
and the transmission module is used for transmitting the searched service.
10. A terminal device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of any of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the method according to any one of claims 1-8.
CN202010561088.XA 2020-06-18 2020-06-18 Service acquisition method, device, terminal equipment and medium Pending CN113821331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010561088.XA CN113821331A (en) 2020-06-18 2020-06-18 Service acquisition method, device, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010561088.XA CN113821331A (en) 2020-06-18 2020-06-18 Service acquisition method, device, terminal equipment and medium

Publications (1)

Publication Number Publication Date
CN113821331A true CN113821331A (en) 2021-12-21

Family

ID=78911853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010561088.XA Pending CN113821331A (en) 2020-06-18 2020-06-18 Service acquisition method, device, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN113821331A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107111519A (en) * 2014-11-11 2017-08-29 亚马逊技术股份有限公司 For managing the system with scheduling container
CN109002362A (en) * 2017-06-06 2018-12-14 阿里巴巴集团控股有限公司 A kind of method of servicing, device, system and electronic equipment
CN110096371A (en) * 2019-03-08 2019-08-06 国网浙江省电力有限公司 Application exchange method, device, system and management container based on container technique
CN110717123A (en) * 2019-09-30 2020-01-21 北京字节跳动网络技术有限公司 Page response method and device, electronic equipment and storage medium
CN111273999A (en) * 2020-01-20 2020-06-12 北京字节跳动网络技术有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107111519A (en) * 2014-11-11 2017-08-29 亚马逊技术股份有限公司 For managing the system with scheduling container
CN109002362A (en) * 2017-06-06 2018-12-14 阿里巴巴集团控股有限公司 A kind of method of servicing, device, system and electronic equipment
CN110096371A (en) * 2019-03-08 2019-08-06 国网浙江省电力有限公司 Application exchange method, device, system and management container based on container technique
CN110717123A (en) * 2019-09-30 2020-01-21 北京字节跳动网络技术有限公司 Page response method and device, electronic equipment and storage medium
CN111273999A (en) * 2020-01-20 2020-06-12 北京字节跳动网络技术有限公司 Data processing method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蔡海尼;文俊浩;姬楷: "基于SOA的协同设计网络性能优化", 西南交通大学学报, vol. 45, no. 4, pages 605 *

Similar Documents

Publication Publication Date Title
CN112214408B (en) Dependency conflict detection method, dependency conflict detection device, electronic equipment and computer readable medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111273985A (en) Page rendering method and device, electronic equipment and computer readable storage medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN110865846B (en) Application management method, device, terminal, system and storage medium
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN110989987B (en) Portal webpage generation method and device, client, server and storage medium
CN112650521A (en) Software development kit SDK (software development kit) hot repair method and device and electronic equipment
CN110619101B (en) Method and apparatus for processing information
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
WO2023056841A1 (en) Data service method and apparatus, and related product
CN113821331A (en) Service acquisition method, device, terminal equipment and medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN112230986A (en) Project file generation method and device, electronic equipment and computer readable medium
CN113778566A (en) Native application calling method and device, electronic equipment and computer readable medium
CN113835790A (en) Paging page display method and device based on Android
CN111753238A (en) Data mapping method and device and electronic equipment
CN111399902A (en) Client source file processing method and device, readable medium and electronic equipment
CN111259287A (en) Page content display method and device, electronic equipment and storage medium
CN113448550B (en) Method and device for realizing collection management of classes, electronic equipment and computer 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