Movatterモバイル変換


[0]ホーム

URL:


CN112235132A - Method, device, medium and server for dynamically configuring service - Google Patents

Method, device, medium and server for dynamically configuring service
Download PDF

Info

Publication number
CN112235132A
CN112235132ACN202011032570.0ACN202011032570ACN112235132ACN 112235132 ACN112235132 ACN 112235132ACN 202011032570 ACN202011032570 ACN 202011032570ACN 112235132 ACN112235132 ACN 112235132A
Authority
CN
China
Prior art keywords
service
database
bytecode
service platform
data table
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.)
Granted
Application number
CN202011032570.0A
Other languages
Chinese (zh)
Other versions
CN112235132B (en
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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shizhen Information Technology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shizhen Information 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shizhen Information Technology Co LtdfiledCriticalGuangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN202011032570.0ApriorityCriticalpatent/CN112235132B/en
Publication of CN112235132ApublicationCriticalpatent/CN112235132A/en
Application grantedgrantedCritical
Publication of CN112235132BpublicationCriticalpatent/CN112235132B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请实施例提供了一种动态配置服务的方法、装置、介质以及服务器,该方法包括:在服务平台运行时,接收客户端在所述服务平台上提交的服务配置信息;根据所述服务配置信息,生成元数据;根据所述元数据,变更所述服务平台中数据库的数据表结构;根据所述服务配置信息和预设的服务生成模板,通过动态代理技术生成与变更的数据库的数据表结构相适配的字节码;加载运行所述字节码生成服务,并控制在所述客户端的服务平台显示所述服务。本申请实施例不需要重启服务平台,就可以根据客户端提供的服务配置信息,变更数据库的数据表结构,进而根据预设的服务生成模板生成对应的服务,不会影响服务平台的正常运行。

Figure 202011032570

Embodiments of the present application provide a method, device, medium, and server for dynamically configuring services. The method includes: when a service platform is running, receiving service configuration information submitted by a client on the service platform; according to the service configuration information, generate metadata; according to the metadata, change the data table structure of the database in the service platform; according to the service configuration information and the preset service generation template, generate and change the data table of the database through dynamic proxy technology Bytecode adapted to the structure; load and run the bytecode generation service, and control the service platform of the client to display the service. The embodiment of the present application does not need to restart the service platform, and can change the data table structure of the database according to the service configuration information provided by the client, and then generate the corresponding service according to the preset service generation template, without affecting the normal operation of the service platform.

Figure 202011032570

Description

Method, device, medium and server for dynamically configuring service
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a dynamic configuration service method, a dynamic configuration service device, a dynamic configuration service medium and a server.
Background
The cloud service platform is widely applied as a usage and interaction mode of related services based on the internet because the cloud service platform can rapidly call cloud service resources. The cloud Service Platform generally includes a public cloud Service Platform and a private cloud Service Platform, and the private cloud Service Platform includes an IaaS (Infrastructure as a Service, IaaS for short) Platform, a SaaS (Software as a Service, SaaS for short) Platform, and a PaaS (Platform as a Service, PaaS for short) Platform. When a private cloud service platform is constructed in the field of traditional static languages, a source code is generally compiled according to user requirements, then the source code is compiled into a byte code file, and finally the service platform is operated, wherein a database table when the service platform is constructed must be determined when the source code is compiled.
In the process of implementing the present invention, the inventor finds that with the increasing demands of users, when a new service needs to be added to a service platform to change a database table, the service platform generally needs to be stopped, source code compilation is rewritten, and then the service platform is restarted. However, if a user restarts the service platform when adding a new service, the user will inevitably affect the use of other users, and frequent restarting of the service platform will affect the normal operation of the service platform.
Disclosure of Invention
To overcome the problems in the related art, the present application provides a method, an apparatus, a medium, and a server for dynamically configuring a service, which have the advantages of generating a service without restarting the service platform and not affecting the normal operation of the service platform.
According to a first aspect of embodiments of the present application, there is provided a method for dynamically configuring a service, including the steps of:
when a service platform runs, receiving service configuration information submitted by a client on the service platform;
generating metadata according to the service configuration information;
changing a data table structure of a database in the service platform according to the metadata;
generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template;
and loading and running the bytecode generation service, and controlling a service platform of the client to display the service.
According to a second aspect of the embodiments of the present application, there is provided an apparatus for dynamically configuring a service, including:
the information receiving module is used for receiving service configuration information submitted by a client on a service platform when the service platform runs;
the metadata generation module is used for generating metadata according to the service configuration information;
the changing module is used for changing a data table structure of a database in the service platform according to the metadata;
the byte code generating module is used for generating byte codes matched with the data table structure of the changed database through a dynamic proxy technology according to the service configuration information and a preset service generating template;
and the service generation module is used for loading and running the bytecode generation service and controlling a service platform at the client to display the service.
According to a third aspect of embodiments of the present application, there is provided a server, including: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method of dynamically configuring a service as described in any of the above.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method of dynamically configuring a service as described in any one of the above.
When a service platform runs, receiving service configuration information submitted by a client on the service platform, and generating metadata according to the service configuration information; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template, loading and running the bytecode generation service, and controlling a service platform at the client to display the service, so that the data table structure of the database can be changed according to the service configuration information provided by the client without restarting the service platform, and then the corresponding service is generated according to the preset service generation template, thereby not affecting the normal operation of the service platform and improving the user experience.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
For a better understanding and practice, the invention is described in detail below with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic block diagram illustrating an application environment for a method of dynamically configuring a service according to one embodiment of the present application;
FIG. 2 is a flow diagram illustrating a method for dynamically configuring services according to one embodiment of the present application;
FIG. 3 is a timing diagram illustrating a method for dynamically configuring services according to one embodiment of the present application;
FIG. 4 is a timing diagram illustrating a method for dynamically configuring services according to another embodiment of the present application;
FIG. 5 is a timing diagram illustrating a method for dynamically configuring services according to another embodiment of the present application;
FIG. 6 is a timing diagram illustrating a method for dynamically configuring services according to another embodiment of the present application;
FIG. 7 is a block diagram illustrating an exemplary configuration of a device for dynamically configuring a service according to an embodiment of the present disclosure;
fig. 8 is a block diagram schematically illustrating a structure of a server according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that the embodiments described are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated.
In the description of the present application, it is to be understood that the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not necessarily used to describe a particular order or sequence, nor are they to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The word "if/if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination". Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Please refer to fig. 1, which is a schematic block diagram illustrating an application environment of a method for dynamically configuring a service according to an embodiment of the present application. As shown in fig. 1, an application environment of the method of dynamically configuring a service includes acloud server 1000 and a plurality ofclients 2000; thecloud server 1000 includes aprocessing unit 1100 and adatabase 1200; theprocessing unit 1100 runs aservice platform 1110, and theprocessing unit 1100 runs the method for dynamically configuring the service according to the present application. One of theclients 2000 accesses theservice platform 1110 through a browser according to a website input by a user, and then displays an interface of theservice platform 1110 on the browser of theclient 2000. Theservice platform 1110 has a first access page provided on its interface for the user to use the service, and also has a second access page provided on its interface for the user to create or modify the service, and the user can submit the service configuration information on the second access page. Thecloud server 1000 receives the service configuration information of theclient 2000, generates a corresponding service according to the method for dynamically configuring the service, and feeds the generated service back to theclient 2000 for display. Theother clients 2000 may obtain the generated service through a query and add the service through an interface of theservice platform 1100 of the respective browser, thereby using the service. Thedatabase 1200 is provided for storing data generated by eachclient 2000 using each service of theservice platform 1110.
Example 1
A method for dynamically configuring a service according to an embodiment of the present application will be described in detail below with reference to fig. 2.
Referring to fig. 2, the method for dynamically configuring the service includes the following steps:
s101: and receiving service configuration information submitted by a client on the service platform when the service platform runs.
The service platform is an application program which is used for providing user service and runs on cloud computing infrastructure. In the embodiment of the present application, the Service platforms include a SaaS (Software-as-a-Service, SaaS for short) Platform and a PaaS (Platform-as-a-Service, PaaS for short) Platform. The services provided by the SaaS platform to the user are application programs running on the cloud computing infrastructure, the user can access the application programs through a client interface on various devices, such as a browser, and the user does not need to manage or control any cloud computing infrastructure, including a network, a server, an operating system, storage and the like. The PaaS platform provides services for users by deploying applications developed or purchased by the users using provided development languages and tools (e.g., Java, python,. Net, etc.) to the cloud computing infrastructure of the provider, and the users do not need to manage or control the underlying cloud infrastructure, including networks, servers, operating systems, storage, etc., but the users can control the deployed applications and possibly the configuration of the hosting environment running the applications.
The service platform is provided with a first access page for the user to use the service at the client side, and is also provided with a second access page for the user to create or modify the service, and the user can submit service configuration information on the second access page. The service configuration information is used for creating or modifying the service of the service platform; the service configuration information comprises information for changing a data table structure of a database in the service platform, information for generating a service matched with the changed data table structure of the database, service operation interface information and the like. The data table structure is used for determining a file name of a data table, fields contained in the data table, field names of the fields, field types and field lengths, and the information of the data table structure of the change database comprises a change data table name, fields contained in the change data table, field names of the fields, field types of the fields, field lengths of the fields and the like, wherein the change comprises new addition, modification or deletion. In the embodiment of the application, the data table of the database of the service platform is changed into the data table corresponding to the service in the service configuration information, where the service may be an existing service of the service platform or a service to be created according to the service configuration information. The service generation request can be a code written by a user, or a code automatically generated by the service platform through operations such as graphical dragging on a service platform interface by the user. The information for generating the service matched with the data table structure of the changed database is specifically information for performing services such as query, addition, modification and deletion on the data table structure of the changed database. The service operation interface information is interface information displayed to the user in the service generated on the client according to the service configuration information and an operation component for providing interaction between the user and the service platform, for example, a service page is provided on the client, and an operation button, a search box and the like are provided on the service page, so that the user can inquire, add, modify and delete data of a data table of a database corresponding to the service.
S102: and generating metadata according to the service configuration information.
The metadata is data describing information for changing a data table structure of a database in the service platform and is used for supporting functions such as indicating storage positions, historical data, resource searching, file recording and the like.
S103: and changing the data table structure of the database in the service platform according to the metadata.
Wherein the step of changing the data table structure of the database in the service platform comprises: and newly adding, modifying or deleting a data table structure of a database in the service platform.
S104: and generating a byte code matched with the data table structure of the changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template.
The preset service generation template comprises services for providing data which are correspondingly stored in a data table structure of the query, the addition, the modification and the deletion database. When the data stored in the data table of the changed database is inquired, added, modified and deleted, the database statement is generated through the framework according to the parameters input by the user.
The dynamic proxy technology is a proxy class created during program operation, wherein the proxy class is mainly responsible for preprocessing messages for the delegation class, filtering messages, forwarding messages to the delegation class, processing messages after events, and the like. There is usually an association relationship between the proxy class and the proxy class, and an object of a proxy class is associated with an object of a proxy class, and the object of the proxy class does not actually implement a service, but provides a specific service by calling a related method of the object of the proxy class. The service platform of the exemplary embodiment of the present application is developed based on JAVA language technology, and the bytecode is code that can be recognized and executed by a virtual machine in JAVA.
S105: and loading and running the bytecode generation service, and controlling a service platform of the client to display the service.
The bytecode is a binary file that contains the execution program and consists of a sequence of operation codes or data pairs. The service provides functions of querying, adding, modifying and deleting data and the like for the user.
Referring to fig. 3, in an exemplary embodiment of the present application, when a service platform runs, service configuration information submitted by a client on the service platform is received through a data resource module, metadata is generated according to the service configuration information, and the metadata is converted into a byte code data stream. Changing a data table structure of a database in the service platform according to the metadata through a dynamic model module; generating a template according to the service configuration information and a preset service through a dynamic model module, and generating a byte code matched with a data table structure of a changed database through a dynamic proxy technology; loading the byte codes through the class loader, feeding the byte codes back to the dynamic model module, and operating the byte code generation service through the dynamic model module; and sending the service to a service platform of the client for display through a data resource module.
When a service platform runs, receiving service configuration information submitted by a client on the service platform, and generating metadata according to the service configuration information; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template, loading and running the bytecode generation service, and controlling a service platform at the client to display the service, so that the data table structure of the database can be changed according to the service configuration information provided by the client without restarting the service platform, and then the corresponding service is generated according to the preset service generation template, thereby not affecting the normal operation of the service platform and improving the user experience.
In practical use, the service platform inevitably needs to be upgraded or migrated, that is, the service platform inevitably needs to be restarted, in order to prevent the loss of the dynamically generated service, and meanwhile, in a case that the service platform is a cluster service, in order to enable other servers to share the service, in an exemplary embodiment of the present application, after the step of generating a bytecode adapted to a data table structure of a changed database by using a dynamic proxy technology according to the service configuration information and a preset service generation template, the method further includes the following steps: saving the bytecode to a database to persist the bytecode. The persistence is a mechanism for converting program data between a persistent state and an instantaneous state, and bytecodes are stored in a database which can be permanently stored, so that when the service platform is closed and the service platform is restarted, the bytecodes can be loaded from the database to generate service, and the service cannot disappear after the service is restarted. The method for dynamically configuring the service further comprises the following steps: and after the service platform is restarted, loading the bytecode from the database to generate service, and controlling the service platform at the client to display the service. Referring to fig. 4, in an exemplary embodiment of the present application, the bytecode is saved to a database by a dynamic model module to persist the bytecode; after the service platform is restarted, loading the byte codes from the database through a dynamic model module; loading the byte codes through the class loader, feeding the byte codes back to the dynamic model module, and operating the byte code generation service through the dynamic model module; and sending the service to a service platform of the client for display through a data resource module. By saving the bytecode to the database, persistence of the newly added or modified service data can be realized. In order to implement the subsequent operation of executing the delete service, preferably, a plurality of custom class loaders are preset, and one custom class loader is correspondingly used for each bytecode for loading. When the user needs to delete the service, the whole service can be deleted by deleting the byte code and the corresponding class loader.
In practical use, the service platform inevitably needs to be upgraded or migrated, that is, the service platform inevitably needs to be restarted, in order to prevent the loss of the dynamically generated service, and meanwhile, in a case that the service platform is a cluster service, in order to enable other servers to also share the service, in another exemplary embodiment of the present application, after the step of generating metadata according to the service configuration information, the following steps are further included: saving the metadata to a database to persist the metadata. The persistence is a mechanism for converting program data between a persistent state and an instantaneous state, and the metadata is stored in a database which can be permanently stored, so that when the service platform is closed and the service platform is restarted, the metadata can be loaded from the database to further generate the service, and the service cannot disappear after the service is restarted. The method for dynamically configuring the service further comprises the following steps: after the service platform is restarted, loading the metadata from the database; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template; and loading and running the bytecode generation service, and controlling a service platform of the client to display the service. Referring to fig. 5, in an exemplary embodiment of the present application, the metadata is saved to a database by a data resource module. After the service platform is restarted, loading the metadata from the database through a data resource module, and changing a data table structure of the database in the service platform according to the metadata; generating a template according to the service configuration information and a preset service through a dynamic model module, and generating a byte code matched with a data table structure of a changed database through a dynamic proxy technology; loading the byte codes through the class loader, feeding the byte codes back to the dynamic model module, and operating the byte code generation service through the dynamic model module; and sending the service to a service platform of the client for display through a data resource module. By saving the metadata to the database, persistence of the service data can be achieved, and the storage space of the database can be reduced by saving the metadata compared to a manner of saving the bytecode. In order to implement the subsequent operation of executing the delete service, preferably, a plurality of custom class loaders are preset, and one custom class loader is correspondingly used for each bytecode for loading. When the user needs to delete the service, the whole service can be deleted by deleting the byte code and the corresponding class loader.
In an exemplary embodiment, referring to fig. 3 to 5, the step of loading and running the bytecode generation service includes: and loading the bytecode to a virtual machine, and operating the bytecode generation service. In another exemplary embodiment, referring to fig. 6, the step of loading and running the bytecode generation service includes: saving the byte codes as binary files, and saving the binary files of the byte codes to a disk; and loading the binary file of the bytecode from the disk, and operating the binary file generation service of the bytecode. Specifically, the bytecode is stored as a binary file by the dynamic model module, the binary file of the bytecode is stored in the disk, the binary file of the bytecode in the disk is loaded by the class loader, the bytecode generation service is operated, and the bytecode is stored as the binary file and stored in the disk, so that the class loader can directly load the binary file of the bytecode from the disk, and the implementation of the class loader can be changed and rewritten. In order to implement the subsequent operation of executing the delete service, preferably, a plurality of custom class loaders are preset, and one custom class loader is correspondingly used for each bytecode for loading. When the user needs to delete the service, the whole service can be deleted by deleting the byte code and the corresponding class loader.
Example 2
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Please refer to fig. 7, which illustrates a schematic structural diagram of an apparatus for dynamically configuring a service according to an embodiment of the present application. Theapparatus 200 for dynamically configuring a service includes:
theinformation receiving module 201 is configured to receive service configuration information submitted by a client on a service platform when the service platform runs;
ametadata generation module 202, configured to generate metadata according to the service configuration information;
a changingmodule 203, configured to change a data table structure of a database in the service platform according to the metadata;
abytecode generation module 204, configured to generate, according to the service configuration information and a preset service generation template, a bytecode adapted to a data table structure of the changed database through a dynamic proxy technology;
and theservice generation module 205 is configured to load and run the bytecode generation service, and control a service platform at the client to display the service.
When a service platform runs, receiving service configuration information submitted by a client on the service platform, and generating metadata according to the service configuration information; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template, loading and running the bytecode generation service, and controlling a service platform at the client to display the service, so that the data table structure of the database can be changed according to the service configuration information provided by the client without restarting the service platform, and then the corresponding service is generated according to the preset service generation template, thereby not affecting the normal operation of the service platform and improving the user experience.
In actual use, the service platform inevitably needs to be upgraded or migrated, that is, the service platform inevitably needs to be restarted, in order to prevent the loss of the dynamically generated service, and meanwhile, in a case that the service platform is a cluster service, in order to enable other servers to also share the service, in an exemplary embodiment of the present application, the apparatus for dynamically configuring the service further includes a first saving module; the first storage module is used for storing the byte codes to a database. The device for dynamically configuring the service further comprises a first loading operation module; and the first loading operation module is used for loading and executing the bytecode generation service from the database after the service platform is restarted, and controlling the service platform of the client to display the service. By saving the bytecode to the database, persistence of the newly added or modified service data can be realized.
In practical use, the service platform inevitably needs to be upgraded or migrated, that is, the service platform inevitably needs to be restarted, in order to prevent the loss of the dynamically generated service, and meanwhile, in a case that the service platform is a cluster service, in order to enable other servers to share the service, in another exemplary embodiment of the present application, the apparatus for dynamically configuring a service further includes a second saving module, where the second saving module is configured to save the metadata to the database. The device for dynamically configuring the service also comprises a second loading operation module; the second loading operation module is used for loading the metadata from the database after the service platform is restarted; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template; and loading and running the bytecode generation service, and controlling a service platform of the client to display the service. By saving the metadata to the database, persistence of the service data can be achieved, and the storage space of the database can be reduced by saving the metadata compared to a manner of saving the bytecode.
In an exemplary embodiment, the apparatus for dynamically configuring a service further includes a third load run module; the third loading operation module is used for loading the byte codes to a virtual machine and operating the byte code generation service. In another exemplary embodiment, the apparatus for dynamically configuring a service further comprises a fourth load run module; the fourth loading operation module is used for saving the byte codes as binary files and saving the binary files of the byte codes to a disk; and loading the binary file of the bytecode from the disk, operating the binary file generation service of the bytecode, and saving the bytecode as the binary file and storing the binary file into the disk, so that the class loader can directly load the binary file of the bytecode from the disk and can change and rewrite the binary file.
Example 3
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the methods of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 8, the present application further provides aserver 300, where theserver 300 may be embodied as a computer, a mobile phone, a tablet computer, an interactive smart tablet, or other hardware as a support. Theserver 300 may include: at least oneprocessor 301, at least onememory 302, at least onenetwork interface 303, auser interface 304, and at least onecommunication bus 305.
Theuser interface 304 is mainly used for providing an input interface for a user, acquiring data input by the user, and may include a display terminal. Optionally, theuser interface 304 may also include a standard wired interface, a wireless interface.
Thenetwork interface 303 may optionally include a standard wired interface or a wireless interface (e.g., WI-FI interface).
Wherein thecommunication bus 305 is used to enable connection communication between these components.
Theprocessor 301 may include one or more processing cores. Theprocessor 301, using various interfaces and lines to connect various parts throughout theelectronic device 300, performs various functions of theelectronic device 300 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in thememory 302, and calling data stored in thememory 302. Optionally, theprocessor 301 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Theprocessor 301 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into theprocessor 301, but may be implemented by a single chip.
TheMemory 302 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, thememory 302 includes a non-transitory computer-readable medium. Thememory 302 may be used to store instructions, programs, code, sets of codes, or sets of instructions. Thememory 302 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-described method embodiments, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. Thememory 302 may alternatively be at least one storage device located remotely from theprocessor 301. As shown in fig. 8, thememory 302, which is a kind of computer storage medium, may include an operating system, a network communication module, and a user therein.
Theprocessor 301 may be configured to invoke a method of the dynamic configuration service stored in thememory 302, and specifically perform the following operations: when a service platform runs, receiving service configuration information submitted by a client on the service platform; generating metadata according to the service configuration information; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template; and loading and running the bytecode generation service, and controlling a service platform of the client to display the service.
When a service platform runs, receiving service configuration information submitted by a client on the service platform, and generating metadata according to the service configuration information; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template, loading and running the bytecode generation service, and controlling a service platform at the client to display the service, so that the data table structure of the database can be changed according to the service configuration information provided by the client without restarting the service platform, and then the corresponding service is generated according to the preset service generation template, thereby not affecting the normal operation of the service platform and improving the user experience.
In practical use, the service platform inevitably needs to be upgraded or migrated, that is, the service platform inevitably needs to be restarted, in order to prevent the loss of the dynamically generated service, and meanwhile, in a case that the service platform is a cluster service, in order to enable other servers to also share the service, in an exemplary embodiment of the present application, theprocessor 301 may be configured to invoke a method of dynamically configuring a service stored in thememory 302, and further specifically perform the following operations: saving the bytecode to a database; and after the service platform is restarted, loading the bytecode from the database to generate service, and controlling the service platform at the client to display the service. By saving the bytecode to the database, persistence of the newly added or modified service data can be realized.
In practical use, the service platform inevitably needs to be upgraded or migrated, that is, the service platform inevitably needs to be restarted, in order to prevent the loss of the dynamically generated service, and meanwhile, in a case that the service platform is a cluster service, in order to enable other servers to also share the service, in another exemplary embodiment of the present application, theprocessor 301 may be configured to invoke a method of dynamically configuring a service stored in thememory 302, and further specifically perform the following operations: saving the metadata to a database; after the service platform is restarted, loading the metadata from the database; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template; and loading and running the bytecode generation service, and controlling a service platform of the client to display the service. By saving the metadata to the database, persistence of the service data can be achieved, and the storage space of the database can be reduced by saving the metadata compared to a manner of saving the bytecode.
In an exemplary embodiment, when the method for calling the dynamic configuration service stored in thememory 302 is executed to load and run the bytecode generation service, theprocessor 301 specifically executes: and loading the bytecode to a virtual machine, and operating the bytecode generation service. In another exemplary embodiment, when the method for calling the dynamic configuration service stored in thememory 302 is executed to load and run the bytecode generation service, theprocessor 301 specifically executes: saving the byte codes as binary files, and saving the binary files of the byte codes to a disk; and loading the binary file of the bytecode from the disk, operating the binary file generation service of the bytecode, and saving the bytecode as the binary file and storing the binary file into the disk, so that the class loader can directly load the binary file of the bytecode from the disk and can change and rewrite the binary file.
Example 4
The present application further provides a computer-readable storage medium, on which a computer program is stored, where the instructions are suitable for being loaded by a processor and executing the method steps of the foregoing illustrated embodiments, and specific execution processes may refer to specific descriptions shown in embodiment 1, which are not described herein again. The device where the storage medium is located can be an electronic device such as a personal computer, a notebook computer, a smart phone and a tablet computer.
For the apparatus embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described device embodiments are merely illustrative, wherein the components described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart block or blocks and/or flowchart block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium, such as a modulated data signal and a carrier wave
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for dynamically configuring services, comprising the steps of:
when a service platform runs, receiving service configuration information submitted by a client on the service platform;
generating metadata according to the service configuration information;
changing a data table structure of a database in the service platform according to the metadata;
generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template;
and loading and running the bytecode generation service, and controlling a service platform of the client to display the service.
2. The method of dynamically configuring services according to claim 1,
the service configuration information comprises information used for changing a data table structure of the database, information used for generating a service matched with the data table structure of the database and service operation interface information.
3. The method of claim 1, wherein the default service creation template comprises a service providing data stored in correspondence with a data table structure of a query, addition, modification, and deletion database.
4. The method of dynamically configuring services according to claim 1,
the step of changing the data table structure of the database in the service platform comprises: and newly adding, modifying or deleting a data table structure of a database in the service platform.
5. The method of dynamically configuring services according to claim 1,
after the step of generating the bytecode adapted to the data table structure of the changed database by the dynamic proxy technology according to the service configuration information and the preset service generation template, the method further includes the following steps:
saving the bytecode to a database;
the method for dynamically configuring the service further comprises the following steps:
and after the service platform is restarted, loading the bytecode from the database to generate service, and controlling the service platform at the client to display the service.
6. The method of dynamically configuring services according to claim 1,
after the step of generating metadata according to the service configuration information, the method further comprises the following steps:
saving the metadata to a database;
the method for dynamically configuring the service further comprises the following steps:
after the service platform is restarted, loading the metadata from the database; changing a data table structure of a database in the service platform according to the metadata; generating a bytecode which is matched with a data table structure of a changed database through a dynamic proxy technology according to the service configuration information and a preset service generation template; and loading and running the bytecode generation service, and controlling a service platform of the client to display the service.
7. The method of dynamically configuring services according to claim 1,
the step of loading and running the bytecode generation service includes:
saving the byte codes as binary files, and saving the binary files of the byte codes to a disk;
and loading the binary file of the bytecode from the disk, and operating the binary file generation service of the bytecode.
8. An apparatus for dynamically configuring services, comprising:
the information receiving module is used for receiving service configuration information submitted by a client on a service platform when the service platform runs;
the metadata generation module is used for generating metadata according to the service configuration information;
the changing module is used for changing a data table structure of a database in the service platform according to the metadata;
the byte code generating module is used for generating byte codes matched with the data table structure of the changed database through a dynamic proxy technology according to the service configuration information and a preset service generating template;
and the service generation module is used for loading and running the bytecode generation service and controlling a service platform at the client to display the service.
9. A server, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method of dynamically configuring a service according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of dynamically configuring a service according to any one of claims 1 to 7.
CN202011032570.0A2020-09-272020-09-27Method, device, medium and server for dynamically configuring serviceActiveCN112235132B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011032570.0ACN112235132B (en)2020-09-272020-09-27Method, device, medium and server for dynamically configuring service

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011032570.0ACN112235132B (en)2020-09-272020-09-27Method, device, medium and server for dynamically configuring service

Publications (2)

Publication NumberPublication Date
CN112235132Atrue CN112235132A (en)2021-01-15
CN112235132B CN112235132B (en)2023-04-28

Family

ID=74107840

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011032570.0AActiveCN112235132B (en)2020-09-272020-09-27Method, device, medium and server for dynamically configuring service

Country Status (1)

CountryLink
CN (1)CN112235132B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112995339A (en)*2021-04-162021-06-18湖南联智科技股份有限公司Automatic adaptive sensor data analysis method based on dynamic byte code technology
CN113076105A (en)*2021-06-082021-07-06知学云(北京)科技股份有限公司Componentized page rendering method and system for online education and memory
CN118585168A (en)*2024-08-062024-09-03天河道云(北京)科技有限公司 A business object service platform and method based on dynamic bytecode generation

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103617167A (en)*2013-10-222014-03-05芜湖大学科技园发展有限公司Universal metadata/ relation mapping frame
CN108769112A (en)*2018-04-182018-11-06江苏物联网研究发展中心A kind of non-intrusion type RPC interface monitoring method and system
CN110944018A (en)*2019-12-272020-03-31浪潮通用软件有限公司Rpc communication method, device and medium based on annotation and dynamic proxy
CN111414350A (en)*2020-03-182020-07-14腾讯科技(深圳)有限公司Service generation method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103617167A (en)*2013-10-222014-03-05芜湖大学科技园发展有限公司Universal metadata/ relation mapping frame
CN108769112A (en)*2018-04-182018-11-06江苏物联网研究发展中心A kind of non-intrusion type RPC interface monitoring method and system
CN110944018A (en)*2019-12-272020-03-31浪潮通用软件有限公司Rpc communication method, device and medium based on annotation and dynamic proxy
CN111414350A (en)*2020-03-182020-07-14腾讯科技(深圳)有限公司Service generation method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112995339A (en)*2021-04-162021-06-18湖南联智科技股份有限公司Automatic adaptive sensor data analysis method based on dynamic byte code technology
CN112995339B (en)*2021-04-162021-08-03湖南联智科技股份有限公司Automatic adaptive sensor data analysis method based on dynamic byte code technology
CN113076105A (en)*2021-06-082021-07-06知学云(北京)科技股份有限公司Componentized page rendering method and system for online education and memory
CN118585168A (en)*2024-08-062024-09-03天河道云(北京)科技有限公司 A business object service platform and method based on dynamic bytecode generation
CN118585168B (en)*2024-08-062024-11-29天河道云(北京)科技有限公司 A business object service platform and method based on dynamic bytecode generation

Also Published As

Publication numberPublication date
CN112235132B (en)2023-04-28

Similar Documents

PublicationPublication DateTitle
US11853820B2 (en)Cross-process communication method, apparatus, and device
WO2020119485A1 (en)Page display method and device, apparatus, and storage medium
US9229771B2 (en)Cloud bursting and management of cloud-bursted applications
US11797638B2 (en)Aggregate component for parallel browser-initiated actions
CN108647032B (en) Application loading method and apparatus, computer apparatus and computer-readable storage medium
CN111897564A (en)Application updating method and system
CN112235132B (en)Method, device, medium and server for dynamically configuring service
WO2017143747A1 (en)Network request method and system for network terminal
US10564950B1 (en)Disassembly code generation during debugging
US11429596B2 (en)Update for configuration file
CN111930455A (en)Page updating method, device, terminal and storage medium
CN112882698A (en)Development environment generation method and device, computer storage medium and electronic device
CN115145559A (en)Configuration management method, device and equipment based on Flutter
CN114254232B (en) Cloud product page generation method, device, computer equipment and storage medium
CN114489721A (en) DSL description file management method, apparatus, system, device and medium
CN112115056B (en)Project deployment method and device, server and storage medium
CN112152988B (en)Method, system, computer device and medium for asynchronous NBMP request processing
US10997269B1 (en)Using web application components with different web application frameworks in a web application
CN115202673A (en)Application construction method and device based on cloud server and computer equipment
US9606775B2 (en)Developing rich internet application
CN118192965A (en)Page component processing method, device, computer equipment, storage medium and product
CN114253441B (en) Methods and devices for enabling target functions, storage media, and electronic devices
CN113961234A (en)Construction method and related device of Linux distribution version
CN115129417A (en) Virtual machine creation method, device and storage medium based on Kubernetes platform
CN114500718B (en) A cloud mobile phone management method and device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp