A load balancing and retry method and device for distributed graph database service
By maintaining a connection pool in the graph database service and utilizing load balancing strategies and hierarchical retry mechanisms, the problem of request failure caused by graph database service downtime or network interruption is solved, achieving a 100% request success rate and improved response performance.
Patent Information
- Application Number
- CN202410838833.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-26
AI Technical Summary
The existing technology is difficult to ensure the high availability of user requests, especially when the graph database service has a short-term server downtime or network interruption, causing user requests to fail.
By maintaining a connection pool, the load balancing strategy is used to route user requests to TCP connections of multiple graph database services, and hierarchical retry processing is performed based on the response to ensure that the request is successful.
It achieves a 100% request success rate in the case of short-term service downtime or network interruption, improving the response performance and concurrency of user requests.
Smart Images

Figure CN118394850B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of graph database services, and in particular to a load balancing and retry method and device for distributed graph database services. Background Art
[0002] In the current information age, graph databases have advantages in storing large amounts of data with complex relationships. The graph database service itself is a distributed service. When a query engine service or storage engine service fails, other engine services can still provide services, achieving high availability of the graph database service.
[0003] A user request sent by a user through the client may fail because it is sent to an abnormal service of the graph database. This is unacceptable for systems with high requirements for data availability. Therefore, how to improve the success rate of user requests and ensure the high availability of user requests is an urgent problem to be solved. Summary of the invention
[0004] The purpose of this application is to overcome the problem in the prior art that it is difficult to ensure high availability of user requests due to accidental factors such as short-term server downtime and network interruption, and to provide a client load balancing and retry method and device for a distributed graph database service.
[0005] In a first aspect, a load balancing and retry method for a distributed graph database service is provided, including:
[0006] Maintaining a connection pool, wherein the connection pool has multiple TCP connections to the graph database service created therein;
[0007] The received user request is forwarded to the graph database service through the TCP connection in the connection pool using a load balancing strategy, specifically including:
[0008] Obtaining a TCP connection from the connection pool, wherein the obtained TCP connection is a TCP connection with the graph database service created after being routed to different graph database services by the load balancer through a load balancing policy;
[0009] Execute user requests through the acquired TCP connection;
[0010] Obtain a response to the user's request, and perform hierarchical retry processing based on the response.
[0011] In some possible implementations, before maintaining the connection pool, the process further includes: determining whether the client is successfully started based on the health status of the graph database service.
[0012] In some possible implementations, determining whether the client is started is based on the health status of the graph database service, specifically including:
[0013] If the user configures the client to require that all graph data services are available when it starts, the health status of the graph database service is determined before the client starts. If the health status of all graph data services is available, the client is successfully started, otherwise the client fails to start, or
[0014] If the user configuration does not require that all graph data services be in an available state when the client is started, the health status of the graph database service is determined before the client is started. If at least one graph data service is in an available health state, the client is successfully started, otherwise the client startup fails.
[0015] In some possible implementations, it also includes: maintaining the health status of the graph database service through a Map data structure, wherein the health status of the graph database service includes an available state and an unavailable state, and the graph database service is deployed in a distributed manner.
[0016] In some possible implementations, maintaining a connection pool includes:
[0017] The size of the queue is determined based on the maximum number of TCP connections in the connection pool configured by the user;
[0018] Create a queue, which is used to store TCP connections with the graph database service;
[0019] Maintain the status of the TCP connections in the queue, wherein the status of the TCP connections in the queue includes: idle, occupied, and invalid.
[0020] In some possible implementations, maintaining the connection pool further includes:
[0021] Monitor the validity of the TCP connection and automatically remove abnormal TCP connections from the queue;
[0022] The maximum life cycle of the TCP connection is set, and the TCP connections in the queue that exceed the maximum life cycle are automatically removed.
[0023] In some possible implementations, performing hierarchical retry processing according to the response situation includes:
[0024] Parsing the response;
[0025] If the response is a success or non-retryable error code, the result of the response is returned to the user;
[0026] If an error code indicating an abnormal IO TCP connection occurs, the TCP connection is updated and the user request is retried until the retry succeeds or the preset maximum number of retries is reached;
[0027] If the response is a retryable execution failure error code, retry the user request until the retry succeeds or the preset maximum number of retries is reached;
[0028] If the response is a retryable Session exception error code, use the current TCP connection to re-authenticate to obtain a new Session id, then retry the user request using the current TCP connection and the new Session id, repeat the authentication and retry the request with the new Session id until the retry succeeds or the preset maximum number of retries is reached.
[0029] In a second aspect, a load balancing and retry device for a distributed graph database service is provided, including:
[0030] A maintenance module, used for maintaining a connection pool, wherein the connection pool has multiple TCP connections with the graph database service created therein;
[0031] The load balancing module is used to forward the received user request to the graph database service through the TCP connection in the connection pool using the load balancing strategy, specifically including:
[0032] An acquisition submodule, used to acquire a TCP connection from the connection pool, wherein the acquired TCP connection is a TCP connection with the graph database service created by the load balancer after being routed to different graph database services through a load balancing strategy;
[0033] An execution submodule, used to execute a user request through the acquired TCP connection;
[0034] The retry submodule is used to obtain the response to the user request and perform hierarchical retry processing according to the response situation.
[0035] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable medium stores a program code for execution by a device, wherein the program code includes steps for executing the method in any one of the implementations of the first aspect described above.
[0036] In a fourth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements a method as in any one of the implementations in the first aspect above.
[0037] The present application has the following beneficial effects: through load balancing and failure retry mechanism, when the user request is correct, the present application enables the client to start retrying for request failures caused by accidental factors such as short-term service downtime and network interruption, thereby achieving the ultimate success of the client request, and can achieve a 100% request success rate, and rely on the client's load balancer to implement request routing to different graph database services, effectively improving the response performance and concurrency of user requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 It is a flow chart of the load balancing and retry method of the distributed graph database service of Example 1 of the present application;
[0041] Figure 2 It is a structural block diagram of a load balancing and retry device for a distributed graph database service in Example 2 of the present application;
[0042] Figure 3 It is a schematic diagram of the internal structure of the electronic device of Example 4 of the present application.
[0043] Reference numerals:
[0044] 100, maintenance module; 200, load balancing module; 201, acquisition submodule; 202, execution submodule; 203, retry submodule. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Example 1
[0047] like Figure 1As shown, a load balancing and retry method for a distributed graph database service involved in Example 1 of the present application includes: maintaining a connection pool, wherein a plurality of TCP connections with a graph database service are created in the connection pool; forwarding a received user request to the graph database service through a TCP connection in the connection pool using a load balancing strategy, specifically including: obtaining a TCP connection from the connection pool, wherein the obtained TCP connection is a TCP connection with the graph database service created after being routed to different graph database services by a load balancer through a load balancing strategy; executing the user request through the obtained TCP connection;
[0048] Obtain responses to user requests and perform hierarchical retry processing based on the responses. This method significantly improves the stability and availability of user interaction with the distributed graph database system by integrating load balancing and retry mechanisms. The graph database client system implemented in this way can adapt to node failures, ensure that query requests are effectively processed, enhance user experience, and achieve the ultimate success of user requests under certain configurations.
[0049] Specifically, the load balancing and retry method of the distributed graph database service in the application embodiment 1 includes:
[0050] First, we need to ensure that the deployment of the graph database service is distributed and that the storage and query services of the graph database have high availability. Specifically, by deploying the graph database service on multiple servers to form a distributed system, the high availability of its services is guaranteed.
[0051] Secondly, the client needs to maintain the health status of each graph database service. The client uses a Map data structure to maintain the status of each graph database service. When the client is initially started, the status of each service is detected and the detection results are added to the Map data structure. The implementation code example is as follows:
[0052] private final Map<HostAddress, Integer> serversStatus = newConcurrentHashMap<>();
[0053] public void updateServersStatus() {
[0054] for (HostAddress hostAddress : addresses) {
[0055] if (ping(hostAddress)) {
[0056] serversStatus.put(hostAddress, S_OK);
[0057] } else {
[0058] serversStatus.put(hostAddress, S_BAD);
[0059] }
[0060] }
[0061] }
[0062] public boolean ping(HostAddress addr) {
[0063] try {
[0064] Connection connection = new SyncConnection();
[0065] if (enabledSsl) {
[0066] connection.open(addr, this.timeout, sslParam, useHttp2,customHeaders);
[0067] } else {
[0068] connection.open(addr, this.timeout, useHttp2,customHeaders);
[0069] }
[0070] boolean pong = connection.ping();
[0071] connection.close();
[0072] return pong;
[0073] } catch (IOErrorException e) {
[0074] LOGGER.warn(String.format("ping server %s failed",addr.toString()), e);
[0075] return false;
[0076] } catch (ClientServerIncompatibleException e) {
[0077] LOGGER.error("version verify failed, ", e);
[0078] return false;
[0079] }
[0080] }.
[0081] The success or failure of the client startup is determined by whether the user configuration requires that all services be available when the client starts. The configuration is strictlyServerHealthy. If the user sets this configuration to true when using the client, all graph database services are required to be available when the client starts. As long as one query service is unavailable, the client startup fails. It should be noted that the requirement that all graph database services are available when the client starts means: when the user request is a query request, the graph database service refers to the query service; if the user request is a storage request, the graph database service refers to the storage service, that is, the graph database service type here needs to be determined according to the user request; if the user sets this configuration to false when using the client, the client startup requires that as long as there is one available graph database service, the client can start successfully. If there is no available graph database service, the client startup fails. The implementation code example is as follows:
[0082] public boolean isServersOK(boolean strictlyServerHealthy) {
[0083] this.updateServersStatus();
[0084] int numServersWithOkStatus = 0;
[0085] for (HostAddress hostAddress : addresses) {
[0086] if (serversStatus.get(hostAddress) == S_OK) {
[0087] numServersWithOkStatus++;
[0088] }
[0089] }
[0090] if (strictlyServerHealthy) {
[0091] return numServersWithOkStatus == addresses.size();
[0092] } else {
[0093] return numServersWithOkStatus>0;
[0094] }
[0095] }.
[0096] In order to improve the response speed of requests, the client maintains a connection pool that allows multiple TCP connections with the server to be created in the connection pool when the client is initialized, so that the TCP connection in the connection pool can be reused when executing requests, saving the time spent on creating TCP connections and authentication. And when the TCP connection is idle, the validity of the TCP connection in the connection pool is detected, and abnormal TCP connections are automatically removed. At the same time, users can set the maximum life cycle of the TCP connection in the connection pool according to business needs. When the TCP connection in the connection pool is idle and the life cycle exceeds the preset maximum life cycle, the TCP connection will be automatically removed. Here is an example of business needs: When the graph database server has set the idle period of the TCP connection and it is set to 30 minutes, if the TCP connection in the client connection pool is always idle, the TCP connection in the client connection pool will expire and become invalid after 30 minutes. If the request is routed to the TCP connection after 30 minutes, the request will fail because the TCP connection has expired on the server and the server will consider the TCP connection invalid. If the user sets the lifetime of the TCP connection in the client connection pool to 28 minutes, then a TCP connection will be released and removed from the client connection pool 28 minutes after it is created because the maximum lifetime has been reached. In this way, all TCP connections in the connection pool are TCP connections within the valid life cycle on the server side. Therefore, even after 30 minutes, the request will not be routed to the expired TCP connection.
[0097] It should be noted that the client maintains a connection pool, including: a queue is created when the client is initialized, and the queue is used to store TCP connections. The TCP connections in the queue are stateful, and the status of the TCP connections in the queue includes idle, occupied, and expired. First, the client will determine the size of the queue to be created based on the maximum number of TCP connections in the connection pool configured by the user, and then create multiple TCP connections between the client and the server and set the TCP connection status to idle and put it in the queue for the client to use when executing the request. The specific value of the multiple TCP connections mentioned here is determined by the configuration of the minimum number of TCP connections in the connection pool set by the user.
[0098] In order to evenly distribute the query requests received by the client to different query services, the client implements a load balancer, which can forward requests through load balancing strategies such as polling, random, minimum number of TCP connections, and fastest response speed to forward user requests to the most appropriate query service.
[0099] In the above embodiment, the use of load balancing strategy can improve the availability and response performance of TCP connections in the client connection pool, but it is still impossible to completely avoid the TCP connection being 100% effective. For example, a query service is abnormal, and the corresponding TCP connection in the client connection pool is unavailable, but the next round of health monitoring has not been performed at this time. When the request is routed to the unavailable TCP connection, the request will fail. Therefore, in order to further ensure the success rate of the request, the client needs to perform targeted retries.
[0100] In this embodiment, the client allows the user to configure the number of retries and the retry interval of the client. When the client fails to execute a user request, the retry level is differentiated according to the failure category. The specific execution process and classification retry of the user request include:
[0101] S1. The user initializes the client and uses the client to call the query statement.
[0102] S2. Before executing a request, the client first obtains a TCP connection from the connection pool. The TCP connections in the connection pool are routed to different query services by the load balancer through polling or other strategies, and then a TCP connection with the query service is created. When obtaining a TCP connection, the load balancer also selects the TCP connection corresponding to the optimal query service through a certain load balancing strategy, and then uses the TCP connection to execute the query request.
[0103] S3. Get the response to the user's request and determine the subsequent processing based on the response:
[0104] S3.1. If the response is successful or the response is an error code that cannot be retried (for example: parameter error, syntax error, graph space error, etc.), the response result is directly returned to the user.
[0105] S3.2. If an IO TCP connection exception occurs in the response, the TCP connection used by the client is updated, that is, the Session ID of the TCP connection is maintained, and the TCP connection with the query service is re-created (the service for re-creating the TCP connection is selected through the load balancer), and the query statement is retried until the retry succeeds or the maximum number of retries is reached.
[0106] S3.3. If the query response is a retryable execution failure error code, the request is directly retried until the retry succeeds or the maximum number of retries is reached.
[0107] S3.4. If the query responds to a retryable Session exception error code, the client uses the current TCP connection to re-authenticate and obtain a new Session id for the TCP connection, and then uses the current TCP connection and the new Session id to retry the query statement (i.e., retry the user request). Repeat the above process until the retry succeeds or the maximum number of retries is reached. It should be noted that Session exception means session id exception (may be expired or session deleted), and the TCP connection is good. At this time, the retry is to continue to use the current TCP connection to send an authentication request to the server. The client will receive a new session id returned by the server, so that the client has a new session id. When retrying, use the new session id to retry, but in fact the TCP connection is still the previous connection.
[0108] In this embodiment, the final number of retries is large enough, so even if all query services and storage services of the graph database fail within a short period of time, such as server crashes, network interruptions, etc., and are unable to provide services, the client's request can still achieve the final success.
[0109] It should be noted that during the operation of the client, if a graph database query service A is abnormal, the TCP connection with the query service A will be identified by the client health detection thread and removed from the connection pool. When the service A is restored, once the health detection thread finds that the service A has been restored, it will immediately establish a TCP connection with the service A and use the TCP connection to replace the TCP connection that was first put into the connection pool, so that subsequent requests can be routed to service A. Automatic routing of user requests to the query service that recovers from the failure is realized, ensuring the load balancing of each query service request.
[0110] In this embodiment, by integrating load balancing and retry mechanisms, the client's load balancer is relied upon to implement request routing to different graph database query services, thereby improving the response performance and concurrency of requests, and significantly improving the stability and availability of user interaction with the distributed graph database system. The graph database client system implemented in this way can adapt to node failures, ensure that user requests are effectively processed, enhance user experience, and achieve the ultimate success of query requests under certain configurations, that is, under the premise that the user request is correct (that is, excluding the above-mentioned non-retryable errors, such as: user use of the wrong graph space, parameter name, incorrect syntax, and other user usage problems), the client request can be ultimately successful, and a request success rate of 100% can be achieved.
[0111] Example 2
[0112] like Figure 2 As shown, a load balancing and retry device for a distributed graph database service, i.e., a client, involved in Embodiment 2 of the present application includes:
[0113] A maintenance module 100 is used to maintain a connection pool, wherein a plurality of TCP connections with a graph database service are created in the connection pool;
[0114] The load balancing module 200 is used to forward the received user request to the graph database service through the TCP connection in the connection pool using the load balancing strategy, and specifically includes:
[0115] An acquisition submodule 201 is used to acquire a TCP connection from the connection pool, wherein the acquired TCP connection is a TCP connection with the graph database service created after the load balancer routes to different graph database services through a load balancing strategy;
[0116] An execution submodule 202, configured to execute a user request through the acquired TCP connection;
[0117] The retry submodule 203 is used to obtain a response to the user request and perform hierarchical retry processing according to the response.
[0118] It should be noted that other specific implementation methods of the load balancing and retry device of the distributed graph database service in the embodiment of the present invention can refer to the specific implementation methods of the load balancing and retry method of the above-mentioned distributed graph database service. In order to avoid redundancy, they will not be repeated here.
[0119] Example 3
[0120] A computer-readable storage medium according to Embodiment 3 of the present application, wherein the computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing a method in any one of the implementations in Embodiment 1 of the present application;
[0121] Among them, the computer-readable storage medium can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM); the computer-readable storage medium can store program code, and when the program stored in the computer-readable storage medium is executed by the processor, the processor is used to execute the steps of the method in any one of the implementation methods in Example 1 of the present application.
[0122] Example 4
[0123] like Figure 3 As shown, an electronic device involved in Embodiment 4 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, a method in any one of the implementations in Embodiment 1 of the present application is implemented;
[0124] Among them, the processor can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the method in any one of the implementation methods in Example 1 of the present application.
[0125] The processor may also be an integrated circuit electronic device with signal processing capability. In the implementation process, each step of the method in any implementation of Embodiment 1 of the present application may be completed by an integrated logic circuit of hardware in the processor or by instructions in software form.
[0126] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the functions required to be performed by the unit included in the data processing device of the embodiment of the present application in combination with its hardware, or executes the method in any one of the implementation modes in the embodiment 1 of the present application.
[0127] The above are only preferred specific implementations of the present application; however, the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved ideas of the present application within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A load balancing and retry method for a distributed graph database service, characterized in that: include: The client maintains the health status of the graph database service through the Map data structure. When the client is initially started, it detects the status of each service and adds the detection results to the Map data structure. The health status of the graph database service includes available status and unavailable status. The graph database service adopts distributed deployment. Maintaining a connection pool, wherein the connection pool has multiple TCP connections to the graph database service created therein; The received user request is forwarded to the graph database service through the TCP connection in the connection pool using a load balancing strategy, specifically including: Obtaining a TCP connection from the connection pool, wherein the obtained TCP connection is a TCP connection with the graph database service created after being routed to different graph database services by the load balancer through a load balancing policy; Execute user requests through the acquired TCP connection; Obtaining a response to a user request and performing a hierarchical retry process according to the response, specifically comprising the following steps: Parsing the response; If the response is a success or non-retryable error code, the result of the response is returned to the user; If an error code indicating an abnormal IO TCP connection occurs, the TCP connection is updated and the user request is retried until the retry succeeds; If the response is a retryable error code indicating execution failure, retry the user request until the retry succeeds; If the response is a retryable Session exception error code, use the current TCP connection to re-authenticate to obtain a new Session id, and then retry the user request using the current TCP connection and the new Session id, repeating the authentication and request retry until the retry is successful.
2. The load balancing and retry method for distributed graph database services according to claim 1, characterized in that: Before maintaining the connection pool, it also includes: determining whether the client is successfully started based on the health status of the graph database service.
3. The load balancing and retry method for distributed graph database services according to claim 2, characterized in that: Determine whether the client is started based on the health status of the graph database service, including: If the user configures the client to require that all graph data services are available when it starts, the health status of the graph database service is determined before the client starts. If the health status of all graph data services is available, the client is successfully started, otherwise the client fails to start, or If the user configuration does not require that all graph data services be in an available state when the client is started, the health status of the graph database service is determined before the client is started. If at least one graph data service is in an available health state, the client is successfully started, otherwise the client startup fails.
4. The load balancing and retry method for a distributed graph database service according to claim 1, characterized in that: Maintaining a connection pool includes: The size of the queue is determined based on the maximum number of TCP connections in the connection pool configured by the user; Create a queue, which is used to store TCP connections with the graph database service; Maintain the status of the TCP connections in the queue, wherein the status of the TCP connections in the queue includes: idle, occupied, and invalid.
5. The load balancing and retry method for distributed graph database services according to claim 4, characterized in that: Maintaining a connection pool also includes: Monitor the validity of the TCP connection and automatically remove abnormal TCP connections from the queue; The maximum life cycle of the TCP connection is set, and the TCP connections in the queue that exceed the maximum life cycle are automatically removed.
6. A load balancing and retry device for a distributed graph database service, characterized in that: include: The client is used to maintain the health status of the graph database service through the Map data structure, detect the status of each service when the client is initially started, and add the detection results to the Map data structure, wherein the health status of the graph database service includes an available state and an unavailable state, and the graph database service adopts a distributed deployment; A maintenance module, used for maintaining a connection pool, wherein the connection pool has multiple TCP connections with the graph database service created therein; The load balancing module is used to forward the received user request to the graph database service through the TCP connection in the connection pool using the load balancing strategy, specifically including: An acquisition submodule, used to acquire a TCP connection from the connection pool, wherein the acquired TCP connection is a TCP connection with the graph database service created by the load balancer after being routed to different graph database services through a load balancing strategy; An execution submodule, used to execute a user request through the acquired TCP connection; The retry submodule is used to obtain the response to the user request and perform hierarchical retry processing according to the response situation, which specifically includes the following steps: Parsing the response; If the response is a success or non-retryable error code, the result of the response is returned to the user; If an error code indicating an abnormal IO TCP connection occurs, the TCP connection is updated and the user request is retried until the retry succeeds; If the response is a retryable error code indicating execution failure, retry the user request until the retry succeeds; If the response is a retryable Session exception error code, use the current TCP connection to re-authenticate to obtain a new Session id, and then retry the user request using the current TCP connection and the new Session id, repeating the authentication and request retry until the retry is successful.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing the method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the method according to any one of claims 1 to 5 when executed by the processor.
