Online service dynamic update method and its device, equipment, medium, and product
By monitoring and compiling the update events of program resource configuration information of online services and generating and distributing bytecode files, the problem of inefficient online service updates on cross-border e-commerce platforms is solved, and fast and efficient version upgrades and concurrent updates of massive independent sites are achieved.
Patent Information
- Application Number
- CN202210787545.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-07-04
AI Technical Summary
When cross-border e-commerce platforms update widely used online services, they are inefficient, slow update speed, and large network bandwidth occupies, resulting in high complexity and difficulty in achieving concurrent updates of massive independent sites.
By listening to the update event of program resource configuration information of online services, determining the target program resources, compiling its source files to generate bytecode files, and distributing them to multiple online service instances through resource distribution threads to achieve version upgrade.
This method avoids the independent compilation of source files for each instance, reduces network bandwidth usage, and ensures that each instance is updated quickly and efficiently, which is suitable for concurrent updates of massive independent stations.
Smart Images

Figure CN115145620B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of e-commerce services, and in particular to an online service dynamic update method and its corresponding apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Online services are the embodiment of Internet business. Each online service provides a relatively independent function. Each business demander can configure the corresponding online service according to its actual needs in order to use the corresponding function. For example, the online service corresponding to the product advertising service in the e-commerce platform can be configured in each online store. When a user enters the online store, the product advertising service can be used to recommend products to the user.
[0003] Cross-border e-commerce platforms are a type of e-commerce platform that has emerged in recent years. They have built a model that is different from traditional e-commerce platforms by providing a series of e-commerce services to merchant users. A notable feature is that each merchant user's online store will run on an independent site, and the data of each independent site is difficult to interconnect. Therefore, it has the characteristics of wide distribution and strong independence. Therefore, when a cross-border e-commerce platform needs to update an online service that is widely used by various independent sites, its complexity can be imagined.
[0004] Drawing on the software upgrade method of transmission, the upgraded software is usually repackaged and then made available for users to download, in order to achieve software updates. However, if this method is applied to the scenario of providing services for independent stations, its disadvantages such as low efficiency, slow update speed, and a significant increase in network bandwidth usage can be imagined. In view of this, for the online service update in the specific application scenario of the cross-border e-commerce platform based on independent stations, it is necessary to explore a method that fits the actual scenario. Summary of the invention
[0005] The purpose of this application is to solve the above problems and provide an online service dynamic update method and its corresponding device, computer equipment, computer readable storage medium, computer program product, which are suitable for the various purposes of this application and adopt the following technical solutions:
[0006] In one aspect, a method for dynamically updating an online service is provided to meet one of the purposes of the present application, comprising:
[0007] Monitor the update event of the program resource configuration information of the running online service, and determine the target program resource to be updated;
[0008] Compile the source file of the target program resource to obtain the corresponding bytecode file;
[0009] A resource distribution thread is started, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrade of the corresponding instances.
[0010] Optionally, monitoring update events of program resource configuration information of a running online service to determine target program resources to be updated includes:
[0011] Responding to an update event of program resource configuration information, determining corresponding update information;
[0012] Identify whether the existing class is updated according to the class name in the update information, and if so, determine the updated class as the target program resource;
[0013] When the class name is a newly added class, it is used as a target program resource.
[0014] Optionally, compiling the source file of the target program resource to obtain the corresponding bytecode file includes:
[0015] Acquire the source file of the target program resource according to the program resource configuration information;
[0016] Compiling the source file to generate a corresponding bytecode file;
[0017] An update notification message pointing to the bytecode file is sent to the configuration server.
[0018] Optionally, starting a resource distribution thread, whereby the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances, includes:
[0019] The configuration server starts a resource distribution thread in response to an update notification message pointing to the bytecode file;
[0020] The resource distribution thread broadcasts and distributes the bytecode file in the update notification message to update interfaces corresponding to multiple pre-registered instances of the online service;
[0021] The update interface implants the bytecode file into the code of the corresponding instance to implement version upgrade.
[0022] Optionally, each instance of the online service is deployed in different independent sites of the e-commerce platform.
[0023] Optionally, before listening to the update event of the program resource configuration information of the running online service, include:
[0024] Reconstructing the neural network model referenced by the online service so that the source file of the class encapsulating the neural network model is updated;
[0025] Retraining the neural network model to a converged state so that the source file is associated with weight parameters obtained during the training process;
[0026] The source file of the class encapsulating the neural network model is added to the program resource configuration information, and its latest status is marked to trigger the update event.
[0027] On the other hand, an online service dynamic update device is provided to meet one of the purposes of the present application, including: an event monitoring module, a compilation execution module, and a distribution upgrade module, wherein the event monitoring module is used to monitor the update event of the program resource configuration information of the running online service and determine the target program resource that has been updated; the encoding execution module is used to compile the source file of the target program resource to obtain the corresponding bytecode file; the distribution upgrade module is used to start a resource distribution thread, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances.
[0028] Optionally, the event monitoring module includes: an event response unit, used to respond to update events of program resource configuration information and determine corresponding update information; an update determination unit, used to identify whether the existing class is updated based on the class name in the update information, and if so, determine the updated class as the target program resource; and a new addition determination unit, used to treat it as the target program resource when the class name is a new class.
[0029] Optionally, the compilation and execution module includes: a source file acquisition unit, used to acquire the source file of the target program resource according to the program resource configuration information; a bytecode conversion unit, used to compile the source file to generate a corresponding bytecode file; and a message notification unit, used to send an update notification message pointing to the bytecode file to the configuration server.
[0030] Optionally, the distribution and upgrade module includes: a thread starting unit, used for starting a resource distribution thread by a configuration server in response to an update notification message pointing to the bytecode file; a broadcast distribution unit, used for broadcasting and distributing the bytecode file in the update notification message to update interfaces corresponding to multiple pre-registered instances of the online service by the resource distribution thread; and an upgrade iteration unit, used for implanting the bytecode file into the code of the corresponding instance by the update interface to realize version upgrade.
[0031] Optionally, each instance of the online service is deployed in different independent sites of the e-commerce platform.
[0032] Optionally, prior to the event listening module, it includes: a model reconstruction module, used to reconstruct the neural network model referenced by the online service, so that the source file of the class encapsulating the neural network model is updated; a training association module, used to retrain the neural network model to a convergence state, so that the source file is associated with the weight parameters obtained during the training process; a configuration update module, used to add the source file of the class encapsulating the neural network model to the program resource configuration information, and mark its latest status to trigger the update event.
[0033] On the other hand, a computer device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the online service dynamic update method described in the present application.
[0034] On the other hand, a computer-readable storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the online service dynamic update method in the form of computer-readable instructions, and when the computer program is called and executed by a computer, it executes the steps included in the method.
[0035] On the other hand, a computer program product provided to meet another purpose of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the online service dynamic update method described in any embodiment of the present application.
[0036] Compared with the prior art, the present application determines the target program resources to be updated by independently monitoring the update events of the program resource configuration information of the online service, and then independently compiles the target program resources to obtain their bytecode files, and then distributes the bytecode files to each instance of the online service with the help of the resource distribution thread, so as to realize the update and upgrade of each instance, avoid each instance independently compiling the source files of the online service, and avoid each update occupying a large amount of network bandwidth, so as to ensure that each instance is updated quickly and efficiently. It is particularly suitable for deployment in a cross-border e-commerce platform based on independent stations, and realizes concurrent updates of instances corresponding to the same online service in massive independent stations. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0038] Figure 1 This is a flowchart of a typical embodiment of the online service dynamic update method of the present application.
[0039] Figure 2 A schematic diagram of a process for determining target program resources in an embodiment of the present application.
[0040] Figure 3 This is a flow chart of compiling bytecode files according to program resource configuration information and sending update notification messages in an embodiment of the present application.
[0041] Figure 4 A schematic diagram of a process for distributing update notification messages to implement version upgrades of online service instances in an embodiment of the present application.
[0042] Figure 5 A schematic diagram of a process for triggering an update event of an online service in an embodiment of the present application.
[0043] Figure 6 This is a principle block diagram of the online service dynamic update device of the present application;
[0044] Figure 7 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION
[0045] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0046] The neural network models referenced or may be referenced in this application, unless expressly specified, can be deployed on a remote server and remotely called on the client, or can be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.
[0047] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.
[0048] An online service dynamic update method of the present application can be programmed as a computer program product and deployed in a client or server for execution. For example, in the exemplary application scenario of the present application, it can be deployed and implemented in a server of an e-commerce platform, thereby accessing an interface opened after the computer program product is running and performing human-computer interaction with the process of the computer program product through a graphical user interface to execute the method.
[0049] See also Figure 1 In a typical embodiment, the online service dynamic update method of the present application includes the following steps:
[0050] Step S2100, monitoring the update event of the program resource configuration information of the running online service, and determining the target program resource to be updated;
[0051] In an exemplary application scenario, the backend server of the e-commerce platform is responsible for timely updating the online services configured by each independent station. Each independent station can apply to the configuration center of the e-commerce platform to configure a certain online service, then obtain the source file of the online service, compile and run it, and become a corresponding instance of the online service, completing the deployment of the online service on multiple independent stations.
[0052] The online service refers to an application module that is relatively independent in function. Each online service can configure its various program resources according to its corresponding program resource configuration information. The program resources include program code and reference resources including pictures, audio, text, etc. The program code is usually stored as a source file, and other reference resources are also stored as corresponding files in their respective formats. The program code is usually encapsulated in the form of a class, and the code of each class can be encapsulated as a corresponding source file.
[0053] When a developer completes the modification of an online service, a corresponding new class source file will be generated, or a replacement class source file will be generated by modifying the old class code. The code of each class may also reference corresponding reference resources. Therefore, the class source file actually contains the overall packaging information of the class source code and the reference resources it references.
[0054] Usually, the source file of a class needs to be compiled to become a bytecode file so that it can become a code that can be executed by a computer. The online service is distributed to instances of each independent station, and each runs independently. When the source file of the online service changes, the instances of each independent station need to be upgraded accordingly.
[0055] In the configuration server corresponding to the configuration center of the e-commerce platform, a listening thread is pre-set, and the listening thread is used to implement the monitoring of the modification status of each source file of the online service. When the developer modifies the source file of an online service, the corresponding software engineering of the online service will automatically modify the program resource configuration information, so that the program resource configuration information of the online service will produce corresponding changes, thereby triggering a corresponding update event. The update event must include the target program resource that has changed. In one embodiment, the target program resource can be specifically represented as a reference address of a source file of a class, and its digital signature is provided in association. The reference address is used to obtain the source file pointed to by the target program resource, and the digital signature is used to verify whether the source file is a corresponding file that has not been tampered with.
[0056] In one embodiment, the target program resource to be updated may be determined according to the following exemplary process. Figure 2 , the process includes:
[0057] Step S2110, responding to the update event of the program resource configuration information, and determining corresponding update information;
[0058] In response to the update component, the update event includes a reference address of a source file of a class generated in the program resource configuration information due to modification of the online service. Based on the reference address, according to default rules, such as determining a file with a specified suffix under the same path as the file pointed to by the reference address, the corresponding digital signature of the source file can be obtained. The source file and its corresponding digital signature constitute the update information corresponding to the update event.
[0059] Step S2120, identifying whether the existing class is updated according to the class name in the update information, and if so, determining the updated class as the target program resource;
[0060] The file name of the source file pointed to by the reference address contains the class name of the class encapsulated by the source file. First, determine whether it is a newly added class based on the creation time of the class name in the program resource configuration information. If it is not a newly added class, further extract the corresponding source file of the class with the same name from the source file library of the online service, and calculate the digital signature of the source file of the class with the same name according to the preset digital signature algorithm. Then, compare the digital signature of the source file of the class with the same name in the online service with the digital signature in the update information corresponding to the update event. When the two are consistent, it can be determined that the class with the same name in the online service has not been updated, so no further operation is required. Otherwise, it means that the class with the same name in the online service has been updated, so it can be determined that the class with the same name is the updated class. Therefore, the source file pointed to by the reference address in the update information can be used as the target program resource of the class with the same name.
[0061] Step S2130: When the class name is a newly added class, use it as a target program resource.
[0062] If the class name of the source file pointed to by the reference address in the update information is determined to be a newly added class in the previous step, the source file pointed to by the reference address in the update information can be directly used as the target program resource corresponding to the newly added class.
[0063] Step S2200, compile the source file of the target program resource to obtain the corresponding bytecode file;
[0064] In order to make the target program resource into executable code, a compiler corresponding to the language used to develop the online service may be used to compile the source file pointed to by the target program resource to obtain a corresponding bytecode file.
[0065] In one embodiment, the bytecode file may be obtained according to the following process, see Figure 3 ,include:
[0066] Step S2210: acquiring the source file of the target program resource according to the program resource configuration information;
[0067] In this embodiment, the program resource configuration information defines the source file of the target program resource and its reference resources. Therefore, in addition to obtaining its source file according to the reference address corresponding to the target program resource, its corresponding pictures, audio, video, text and other reference resources can also be obtained to facilitate reference during the compilation process.
[0068] Step S2220, compile the source file to generate a corresponding bytecode file;
[0069] Then, a corresponding compiler is used to encode the source file according to the inherent business logic of the compiler to obtain its bytecode file. Among them, some reference resources introduced by the source file may also be compiled into the bytecode file in an embedded manner, while for other reference resources, the source file may only contain their mapping addresses.
[0070] Step S2230: Send an update notification message pointing to the bytecode file to the configuration server.
[0071] After the compilation of the target program resources is completed, the corresponding bytecode file of the target program resources is obtained. If necessary, the corresponding reference resources may also be included. This indicates that the compilation of the target program resources has been completed, and an update notification message can be encapsulated based on this, which includes the download address of the bytecode file. Of course, when the bytecode file contains references to the corresponding reference resources, the download addresses of these reference resources will also be included.
[0072] Finally, the update notification message is sent to the configuration center of the e-commerce platform, that is, the configuration server, to implement the callback of the configuration server, pass the business process from the listening thread to the configuration server, and the configuration server decoupled from the listening thread will generate a resource distribution thread separately to further cooperate to complete the update of the online service instances of each independent station.
[0073] Step S2300: Start a resource distribution thread, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances.
[0074] In one embodiment, after the bytecode files of the target program resources are obtained, the resource distribution thread can be started to implement updates to each independently running online service instance, and the version upgrade of the corresponding instance is achieved by distributing the bytecode files to these independent stations.
[0075] In another embodiment, a resource distribution thread is started, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances. Figure 4 ,include:
[0076] Step S2310: The configuration server responds to the update notification message pointing to the bytecode file and starts a resource distribution thread;
[0077] The configuration server receives the callback of the listening thread, responds to the update notification message and starts the resource distribution thread, and the resource distribution thread can broadcast the update notification message of the previous example of this application to each independent station.
[0078] Step S2320: the resource distribution thread broadcasts and distributes the bytecode file in the update notification message to update interfaces corresponding to multiple pre-registered instances of the online service;
[0079] After the resource distribution thread broadcasts the update notification message to each independent station, each independent station can confirm the upgrade in succession, or automatically confirm the upgrade in response to the update notification message in succession, and request the resource distribution thread to download the corresponding file according to the download address of the bytecode file (including its referenced resources when necessary) belonging to the target program resource in the update notification message. The resource distribution thread asynchronously pushes the corresponding file to each independent station according to the request of each independent station.
[0080] The independent station may pre-configure an update interface for performing version upgrades using files corresponding to target program resources. The update notification may be delivered to the update interface during the process of calling back the update interface. Thus, the update interface, triggered by the update notification message, completes the download of the target program resources according to the above process, thereby enabling the resource distribution thread to complete the distribution of bytecode files.
[0081] Step S2330: The update interface implants the bytecode file into the code of the corresponding instance to implement version upgrade.
[0082] After the update interface completes downloading the file corresponding to the target program resource, it automatically executes the operation of implanting the target program resource into the process of the online service according to its preset business logic, and adds the bytecode file of the target program resource to the online service instance or replaces the bytecode file of the class with the same name of the online service instance according to whether the target program resource is a class with the same name as an existing class or a newly added class.
[0083] It can be seen that the listening thread and the resource distribution thread of the configuration server are essentially decoupled, which improves the reusability of the code. At the same time, the listening thread is responsible for compilation, and the resource distribution thread is responsible for updating each instance of the online service, which can quickly adapt to the iteration of needs. And because an update to the online service can be distributed to each independent station instance through a single compilation, it saves the compilation time and system resources of the software engineering of the online service, greatly improving the deployment efficiency. In addition, the configuration server can centrally implement a configuration center that is convenient for development and maintenance, allowing developers to centrally and uniformly manage it through the visual pages developed by their configuration center, thus also improving the substantial benefits of the development end.
[0084] It is not difficult to understand based on the above embodiments that the present application determines the target program resources to be updated by independently monitoring the update events of the program resource configuration information of the online service, and then independently compiles the target program resources to obtain their bytecode files, and then distributes the bytecode files to each instance of the online service with the help of the resource distribution thread, thereby realizing the update and upgrade of each instance, avoiding that each instance independently compiles the source files of the online service, and avoiding that each update occupies a large amount of network bandwidth, thereby ensuring that each instance is updated quickly and efficiently, and is particularly suitable for deployment in a cross-border e-commerce platform based on independent stations, to realize concurrent updates of instances corresponding to the same online service in massive independent stations.
[0085] Based on any of the above embodiments of this application, please refer to Figure 5 , before listening to the update event of the program resource configuration information of the running online service, including:
[0086] Step S1100: reconstructing the neural network model referenced by the online service so that the source file of the class encapsulating the neural network model is updated;
[0087] In this embodiment, the online service is mainly used to implement artificial intelligence-based services, which reference one or more neural network models through computer programming, such as image classification models, text classification models, graphic and text multimodal classification models, etc., and image feature extraction models, text feature extraction models, graphic and text multimodal feature extraction models, etc. The selection of the neural network model is set as needed by technical personnel in this field according to the specific functions to be implemented by the online service, and does not affect the embodiment of the creative spirit of this application.
[0088] When a neural network model running in an online service needs to be reconstructed, such as adjusting the number of neurons in the fully connected layer, or increasing or decreasing the convolutional layers, any operation that changes the structure of the original neural network model constitutes a reconstruction operation on the neural network model. Once the reconstruction operation occurs, the neural network model needs to be retrained to obtain new weight parameters.
[0089] The neural network model can be programmed to be implemented as a class of online services, and thus can be defined in a source file corresponding to a class. When the neural network model is reconstructed, the source file of its class is naturally updated accordingly, thereby generating a corresponding new source file. In one embodiment, a digital signature of the source file can be generated for verification.
[0090] Step S1200, retraining the neural network model to a convergence state, so that the source file is associated with the weight parameters obtained during the training process;
[0091] After redefining the neural network model, it is necessary to use a preset data set and restart the training of the neural network model using the training samples in the data set and their corresponding supervision labels. By using a sufficient number of training samples to implement multiple iterative training on the neural network model, the weight parameters of the neural network model can be corrected by continuously updating the gradient, so that the loss function of the neural network model gradually converges and finally reaches a convergence state, thereby completing the training of the neural network model.
[0092] After the training of the neural network model is terminated, the weight parameters obtained during the training process are solidified. Therefore, the weight parameters can be saved as a file in a specific format and referenced by the source file of the corresponding class.
[0093] Step S1300: Add the source file of the class encapsulating the neural network model to the program resource configuration information, and mark its latest status to trigger the update event.
[0094] Finally, the source file of the class of the neural network model can be encapsulated in a default format, encapsulated as a data record in the program resource configuration information, and then stored in the program resource configuration information of the configuration server, and its latest status is marked therein, indicating that the source file of the corresponding class has been updated, so that the configuration server can trigger an update event according to the latest status. When adding the data record in the program resource configuration information, if necessary, it can be further associated with its corresponding digital signature and the corresponding file of the weight parameter it references, so that subsequent convenient and quick associated access is possible.
[0095] It can be seen from the above embodiments that the neural network model is one of the application requirements that requires frequent upgrades. It often needs to be retrained or its neural network structure adjusted for update when the data is updated. The related services of the e-commerce platform widely use the neural network model to implement various functions. When the technical solution of the present application is used to implement upgrades based on the neural network model, the various technical advantages of the technical solution of the present application introduced in the foregoing text can be utilized to greatly reduce the upgrade costs incurred by the e-commerce platform in maintaining online service instances of massive independent stations, making the upgrade process basically imperceptible to the end user, thereby improving the service experience of the entire e-commerce platform.
[0096] Based on any embodiment of the present application, when the update interface of each independent station needs to implant the downloaded target program resources into the instance of the online service running thereon, the operation of the online service instance can be stopped first, and the corresponding bytecode files and other resources can be stored in the corresponding area and the corresponding configuration can be completed before starting the online service instance. This can further ensure the smoothness of the upgrade process and greatly reduce the abnormality rate of users' access operations to the online service instance.
[0097] In another embodiment, the update interface can directly modify the memory code of the online service instance, and by means of Java's reflection calling mechanism, directly implant the instructions in the corresponding bytecode file into the process of the online service instance to implement version upgrade.
[0098] On the basis of any embodiment of the present application, multiple distribution servers are connected between each independent station and the configuration server, each distribution server is responsible for connecting to a part of the independent station set, and as a first distribution server, it backs up the connection information of the independent station set connected to another second distribution server. When the resource distribution thread of the configuration server is responsible for broadcasting the update notification message, it first passes the update notification message to the forwarding interface preset by each distribution server, and the forwarding interface further forwards the update notification message to the update interface of each independent station in the independent station set connected to the distribution server where it is located, and then the update interface of each independent station completes the version upgrade.
[0099] In this embodiment, the first distribution server periodically receives heartbeat packets sent by the second distribution server. When the first distribution server fails to receive the heartbeat packet within a preset time period, the first distribution server takes over the independent station that the second distribution server is responsible for connecting. Thereby, according to the set of independent stations that the second distribution server is responsible for connecting and that are backed up in advance by the first distribution server, the connection with each independent station in the set is rebuilt according to the set of independent stations, so that when a communication failure occurs in the second distribution server, the first distribution server can normally relay and forward the update notification message to the independent station that the second distribution server is responsible for connecting on behalf of the second distribution server.
[0100] Since the update notification message occupies a relatively small amount of network bandwidth, it can be used in the scenario of multiple distribution server linkage. Each independent station set can be deployed in different public networks or networks in different regions. Then, the world can connect to multiple globally distributed distribution servers through only one configuration server. Each distribution server will then distribute the update notification message of the online service to its independent station set, which is usually the most geographically adjacent and has the most efficient network connection, to achieve global data distribution. Even if individual distribution servers fail, other distribution servers can promptly play a disaster recovery role and automatically assume the forwarding service of the update notification message, ensuring that independent stations around the world can promptly and normally receive the update notification message of the online service, thereby facilitating the synchronous upgrade of independent stations around the world.
[0101] Based on any embodiment of the present application, the present application may include the following steps:
[0102] Step S3100: responding to the service development instruction triggered by the terminal device, pushing an online service development page to the terminal device, and displaying multiple online services in the program resource configuration information on the development page;
[0103] Step S3200: In response to a development request instruction from the terminal device for any target online service among the multiple online services, source file set entry information of the target online service is obtained from the program resource configuration information, and the source file set entry information is pushed to the terminal device;
[0104] Step S330, in response to the program update instruction submitted by the terminal device to the target online service, the source file of the updated class of the target online service and its referenced resources are obtained, a digital signature corresponding to the source file is generated, a data record corresponding to each class being updated is created in the program resource configuration information, and a corresponding tag is added to trigger a corresponding update event.
[0105] According to the above embodiments, the configuration server of the present application allows developers to centrally develop and maintain online services based on the configuration center it provides. For e-commerce platforms, the centralized development and maintenance of online services helps to improve the security and cost advantages of platform development, and can also cooperate with the above embodiments of the present application to provide an efficient way for the timely upgrade of online services.
[0106] See also Figure 6 , an online service dynamic update device is provided to meet one of the purposes of the present application, which is a functional embodiment of the online service dynamic update method of the present application. The device includes: an event monitoring module 2100, a compilation execution module 2200, and a distribution upgrade module 2300, wherein the event monitoring module 2100 is used to monitor the update event of the program resource configuration information of the running online service and determine the target program resource that has been updated; the encoding execution module is used to compile the source file of the target program resource to obtain the corresponding bytecode file; the distribution upgrade module 2300 is used to start a resource distribution thread, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances.
[0107] Optionally, the event monitoring module 2100 includes: an event response unit, used to respond to the update event of the program resource configuration information and determine the corresponding update information; an update determination unit, used to identify whether the existing class is updated based on the class name in the update information, and if so, determine the updated class as the target program resource; and a new addition determination unit, used to treat it as the target program resource when the class name is a new class.
[0108] Optionally, the compilation execution module 2200 includes: a source file acquisition unit, used to acquire the source file of the target program resource according to the program resource configuration information; a bytecode conversion unit, used to compile the source file to generate a corresponding bytecode file; and a message notification unit, used to send an update notification message pointing to the bytecode file to the configuration server.
[0109] Optionally, the distribution upgrade module 2300 includes: a thread starting unit, used for the configuration server to start a resource distribution thread in response to an update notification message pointing to the bytecode file; a broadcast distribution unit, used for the resource distribution thread to broadcast and distribute the bytecode file in the update notification message to update interfaces corresponding to multiple pre-registered instances of the online service; and an upgrade iteration unit, used for the update interface to implant the bytecode file into the code of the corresponding instance to achieve version upgrade.
[0110] Optionally, each instance of the online service is deployed in different independent sites of the e-commerce platform.
[0111] Optionally, prior to the event listening module 2100, it includes: a model reconstruction module, used to reconstruct the neural network model referenced by the online service, so that the source file of the class encapsulating the neural network model is updated; a training association module, used to retrain the neural network model to a convergence state, so that the source file is associated with the weight parameters obtained during the training process; a configuration update module, used to add the source file of the class encapsulating the neural network model to the program resource configuration information, and mark its latest status to trigger the update event.
[0112] In order to solve the above technical problems, the present application also provides a computer device. Figure 7 As shown, the computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a commodity search category identification method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the online service dynamic update method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art can understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] In this embodiment, the processor is used to execute Figure 6 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the online service dynamic update device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0114] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the online service dynamic update method of any embodiment of the present application.
[0115] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0117] To sum up, the present application can realize concurrent updates of multiple widely distributed instances of online services in a lightweight manner, improve the upgrade efficiency of online services, and is suitable for deployment in servers of cross-border e-commerce platforms based on independent stations. It is used to update corresponding instances of the same online service in massive independent stations, which can save the background maintenance costs of cross-border e-commerce platforms.
Claims
1. A method for dynamically updating an online service, characterized in that: include: Monitor the update event of the program resource configuration information of the running online service, and determine the target program resource to be updated; Compiling the source file of the target program resource to obtain the corresponding bytecode file, including: obtaining the source file of the target program resource according to the program resource configuration information; compiling the source file to generate the corresponding bytecode file; sending an update notification message pointing to the bytecode file to the configuration server; A resource distribution thread is started, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances, including: a configuration server responds to an update notification message pointing to the bytecode file to start the resource distribution thread; the resource distribution thread broadcasts and distributes the bytecode file in the update notification message to update interfaces corresponding to the multiple pre-registered instances of the online service; and the update interface implants the bytecode file into the code of the corresponding instance to implement version upgrade.
2. The online service dynamic update method according to claim 1, characterized in that: Monitor the update events of the program resource configuration information of the running online service, and determine the target program resources that have been updated, including: Responding to an update event of program resource configuration information, determining corresponding update information; Identify whether an existing class is updated according to the class name in the update information, and if so, determine the updated class as a target program resource; When the class name is a newly added class, it is used as a target program resource.
3. The online service dynamic update method according to claim 1, characterized in that: Each instance of the online service is deployed in different independent sites of the e-commerce platform.
4. The online service dynamic update method according to any one of claims 1 to 3, characterized in that: Before listening to the update event of the program resource configuration information of the running online service, including: Reconstructing the neural network model referenced by the online service so that the source file of the class encapsulating the neural network model is updated; Retraining the neural network model to a converged state so that the source file is associated with weight parameters obtained during the training process; The source file of the class encapsulating the neural network model is added to the program resource configuration information, and its latest status is marked to trigger the update event.
5. An online service dynamic update device, characterized in that: include: An event monitoring module is used to monitor the update events of the program resource configuration information of the running online service and determine the target program resource to be updated; The coding execution module is used to compile the source file of the target program resource to obtain the corresponding bytecode file, including: obtaining the source file of the target program resource according to the program resource configuration information; compiling the source file to generate the corresponding bytecode file; sending an update notification message pointing to the bytecode file to the configuration server; The distribution and upgrade module is used to start a resource distribution thread, and the resource distribution thread distributes the bytecode file to multiple pre-registered instances of the online service to implement version upgrades of the corresponding instances, including: the configuration server responds to an update notification message pointing to the bytecode file to start the resource distribution thread; the resource distribution thread broadcasts and distributes the bytecode file in the update notification message to the update interfaces corresponding to the multiple pre-registered instances of the online service; and the update interface implants the bytecode file into the code of the corresponding instance to implement version upgrade.
6. A computer device comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: It stores a computer program implemented according to the method described in any one of claims 1 to 4 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
8. A computer program product, characterized in that The method comprises a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Java code hot updating method and device, electronic equipment and storage medium
CN110262818A
Updating method and device of Flutter application, equipment and storage medium
CN114529066A