Data request method and device based on gray scale isolation, equipment and medium
By introducing grayscale isolation for data requests in the distributed program architecture, the program, data and request grayscale parameters are configured, and query keys are generated to ensure data grayscale consistency, the problem of incomplete data isolation is solved and functional isolation is achieved. Validity and reliability of data acquisition.
Patent Information
- Application Number
- CN202411053847.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-02
AI Technical Summary
In distributed and multi-instance program architecture, the data lacks grayscale support, resulting in incomplete functional isolation, inability to achieve complete functional isolation, and even functional confusion, especially when configuration data has a direct impact on functions.
Provide a data request method based on grayscale isolation. By obtaining the change data associated with the update function, filtering dependent programs, configuring the program, data and requesting grayscale parameters to the same grayscale, and using grayscale parameters to generate when storing and querying data. Query the key, obtain the returned data from the memory, and ensure that the data grayscale parameters are consistent with the query key before reading it successfully.
It realizes effective grayscale isolation of data, ensures the effectiveness of functional isolation, avoids functional confusion, ensures that the grayscale range of data obtained by different versions of functions is different, and avoids the problem of obtaining new versions of the lower version to change data or original data coverage.
Smart Images

Figure CN119127281A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, in particular to the field of data request technology, and in particular to a data request method, device, equipment and medium based on grayscale isolation. Background Art
[0002] Currently, distributed, multi-instance program architecture has become the mainstream. By assigning different grayscales to programs, different functional versions of the same program can exist in the same environment at the same time. Through grayscale requests to the corresponding instances, functions such as functional isolation, parallel development, and grayscale launch can be achieved.
[0003] In the related technology, in the scenario where only the program supports grayscale isolation, the data does not have corresponding grayscale support. When the function is related to specific data, especially when the configuration data has a direct impact on the function, the data cannot be effectively isolated, resulting in incomplete grayscale isolation of the function, and unable to achieve complete functional isolation, and even causing functional confusion. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a data request method, device, equipment, medium and product based on grayscale isolation, which can also assign grayscale to data, realize effective grayscale isolation of data, and ensure the effectiveness of functional isolation.
[0005] In a first aspect, an embodiment of the present application provides a data request method based on grayscale isolation, the method comprising: when testing an update function, obtaining change data associated with the update function; screening N programs that the update function depends on from various programs, and determining that the program used to maintain the change data among the N programs is the first program; configuring the program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function to the same grayscale; storing the change data and its data grayscale parameters in association with each other in a memory, wherein the memory is also used to store original data associated with the update function, and the original data and its data grayscale parameters are related The method comprises the following steps: storing the original data and the changed data in a linked manner, wherein the data grayscale parameters of the original data and the changed data are used to indicate different grayscales; receiving a data request for an update function, wherein the data request is used to obtain multiple pieces of returned data, and the multiple pieces of returned data include changed data and / or original data; when a target program among N programs receives the data request, a query key is generated based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and the query key is used to obtain the multiple pieces of returned data from the memory; wherein, for each piece of returned data, if the data grayscale parameter of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
[0006] In some implementation methods of the first aspect, a query key is generated based on a request grayscale parameter carried in a data request or a program grayscale parameter of a target program, and multiple return data are obtained from a memory using the query key, including: generating a query key based on the request grayscale parameter carried in the data request to obtain a first query key; generating a query key based on the program grayscale parameter of the target program to obtain a second query key; and obtaining multiple return data from the memory using the first query key and / or the second query key.
[0007] In some implementations of the first aspect, multiple return data are obtained from the memory using the first query key and / or the second query key, including: for each return data, when N programs are configured with the same grayscale, a local grayscale priority strategy is executed; wherein the local grayscale priority strategy includes: using the second query key to read the return data from the memory for the first time, and the reading is successful when the return data is changed data, and the reading fails when the return data is original data.
[0008] In some implementation methods of the first aspect, program grayscale parameters of N programs, data grayscale parameters of changed data, and request grayscale parameters of data requests for update functions are all configured as target grayscales, and data grayscale parameters of original data are configured as preset initial grayscales. The local grayscale priority strategy also includes: for returned data that fails to read, a query key is generated based on the preset initial grayscale to obtain a third query key; the returned data is read again from the memory using the third query key to obtain the original data requested to be returned.
[0009] In some implementations of the first aspect, a program other than the first program among the N programs is a second program, and a plurality of return data are obtained from a memory using a first query key and / or a second query key, including: for each return data, when the second program and the first program are configured with different grayscales, executing a request grayscale priority strategy; wherein the request grayscale priority strategy includes: reading the return data from the memory for the first time using the first query key, and successfully reading when the return data is changed data, and failing to read when the return data is original data.
[0010] In some implementation methods of the first aspect, the program grayscale parameters of the first program, the data grayscale parameters of the changed data, and the request grayscale parameters of the data request of the update function are all configured as target grayscale, and the program grayscale parameters of the second program and the data grayscale parameters of the original data are all configured as preset initial grayscale. The local grayscale priority strategy also includes: for the return data that fails to read, determining whether the request grayscale parameters carried in the data request are consistent with the program grayscale parameters of the target program; when the two are consistent, generating a third query key based on the preset initial grayscale, and using the third query key to read the return data from the memory again to obtain the original data requested to be returned; when the two are inconsistent, using the second query key to read the return data from the memory again to obtain the original data requested to be returned.
[0011] In some implementations of the first aspect, each piece of data in a memory is stored in association with a key, the key of each piece of data is generated based on a data grayscale parameter of each piece of data, and the changed data and its data grayscale parameter are stored in association with each other in the memory, including: generating a key of the changed data based on the data grayscale parameter of the changed data; storing the changed data and its key in association with each other in the memory; wherein, for each piece of returned data, if the key of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
[0012] In a second aspect, an embodiment of the present application provides a data request device based on grayscale isolation, the device comprising: an acquisition module, used to acquire change data associated with an update function when testing the update function; a screening module, used to screen N programs on which the update function depends from various programs, and determine that the program used to maintain the change data among the N programs is the first program; a grayscale configuration module, used to configure the program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function to the same grayscale; an associated storage module, used to associate and store the change data and its data grayscale parameters in a memory, wherein the memory is also used to store original data associated with the update function, the original data and Its data grayscale parameters are stored in association, and the data grayscale parameters of the original data and the changed data are used to indicate different grayscales; a receiving module is used to receive a data request for an update function, wherein the data request is used to obtain multiple return data, and the multiple return data include changed data and / or original data; a data query module is used to generate a query key based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program when a target program among N programs receives a data request, and use the query key to obtain multiple return data from a memory; wherein, for each return data, if the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, the return data is read successfully, otherwise the reading fails.
[0013] In some implementation methods of the second aspect, the data query module includes: a generation unit, used to generate a query key based on the request grayscale parameters carried in the data request to obtain a first query key; the generation unit is also used to generate a query key based on the program grayscale parameters of the target program to obtain a second query key; a data acquisition unit, used to use the first query key and / or the second query key to obtain multiple return data from the memory.
[0014] In some implementation methods of the second aspect, the data acquisition unit is specifically used to: for each piece of returned data, when N programs are configured with the same grayscale, execute a local grayscale priority strategy; wherein the local grayscale priority strategy includes: using a second query key to read the returned data from the memory for the first time, and reading successfully when the returned data is changed data, and failing to read when the returned data is original data.
[0015] In some implementation methods of the second aspect, program grayscale parameters of N programs, data grayscale parameters of changed data, and request grayscale parameters of data requests for update functions are all configured as target grayscales, and data grayscale parameters of original data are configured as preset initial grayscales. The local grayscale priority strategy also includes: for return data that fails to read, a query key is generated based on the preset initial grayscale to obtain a third query key; the return data is read again from the memory using the third query key to obtain the original data requested to be returned.
[0016] In some implementations of the second aspect, the programs other than the first program among the N programs are the second program, and the data acquisition unit is specifically used to: for each piece of returned data, when the second program and the first program are configured with different grayscales, execute a request grayscale priority strategy; wherein the request grayscale priority strategy includes: using the first query key to read the returned data from the memory for the first time, and successfully reading when the returned data is changed data, and failing to read when the returned data is original data.
[0017] In some implementation methods of the second aspect, the program grayscale parameters of the first program, the data grayscale parameters of the changed data, and the request grayscale parameters of the data request of the update function are all configured as target grayscale, and the program grayscale parameters of the second program and the data grayscale parameters of the original data are all configured as preset initial grayscale. The local grayscale priority strategy also includes: for the return data that fails to read, determining whether the request grayscale parameters carried in the data request are consistent with the program grayscale parameters of the target program; when the two are consistent, generating a third query key based on the preset initial grayscale, and using the third query key to read the return data from the memory again to obtain the original data requested to be returned; when the two are inconsistent, using the second query key to read the return data from the memory again to obtain the original data requested to be returned.
[0018] In some implementations of the second aspect, each piece of data in the memory is stored in association with a key, the key of each piece of data is generated based on the data grayscale parameters of each piece of data, and the associated storage module is specifically used to: generate a key of the changed data based on the data grayscale parameters of the changed data; store the changed data and its key in association with each other in the memory; wherein, for each piece of returned data, if the key of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the data request method based on grayscale isolation as in the first aspect are implemented.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the steps of the data request method based on grayscale isolation as in the first aspect are implemented.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, which is stored in a non-volatile storage medium, and when the computer program product is executed by a processor, implements the steps of the data request method based on grayscale isolation as in the first aspect.
[0022] In a sixth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the data request method based on grayscale isolation as in the first aspect.
[0023] The present application provides a data request method, device, equipment, medium and product based on grayscale isolation. When testing the update function, the change data associated with the update function is obtained; N programs that the update function depends on are screened from each program, and the program used to maintain the change data among the N programs is determined to be the first program. The program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function are all configured to the same grayscale. Based on this, the change data and its data grayscale parameters, the original data and its data grayscale parameters can be associated and stored in a memory, and the data grayscale parameters of the original data and the change data are used to indicate different grayscales, so that different grayscale data can be stored in the same memory at the same time, without setting an independent (physical, logical) memory for each grayscale data, and realizing grayscale isolation of data stored in the same memory. In addition, the data grayscale parameters of the change data can directly reuse the program grayscale parameters of the first program, and the developer does not need to perform any additional configuration and encoding work for the grayscale data, and can simply and efficiently realize data grayscale isolation. On this basis, when the target program receives a data request for an update function, a query key can be generated based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and the query key can be used to obtain multiple return data from the memory, and the return data is read successfully only when the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, thereby ensuring the reliability and accuracy of data acquisition when data requests for different functions are acquired. In this way, in the scenario where the change data and the original data are distinguished in grayscale in the memory, the change data and the original data will not be confused or overwritten with each other in the memory, thereby ensuring that the grayscale ranges of the data read by different version functions are different, avoiding the low version function from obtaining the high version change data, and avoiding the original data overwriting the change data when the program is restarted, resulting in the update function being unable to obtain the change data. By assigning grayscale to the program, data, and data request, the effectiveness of functional isolation is guaranteed to avoid functional confusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.
[0025] Figure 1 It is a flowchart of a data request method based on grayscale isolation provided by an embodiment of the present application;
[0026] Figure 2 is a flowchart of a data request method based on grayscale isolation provided by another embodiment of the present application;
[0027] Figure 3 is a flowchart of a data request method based on grayscale isolation provided in yet another embodiment of the present application;
[0028] Figure 4 It is a structural schematic diagram of a data request device based on grayscale isolation provided in an embodiment of the present application;
[0029] Figure 5 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present application clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present application. The exemplary embodiments provided herein are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians of the art without creative work are within the scope of protection of this application.
[0031] In this document, terms such as first, second, third, etc. are only used to distinguish one entity (or operation) from another entity (or operation), but not to require or imply any order or relationship between these entities (or operations).
[0032] The following is a detailed description of the data request method based on grayscale isolation provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0033] Figure 1 It is a flow chart of a data request method based on grayscale isolation provided in an embodiment of the present application. The executor of the data request method based on grayscale isolation can be an application. By splitting an application into different parts, individual programs can be obtained. Therefore, the application can be composed of individual programs. Each program is a distributed application, which is a group of computer programs distributed on multiple computing nodes. Each node is an independent physical device or software process, but all work to realize the functions of the application.
[0034] The following takes the execution subject of the data request method based on grayscale isolation as an application as an example to illustrate the data request method based on grayscale isolation of the present application. It should be noted that the above execution subject and application scenario do not constitute a limitation on the present application.
[0035] like Figure 1 As shown, the data request method based on grayscale isolation provided in the embodiment of the present application may include steps 110 to 160.
[0036] Step 110, when the update function is tested, obtaining change data associated with the update function;
[0037] Step 120, screening N programs that the update function depends on from various programs, and determining a program for maintaining the changed data among the N programs as the first program;
[0038] Step 130, configuring the program grayscale parameter of the first program, the data grayscale parameter of the changed data, and the request grayscale parameter of the data request of the update function to the same grayscale;
[0039] Step 140, the changed data and its data grayscale parameters are stored in association in a memory, the memory is also used to store original data associated with the update function, the original data and its data grayscale parameters are stored in association, and the data grayscale parameters of the original data and the changed data are used to indicate different grayscales;
[0040] Step 150, receiving a data request for an update function, the data request is used to obtain multiple return data;
[0041] Step 160, when the target program among N programs receives a data request, a query key is generated based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and the query key is used to obtain multiple return data from the memory, wherein for each return data, if the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, the return data is read successfully, otherwise the reading fails.
[0042] The data request method based on grayscale isolation provided by the embodiment of the present application obtains the change data associated with the update function when the update function is tested; N programs that the update function depends on are screened from each program, and the program used to maintain the change data among the N programs is determined to be the first program. The program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function are all configured to the same grayscale. Based on this, the change data and its data grayscale parameters, the original data and its data grayscale parameters can be associated and stored in the memory, and the data grayscale parameters of the original data and the change data are used to indicate different grayscales, so that different grayscale data can be stored in the same memory at the same time, without setting an independent (physical, logical) memory for each grayscale data, and realizing grayscale isolation of data stored in the same memory. In addition, the data grayscale parameters of the change data can directly reuse the program grayscale parameters of the first program, and the developer does not need to perform any additional configuration and encoding work for the grayscale data, and can simply and efficiently realize data grayscale isolation. On this basis, when the target program receives a data request for an update function, a query key can be generated based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and the query key can be used to obtain multiple return data from the memory, and the return data is read successfully only when the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, thereby ensuring the reliability and accuracy of data acquisition when data requests for different functions are acquired. In this way, in the scenario where the change data and the original data are distinguished in grayscale in the memory, the change data and the original data will not be confused or overwritten with each other in the memory, thereby ensuring that the grayscale ranges of the data read by functions of different versions are different, avoiding the low-version function from obtaining the change data of the high-version, and avoiding the original data overwriting the change data when the program is restarted, resulting in the update function being unable to obtain the change data. By assigning grayscale to the program, data, and data request, the effectiveness of function isolation is guaranteed.
[0043] The specific implementation of the above steps will be described in detail below in conjunction with specific embodiments.
[0044] In step 110 , when the update function is tested, change data associated with the update function is obtained.
[0045] In step 110, the update function is the application function updated when the version of the application is upgraded. Before the update function is officially launched, the tester needs to test the update function to ensure the normal operation of the update function. The change data is the data that needs to be changed when the application function is updated, such as the data items that are added, deleted, or modified. Therefore, after the update function is developed, the memory needs to maintain the change data on the basis of maintaining the original data of the stable (old) version of the application.
[0046] For example, the application is a job search application, and the developer has developed an update function for the job search application, which is used to optimize and update the style of the resume filling interface of the job search application. For example, the list width before the update is 100 and the input box cursor color is black, and the list width after the update is 120 and the input box cursor color is red. Then "list width is 100" and "input box cursor color is black" are the original data, and "list width is 120" and "input box cursor color is red" are the changed data.
[0047] In step 120 , N programs that the update function depends on are screened from various programs, and a program for maintaining the changed data among the N programs is determined as the first program.
[0048] In step 120, the N programs are distributed application programs that need to be called when the update function is running. Not all of the N programs need to maintain change data, and those programs that do not need to maintain change data may be second programs.
[0049] For example, the second program may be an open interface, which is only used to receive data requests sent by the front end, and after the first program obtains the requested data, the second program returns it to the front end; for another example, the second program is a program for maintaining the original data. In addition to relying on the changed data, the operation of the update function also needs to rely on a part of the original data. Therefore, when the update function is implemented, it is also necessary to read the original data through the second program.
[0050] For example, the update function is used to optimize and update the style of the resume filling interface of the job application, so it is necessary to return the interface style parameters to the front end, and the interface style parameters include parameters b and c. Among them, program A is used to receive the parameter acquisition request from the front end and return the interface style parameters to the front end, program B is used to maintain parameter b, and program C is used to maintain parameter c. Parameter b is the changed data, and parameter c is the original data. Then programs A and C are the second program, and program B is the first program.
[0051] In step 130 , the program grayscale parameter of the first program, the data grayscale parameter of the changed data, and the request grayscale parameter of the data request of the update function are all configured to the same grayscale.
[0052] In step 130, the program grayscale parameter is a parameter for indicating the program grayscale, the data grayscale parameter is a parameter for indicating the data grayscale, and the request grayscale parameter is a parameter for indicating the request grayscale. Among them, the data grayscale parameter of the change data and the request grayscale parameter of the data request of the update function can directly reuse the program grayscale parameter of the first program, that is, the program grayscale parameter, the data grayscale parameter and the request grayscale parameter are the same, ensuring that the grayscale of the first program, the change data and all the data requests of the update function are consistent.
[0053] Specifically, each program corresponds to a configuration file, and the program grayscale parameters can be set in the configuration file; the change data is stored in the memory in the form of key-value pairs, and the data grayscale parameters can be set in the key; the request grayscale parameters can be set in the request header of the data request.
[0054] Exemplarily, "spring.cloud.nacos.discovery.metadata.color:nocolor" is the original program grayscale parameter of the first program, which indicates that the program grayscale is nocolor. By changing it to "spring.cloud.nacos.discovery.metadata.color:blue", the first program is configured to blue grayscale. Accordingly, all data requests for change data and update functions are also configured to blue grayscale.
[0055] Involving step 140, the changed data and its data grayscale parameters are associated and stored in a memory, the memory is also used to store original data associated with the update function, the original data and its data grayscale parameters are associated and stored, and the data grayscale parameters of the original data and the changed data are used to indicate different grayscales.
[0056] In step 140, the memory is used to store the original data and the changed data maintained by each program, and the original data and the changed data are stored in association with their data grayscale parameters. Therefore, by configuring the data grayscale parameters of the original data and the changed data as different parameters, different grayscale data can be stored in the same memory at the same time, without setting up an independent (physical, logical) memory for each grayscale data, so as to achieve grayscale isolation of data stored in the same memory.
[0057] In some embodiments of the present application, each piece of data in the memory is stored in association with a key, and the key of each piece of data is generated based on the data grayscale parameter of each piece of data. The above step 140 stores the changed data and its data grayscale parameter in association with each other in the memory, which may specifically include:
[0058] Generate the key of the changed data based on the data grayscale parameter of the changed data;
[0059] Store the changed data and its key in memory;
[0060] For each piece of returned data, if the key of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
[0061] In the embodiment of the present application, the data grayscale parameter is used as part of the key. By storing the changed data and its key, the original data and its key in the form of a key-value pair, a mapping relationship between each piece of data and the data grayscale can be established in the memory, and all the data in the memory can be grayscale divided, so that different grayscale data can be stored in the same memory at the same time, without setting up an independent (physical, logical) memory for each grayscale data, so as to achieve data grayscale isolation in the same memory. In addition, the data grayscale parameter can directly reuse the program grayscale parameter of the first program, and directly add the data grayscale parameter as a parameter in the existing key. Developers do not need to perform any additional configuration or encoding work for the grayscale data, and can simply and efficiently achieve data grayscale isolation.
[0062] In some embodiments, the memory includes multiple storage spaces, each program corresponds to a storage space, and the storage space is used to store all data maintained by the program, that is, original data and / or changed data.
[0063] Involving step 150, receiving a data request for an update function, the data request is used to obtain multiple return data, and the multiple return data include changed data and / or original data.
[0064] In step 150, the data request is used to test whether the update function can be implemented normally, so the data request is a function test request. Since the data that the update function relies on during operation may include original data in addition to the changed data, the multiple return data returned by the request may include changed data and / or original data.
[0065] Exemplarily, the update function is used to optimize and update the style of the resume filling interface of the job search application, specifically to update the list width. However, the multiple return data requested in the data request, in addition to the updated list width, also include unupdated CSS initialization parameters, CSS responsive layout parameters, etc. These unupdated CSS initialization parameters and CSS responsive layout parameters are the original data under the stable version.
[0066] Involving step 160, when a target program among N programs receives a data request, a query key is generated based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and the query key is used to obtain multiple return data from the memory, wherein for each return data, if the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, the return data is read successfully, otherwise the reading fails.
[0067] In step 160, the target program is the program that receives the data request, and the target program can be the first program or the second program, which is not specifically limited in this application. In the case where the target program receives the data request among N programs, a local grayscale priority strategy or a request grayscale priority strategy can be adopted to obtain multiple return data.
[0068] In some embodiments of the present application, Figure 2 It is a flow chart of a data request method based on grayscale isolation provided in another embodiment of the present application. In the above step 160, a query key is generated based on the request grayscale parameters carried in the data request or the program grayscale parameters of the target program, and the query key is used to obtain multiple return data from the memory, which can specifically include steps 210-230.
[0069] Step 210, generating a query key based on the request grayscale parameter carried in the data request, and obtaining a first query key;
[0070] Step 220, generating a query key based on the program grayscale parameter of the target program to obtain a second query key;
[0071] Step 230: using the first query key and / or the second query key, obtain multiple return data from the memory.
[0072] In the embodiment of the present application, the first query key is generated based on the request grayscale parameter, and the request grayscale parameter is consistent with the data grayscale parameter of the changed data, so the first query key can be used to effectively obtain the changed data from the memory. The second query key is generated based on the program grayscale parameter of the target program, so the second query key can be used to effectively obtain data matching the program grayscale from the memory, realizing data reading in the data grayscale isolation scenario.
[0073] In some embodiments of the present application, the N programs that the update function depends on can be configured to the same grayscale. In this scenario, even if the target program that currently receives the data request does not maintain the changed data, it can be assigned a grayscale consistent with the changed data. In this way, a local grayscale priority strategy is adopted to read data from the memory, ensuring that the changed data and the original data can be successfully read in the data grayscale isolation scenario.
[0074] Based on the above scenario where the N programs that the update function depends on are all configured to the same grayscale, the above step 230 uses the first query key and / or the second query key to obtain multiple return data from the memory, which may specifically include the following steps:
[0075] For each piece of returned data, when N programs are configured with the same grayscale, the local grayscale priority strategy is executed;
[0076] The local grayscale priority strategy includes: using the second query key to read the returned data from the memory for the first time, and reading successfully when the returned data is changed data, and reading fails when the returned data is original data.
[0077] Exemplarily, the multiple returned data include parameter b and parameter c, parameter b is the changed data, parameter c is the original data, the data grayscale parameter of parameter b in the memory indicates blue grayscale, and the data grayscale parameter of parameter c indicates nocolor grayscale. The second query key is generated based on the program grayscale parameter of the target program, and the program grayscale parameter of the target program indicates blue grayscale. Therefore, when the second query key is used to obtain parameter b from the memory, since the second query key and the data grayscale parameter of parameter b indicate the same grayscale, parameter b can be successfully read; since the second query key and the data grayscale parameter of parameter c indicate different grayscales, parameter c cannot be successfully read.
[0078] In the embodiment of the present application, since the program grayscale of the first program is consistent with the data grayscale of the changed data, the program grayscales of the N programs including the target program are consistent with the data grayscale of the changed data. Based on this, in the local grayscale priority strategy, the second query key and the data grayscale parameter of the changed data indicate the same grayscale, so the second query key can be used to directly and accurately obtain the changed data from the memory. In this way, when the requested return data only contains the changed data, all the returned data can be successfully queried using the second query key, ensuring the reliability of data acquisition.
[0079] In some embodiments of the present application, when the requested return data includes changed data and original data, in order to successfully return all data, the program grayscale parameters of N programs, the data grayscale parameters of the changed data, and the request grayscale parameters of the data request of the update function are all configured as the target grayscale, and the data grayscale parameters of the original data are configured as the preset initial grayscale. The above-mentioned local grayscale priority strategy may also include:
[0080] For the returned data that failed to be read, a query key is generated based on the preset initial grayscale to obtain a third query key;
[0081] The returned data is read again from the memory using the third query key to obtain the original data requested to be returned.
[0082] Specifically, the target grayscale is different from the preset initial grayscale. For example, the preset initial grayscale may be nocolor, and the data grayscale parameter of the original data is configured as "nocolor" to indicate that the original data is nocolor; or the preset initial grayscale may be blank grayscale, and the data grayscale parameter of the original data is configured as empty to indicate that the original data is blank grayscale. If the target grayscale is blue grayscale, the data grayscale parameter of the original data is configured as "blue" to indicate that the program grayscales of N programs, the data grayscale of the changed data, and the request grayscale of the data request of the update function are all blue grayscale.
[0083] Referring to the above example, parameter b can be successfully read using the second query key, but parameter c cannot be successfully read. Based on this, a third query key is generated based on the preset initial grayscale. Since the data grayscale parameters of the third query key and parameter c both indicate the preset initial grayscale "nocolor", parameter c can be successfully read.
[0084] In an embodiment of the present application, for the returned data with a failed read result, it can be directly determined to be the original data. Based on this, since the third query key is generated using the preset initial grayscale, and the data grayscale parameter of the original data in the memory also indicates the preset initial grayscale, the original data can be successfully read from the memory using the third query key. In this way, in the local grayscale priority strategy, by using the combination of the second query key and the third query key, all returned data can be accurately obtained in the memory that supports data grayscale isolation, and the reliability of data reading is guaranteed under the premise of complete isolation of functional grayscale.
[0085] In some embodiments of the present application, the programs other than the first program in the N programs are the second programs, and the first program and the second program can be configured with different grayscales to distinguish the grayscales between the two types of programs that maintain the changed data and those that do not. In this scenario, when the target program receiving the data request is the second program, in order to avoid being unable to read the changed data using the second query key generated by the program grayscale parameters, a request grayscale priority strategy can be used to read data from the memory, ensuring that the changed data and the original data can be successfully read in the data grayscale isolation scenario.
[0086] Based on the above scenario where the first program and the second program on which the update function depends are configured as different grayscales, the above step 230 uses the first query key and / or the second query key to obtain multiple return data from the memory, which may specifically include the following steps:
[0087] For each piece of returned data, when the second program and the first program are configured with different grayscales, a request grayscale priority strategy is executed;
[0088] Among them, requesting a grayscale priority strategy includes: using the first query key to read the returned data from the memory for the first time, and reading successfully when the returned data is changed data, and reading fails when the returned data is original data.
[0089] Exemplarily, the multiple returned data include parameter b and parameter c, parameter b is the changed data, parameter c is the original data, the data grayscale parameter of parameter b in the memory indicates blue grayscale, and the data grayscale parameter of parameter c indicates nocolor grayscale. The first query key is generated based on the request grayscale parameter of the data request, and the request grayscale parameter indicates blue grayscale. Therefore, when the first query key is used to obtain parameter b from the memory, since the first query key and the data grayscale parameters of parameter b indicate the same grayscale, parameter b can be successfully read; since the first query key and the data grayscale parameters of parameter c indicate different grayscales, parameter c cannot be successfully read.
[0090] In some embodiments of the present application, the program grayscale parameters of the first program, the data grayscale parameters of the changed data, and the request grayscale parameters of the data request of the update function are all configured as the target grayscale, and the program grayscale parameters of the second program and the data grayscale parameters of the original data are all configured as the preset initial grayscale. The above-mentioned local grayscale priority strategy may also include:
[0091] For the returned data that fails to be read, determine whether the requested grayscale parameters carried in the data request are consistent with the program grayscale parameters of the target program;
[0092] If the two are consistent, a third query key is generated based on the preset initial grayscale, and the returned data is read again from the memory using the third query key to obtain the requested returned original data;
[0093] In the case of inconsistency between the two, the returned data is read again from the memory using the second query key to obtain the original data requested to be returned.
[0094] Referring to the above example, parameter b can be successfully read using the first query key, but parameter c cannot be successfully read. Based on this, we can further compare whether the request grayscale parameter carried in the data request is consistent with the program grayscale parameter of the target program. If the two are consistent, it indicates that the target program is the first program, the target program is blue grayscale, and parameter c cannot be obtained using the second query key. Therefore, a new third query key is generated based on the preset initial grayscale nocolor to ensure that parameter c can be successfully obtained; if the two are inconsistent, it indicates that the target program is the second program, the target program is nocolor grayscale, so parameter c can be directly obtained using the second query key.
[0095] In an embodiment of the present application, for the returned data with a failed read result, it can be directly determined to be the original data. Based on this, it is possible to further compare whether the request grayscale parameters carried in the data request are consistent with the program grayscale parameters of the target program. If the two are consistent, it indicates that the target program is the first program, and the target program is also the target grayscale, and the original data cannot be obtained using the second query key. Therefore, a new third query key is generated based on the preset initial grayscale to ensure that the original data can be successfully obtained. If the two are inconsistent, it indicates that the target program is the second program, and the target program is the preset initial grayscale, so the second query key can be used directly to obtain the original data, without generating a new query key, saving resources. In this way, using the first query key and the third query key, or the combination of the first query key and the second query key, all returned data can be accurately obtained in a memory that supports data grayscale isolation, and the reliability of data reading is guaranteed under the premise of complete isolation of functional grayscale.
[0096] In some embodiments of the present application, when an application is performing a functional upgrade, the functions of different upgraded versions correspond to different grayscales. Since different update functions of the same upgrade version may be the responsibility of different testers, even for the same upgrade version, the various update functions involved may correspond to different grayscales.
[0097] In some embodiments of the present application, for the local grayscale priority strategy, the return data first read from the memory using the second query key is the priority data, and the return data read from the memory again using the third query key is the delayed data; for the request grayscale priority strategy, the return data first read from the memory using the first query key is the priority data, and the return data read from the memory again using the second query key or the third query key is the delayed data.
[0098] The above-mentioned priority acquisition data can be regarded as priority matching data, and the delayed acquisition data can be regarded as borrowed data obtained through the borrowing operation.
[0099] As a specific example, for the local grayscale-first strategy, Figure 3 FIG. 1 is a flow chart of a data request method based on grayscale isolation provided in another embodiment of the present application. Figure 3 As shown, storage is a memory, and data request 3.1 is a data request for updating function 1. The data request is in blue grayscale. Therefore, after receiving the data request 3.1, app instance 1 in blue grayscale can <color:blue>The blue grayscale change data is directly read from the storage space and returned. For the original data of the nocolor grayscale that is not queried, it can be obtained from the nocolor grayscale appinstance3 maintained<no color> Borrowed from storage and returned.
[0100] Data requests 3.2 and 3.3 are both data requests for update function 2. In order to distinguish them from the data requests for update function 1, the data requests for update function 2 are configured as red grayscale.
[0101] For data request 3.2, the program that receives data request 3.2 is app instance3 in nocolor grayscale, so it can be maintained by<no color> The original data of nocolor grayscale is read from the storage space and returned. For the changed data of red grayscale that is not queried, the data can be obtained from the red grayscale app instance2 maintained by the <color:red>Borrowed from storage and returned.
[0102] For data request 3.3, the program that receives data request 3.3 is app instance2 in red grayscale, so it can be maintained by <color:red>The red grayscale change data is read from the storage space and returned. For the original data of nocolor grayscale that is not queried, it can be obtained from the data maintained by app instance3 of nocolor grayscale.<no color> Borrowed from storage and returned.
[0103] The above data request process can request matching changed data and original data for each update function when receiving data requests for different grayscale update functions, thereby improving the reliability of data request and reading in the data grayscale isolation scenario.
[0104] Corresponding to the method embodiment of the present application, the present application also provides a data request device based on grayscale isolation.
[0105] Figure 4 Schematic diagram of a data request device based on grayscale isolation provided by an embodiment of the present application. Figure 4 As shown, the data request device 400 based on grayscale isolation may include: an acquisition module 410 , a screening module 420 , a grayscale configuration module 430 , an associated storage module 440 , a receiving module 450 and a data query module 460 .
[0106] Among them, the acquisition module 410 is used to obtain the change data associated with the update function when testing the update function; the screening module 420 is used to screen N programs that the update function depends on from various programs, and determine that the program used to maintain the change data among the N programs is the first program; the grayscale configuration module 430 is used to configure the program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function to the same grayscale; the associated storage module 440 is used to associate the change data and its data grayscale parameters and store them in the memory, wherein the memory is also used to store the original data associated with the update function, the original data and its data grayscale parameters are associated and stored, and the original The data grayscale parameters of the initial data and the changed data are used to indicate different grayscales; a receiving module 450 is used to receive a data request for an update function, wherein the data request is used to obtain multiple return data, and the multiple return data include change data and / or original data; a data query module 460 is used to generate a query key based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program when a target program among N programs receives a data request, and use the query key to obtain multiple return data from the memory; wherein, for each return data, if the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, the return data is read successfully, otherwise the reading fails.
[0107] The data request device based on grayscale isolation provided by the embodiment of the present application obtains the change data associated with the update function when testing the update function; selects N programs that the update function depends on from each program, and determines that the program used to maintain the change data among the N programs is the first program. The program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function are all configured to the same grayscale. Based on this, the change data and its data grayscale parameters, the original data and its data grayscale parameters can be associated and stored in the memory, and the data grayscale parameters of the original data and the change data are used to indicate different grayscales, so that different grayscale data can be stored in the same memory at the same time, without setting an independent (physical, logical) memory for each grayscale data, and realizing grayscale isolation of data stored in the same memory. In addition, the data grayscale parameters of the change data can directly reuse the program grayscale parameters of the first program, and the developer does not need to perform any additional configuration and encoding work for the grayscale data, and can simply and efficiently realize data grayscale isolation. On this basis, when the target program receives a data request for an update function, a query key can be generated based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and the query key can be used to obtain multiple return data from the memory, and the return data is read successfully only when the data grayscale parameter of the return data in the memory indicates the same grayscale as the query key, thereby ensuring the reliability and accuracy of data acquisition when data requests for different functions are acquired. In this way, in the scenario where the change data and the original data are distinguished in grayscale in the memory, the change data and the original data will not be confused or overwritten with each other in the memory, thereby ensuring that the grayscale ranges of the data read by functions of different versions are different, avoiding the low-version function from obtaining the change data of the high-version, and avoiding the original data overwriting the change data when the program is restarted, resulting in the update function being unable to obtain the change data. By assigning grayscale to the program, data, and data request, the effectiveness of function isolation is guaranteed.
[0108] In some embodiments of the present application, the data query module 460 includes: a generation unit, used to generate a query key based on the request grayscale parameters carried in the data request to obtain a first query key; the generation unit is also used to generate a query key based on the program grayscale parameters of the target program to obtain a second query key; a data acquisition unit, used to use the first query key and / or the second query key to obtain multiple return data from the memory.
[0109] In some embodiments of the present application, the data acquisition unit is specifically used to: for each piece of returned data, when N programs are configured with the same grayscale, execute a local grayscale priority strategy; wherein the local grayscale priority strategy includes: using a second query key to read the returned data from the memory for the first time, and reading successfully when the returned data is changed data, and failing to read when the returned data is original data.
[0110] In some embodiments of the present application, program grayscale parameters of N programs, data grayscale parameters of change data, and request grayscale parameters of data requests for update functions are all configured as target grayscales, and data grayscale parameters of original data are configured as preset initial grayscales. The local grayscale priority strategy also includes: for return data that fails to read, a query key is generated based on the preset initial grayscale to obtain a third query key; the return data is read again from the memory using the third query key to obtain the original data requested to be returned.
[0111] In some embodiments of the present application, the program other than the first program among N programs is the second program, and the data acquisition unit is specifically used to: for each piece of returned data, when the second program and the first program are configured with different grayscales, execute a request grayscale priority strategy; wherein the request grayscale priority strategy includes: using the first query key to read the returned data from the memory for the first time, and successfully reading when the returned data is changed data, and failing to read when the returned data is original data.
[0112] In some embodiments of the present application, the program grayscale parameters of the first program, the data grayscale parameters of the changed data, and the request grayscale parameters of the data request of the update function are all configured as target grayscale, and the program grayscale parameters of the second program and the data grayscale parameters of the original data are all configured as preset initial grayscale. The local grayscale priority strategy also includes: for the return data that fails to read, determining whether the request grayscale parameters carried in the data request are consistent with the program grayscale parameters of the target program; if the two are consistent, generating a third query key based on the preset initial grayscale, and using the third query key to read the return data from the memory again to obtain the original data requested to be returned; if the two are inconsistent, using the second query key to read the return data from the memory again to obtain the original data requested to be returned.
[0113] In some embodiments of the present application, each piece of data in the memory is stored in association with a key, the key of each piece of data is generated based on the data grayscale parameters of each piece of data, and the associated storage module is specifically used to: generate the key of the changed data based on the data grayscale parameters of the changed data; store the changed data and its key in association with each other in the memory; wherein, for each piece of returned data, if the key of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
[0114] The data request device based on grayscale isolation provided in the embodiment of the present application can achieve Figure 1-3 The various processes implemented by the service platform in the method embodiment can achieve the same technical effect. To avoid repetition, they will not be described here.
[0115] Figure 5 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0116] like Figure 5 As shown, the electronic device 500 includes a memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0117] In an example, the processor 502 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0118] The memory 501 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it can be operated to perform the operations described with reference to the card opening method in the embodiment according to the first aspect of the present application.
[0119] The processor 502 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 501, so as to implement the card activation method in the embodiment of the first aspect.
[0120] In some examples, the electronic device 500 may further include a communication interface 503 and a bus 510. Figure 5 As shown, the memory 501, the processor 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.
[0121] The communication interface 503 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 503 can also be used to access input devices and / or output devices.
[0122] The bus 510 includes hardware, software, or both, coupling the components of the electronic device 500 to each other. By way of example and not limitation, the bus 510 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 510 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0123] The electronic device provided in the embodiment of the present application can realize Figure 1-3 The various processes implemented by the electronic device in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described here.
[0124] In combination with the grayscale isolation-based data request method in the above embodiment, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, the steps of any one of the grayscale isolation-based data request methods in the above embodiment are implemented.
[0125] In combination with the grayscale isolation-based data request method in the above embodiment, the present application embodiment can provide a computer program product for implementation. The (computer) program product is stored in a non-volatile storage medium, and when the program product is executed by at least one processor, the steps of any one of the grayscale isolation-based data request methods in the above embodiment are implemented.
[0126] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned data request method embodiment based on grayscale isolation, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0127] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0128] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0129] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0130] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0131] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0132] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.< / color:red> < / color:red> < / color:blue>
Claims
1. A data request method based on grayscale isolation, characterized in that: include: When testing an update function, obtaining change data associated with the update function; Selecting N programs that the update function depends on from various programs, and determining a program for maintaining the change data among the N programs as a first program; configuring the program grayscale parameter of the first program, the data grayscale parameter of the change data, and the request grayscale parameter of the data request of the update function to be the same grayscale; The changed data and its data grayscale parameters are stored in association in a memory, wherein the memory is also used to store original data associated with the update function, the original data and its data grayscale parameters are stored in association, and the data grayscale parameters of the original data and the changed data are used to indicate different grayscales; Receiving a data request for the update function, wherein the data request is used to obtain a plurality of returned data, and the plurality of returned data include changed data and / or original data; When a target program among the N programs receives the data request, a query key is generated based on a request grayscale parameter carried in the data request or a program grayscale parameter of the target program, and the query key is used to obtain the plurality of returned data from the memory; For each piece of returned data, if the data grayscale parameter of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
2. The method according to claim 1, characterized in that: The generating a query key based on the request grayscale parameter carried in the data request or the program grayscale parameter of the target program, and obtaining the plurality of returned data from the memory using the query key, includes: Generate a query key based on the request grayscale parameter carried in the data request to obtain a first query key; Generate a query key based on the program grayscale parameter of the target program to obtain a second query key; The plurality of returned data are acquired from the memory using the first query key and / or the second query key.
3. The method according to claim 2, characterized in that The obtaining the plurality of returned data from the memory by using the first query key and / or the second query key includes: For each piece of returned data, when the N programs are all configured as the same grayscale, a local grayscale priority strategy is executed; Wherein, the local grayscale priority strategy includes: The returned data is read from the memory for the first time using the second query key, and the reading is successful when the returned data is changed data, and the reading fails when the returned data is original data.
4. The method according to claim 3, characterized in that The program grayscale parameters of the N programs, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function are all configured as target grayscales, the data grayscale parameters of the original data are configured as preset initial grayscales, and the local grayscale priority strategy further includes: For the returned data that failed to be read, a query key is generated based on the preset initial grayscale to obtain a third query key; The returned data is read again from the memory using the third query key to obtain the original data requested to be returned.
5. The method according to claim 2, characterized in that: The programs other than the first program among the N programs are second programs, and obtaining the plurality of returned data from the memory by using the first query key and / or the second query key includes: For each piece of returned data, when the second program and the first program are configured with different grayscales, a request grayscale priority strategy is executed; The grayscale priority strategy for requesting includes: The returned data is read from the memory for the first time using the first query key, and the reading is successful when the returned data is changed data, and the reading fails when the returned data is original data.
6. The method according to claim 5, characterized in that The program grayscale parameters of the first program, the data grayscale parameters of the changed data, and the request grayscale parameters of the data request of the update function are all configured as target grayscales, the program grayscale parameters of the second program and the data grayscale parameters of the original data are all configured as preset initial grayscales, and the local grayscale priority strategy further includes: For the returned data that fails to be read, determining whether the request grayscale parameter carried in the data request is consistent with the program grayscale parameter of the target program; If the two are consistent, a third query key is generated based on the preset initial grayscale, and the returned data is read again from the memory using the third query key to obtain the requested original data; In the case that the two are inconsistent, the returned data is read again from the memory using the second query key to obtain the original data requested to be returned.
7. The method according to claim 1, characterized in that Each piece of data in the memory is stored in association with a key, the key of each piece of data is generated based on a data grayscale parameter of each piece of data, and the changing data and its data grayscale parameter are stored in association with each other in the memory, including: Generate a key of the changed data based on a data grayscale parameter of the changed data; The changed data and its key are stored in association in a memory; For each piece of returned data, if the key of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
8. A data request device based on grayscale isolation, characterized in that: include: An acquisition module, used for acquiring change data associated with the update function when the update function is tested; A screening module, used for screening N programs on which the update function depends from various programs, and determining a program for maintaining the change data among the N programs as a first program; A grayscale configuration module, configured to configure the program grayscale parameters of the first program, the data grayscale parameters of the change data, and the request grayscale parameters of the data request of the update function to the same grayscale; An associated storage module, used for associating and storing the changed data and its data grayscale parameters in a memory, wherein the memory is also used for storing original data associated with the update function, the original data and its data grayscale parameters are stored in an associated manner, and the data grayscale parameters of the original data and the changed data are used to indicate different grayscales; A receiving module, used for receiving a data request for the update function, wherein the data request is used to obtain a plurality of returned data, and the plurality of returned data include changed data and / or original data; a data query module, configured to generate a query key based on a request grayscale parameter carried in the data request or a program grayscale parameter of the target program when a target program among the N programs receives the data request, and to obtain the plurality of returned data from the memory using the query key; For each piece of returned data, if the data grayscale parameter of the returned data in the memory indicates the same grayscale as the query key, the returned data is read successfully, otherwise the reading fails.
9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data upgrading and querying method and device
CN111782235A
Request processing method and system, computer equipment, storage medium and program product
CN116679976A
Database change gray release method and system and computer equipment
CN117149747A
Container cloud server and gray release method
CN117768513A
Data caching method, device and system
WO2019179235A1
