State value processing method, device, equipment and storage medium

By writing temporary status values ​​for intermediate orders during the refresh process and refreshing the status values ​​of historical orders to the latest status values, the problem of unreliable service caused by overlapping order status values ​​is solved, and refresh without stopping the service and improving the user experience are achieved.

CN115049510BActive Publication Date: 2025-09-16BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210724133.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2025-09-16
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

In the prior art, since the historical status value of an order partially overlaps with the latest status value, order-related services are unreliable when the status value is refreshed, affecting the user experience.

Method used

By obtaining the refresh instruction, the temporary status value of the intermediate order is written respectively, and the historical status value of the historical order is refreshed to the latest status value, ensuring that the temporary status value does not overlap with the historical status value, and the temporary status value does not overlap with the latest status value, so as to achieve refresh without stopping the service.

Benefits of technology

It ensures the logical correctness of the order status value refresh process, avoids data confusion, and improves the reliability and user experience of order-related services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049510B_ABST
    Figure CN115049510B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of digital health technology, and in particular to a status value processing method, apparatus, device and storage medium. The method comprises: after obtaining a refresh instruction for an order status value, receiving at least one first status write instruction corresponding to at least one intermediate order; writing a temporary status value corresponding to the order status of each intermediate order according to the at least one first status write instruction; refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction; refreshing the temporary status value of each intermediate order to the corresponding latest status value according to the refresh instruction. The present disclosure is used to solve the defect in the prior art that the order-related service is unreliable when the status value is refreshed due to the partial overlap between the historical status value and the latest status value of the order, and to achieve highly reliable refreshing of the status value of the order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of digital health technology, and in particular to a state value processing method, apparatus, device, and storage medium. Background Art

[0002] With the development of computer technology, orders in various fields are mostly managed through computer systems. One order usually corresponds to multiple order statuses. The computer system needs to set a corresponding status value for each order status, and write the status value corresponding to each order into the computer system to facilitate the subsequent storage, query, and other processing of a large number of orders. In the process of maintaining a large amount of order data, there is a need to refresh the status value, that is, it is necessary to refresh the historical status value written in each order history to the corresponding latest status value. When multiple historical status values ​​partially overlap with multiple latest status values, if the service is not stopped and refreshed directly, there will be data confusion when the new order status value is written during the refresh process, which will lead to unreliable order-related services and reduce user experience. If the service is directly stopped for refresh, the order-related services will be unavailable for a certain period of time, and the order-related services will also be unreliable, reducing user experience. Summary of the Invention

[0003] The present disclosure provides a status value processing method, apparatus, device and storage medium, which are used to solve the defect in the prior art that the historical status value of an order partially overlaps with the latest status value, resulting in unreliable order-related services when the status value is refreshed, and to achieve highly reliable refreshing of the status value of an order.

[0004] The present disclosure provides a status value processing method, comprising: after obtaining a refresh instruction for an order status value, receiving at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order; according to at least one first status write instruction, writing a temporary status value corresponding to the order status of each intermediate order; according to the refresh instruction, refreshing the historical status value of each historical order to the corresponding latest status value, wherein the historical order is an order into which the historical status value has been written before obtaining the refresh instruction; according to the refresh instruction, refreshing the temporary status value of each intermediate order to the corresponding latest status value, wherein the temporary status value does not overlap with the historical status value, the temporary status value does not overlap with the latest status value, and the historical status value partially overlaps with the latest status value.

[0005] According to a status value processing method provided by the present disclosure, the historical status value corresponds to the latest status value one-to-one; according to the refresh instruction, the historical status value of each historical order is refreshed to the corresponding latest status value, including: determining at least one of the latest status values ​​that does not overlap with the historical status value; refreshing the corresponding historical status values ​​respectively through at least one of the latest status values ​​that does not overlap; re-determining the latest status value that has not been refreshed and at least one of the latest status values ​​that does not overlap with the historical status value that has not been refreshed, and refreshing the corresponding historical status values ​​respectively through the re-determined at least one of the latest status values ​​that does not overlap, until each of the historical status values ​​is refreshed to the corresponding latest status value.

[0006] According to a status value processing method provided by the present disclosure, after writing the temporary status value corresponding to the order status of each of the intermediate orders according to at least one first status write instruction, it also includes: receiving a first read instruction, wherein the first read instruction includes a first order status, wherein the first order status is any one of the preset N order statuses, and N is an integer greater than 1; determining a first historical status value corresponding to the first order status, and determining a first temporary status value corresponding to the first order status, wherein the first historical status value is any one of the preset N historical status values, and the first temporary status value is any one of the preset N temporary status values; according to the first read instruction, obtaining each of the historical orders corresponding to the first historical status value, and obtaining each of the intermediate orders corresponding to the first temporary status value.

[0007] According to a status value processing method provided by the present disclosure, after refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, it also includes: receiving at least one second status write instruction corresponding to at least one refreshed order, wherein the second status write instruction includes the order status of the corresponding refreshed order; according to at least one second status write instruction, writing the latest status value corresponding to the order status of each refreshed order.

[0008] According to a status value processing method provided by the present disclosure, after refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, the method further includes: receiving a second read instruction, wherein the second read instruction includes a second order status, wherein the second order status is any one of the preset N order statuses, and N is an integer greater than 1; determining a second temporary status value corresponding to the second order status, and determining a second latest status value corresponding to the second order status, wherein the second temporary status value is any one of the preset N temporary status values, and the second latest status value is any one of the preset N latest status values; according to the second read instruction, obtaining each order corresponding to the second temporary status value, and obtaining each order corresponding to the second latest status value, wherein the orders include the historical orders, the intermediate orders and / or the refreshed orders.

[0009] According to a status value processing method provided by the present disclosure, the refresh instruction for obtaining the order status value also includes: adjusting the pre-configured first switch value to the second switch value; before writing the temporary status value corresponding to the order status of each intermediate order according to at least one first status write instruction, it also includes: determining that the current switch value is the second switch value; before determining the first historical status value corresponding to the first order status and determining the first temporary status value corresponding to the first order status, it also includes: determining the current switch value to the second switch value.

[0010] According to a status value processing method provided by the present disclosure, after refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, and before refreshing the temporary status value of each intermediate order to the corresponding latest status value according to the refresh instruction, it also includes: adjusting the configured second switch value to a third switch value; before writing the latest status value corresponding to the order status of each refreshed order according to at least one second status write instruction, it also includes: determining that the current switch value is the third switch value; before determining the second temporary status value corresponding to the second order status and determining the second latest status value corresponding to the second order status, it also includes: determining that the current switch value is the third switch value.

[0011] The present disclosure also provides a status value processing device, including: a receiving module, which is used to receive at least one first status write instruction corresponding to at least one intermediate order after obtaining a refresh instruction of the order status value, wherein the first status write instruction includes the order status of the corresponding intermediate order; a writing module, which is used to write a temporary status value corresponding to the order status of each intermediate order according to at least one first status write instruction; a first refresh module, which is used to refresh the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, wherein the historical order is an order that has the historical status value written before obtaining the refresh instruction; a second refresh module, which is used to refresh the temporary status value of each intermediate order to the corresponding latest status value according to the refresh instruction, wherein the temporary status value does not overlap with the historical status value, and the temporary status value does not overlap with the latest status value.

[0012] The present disclosure also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the state value processing method as described above is implemented.

[0013] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the state value processing method as described above is implemented.

[0014] The status value processing method, device, equipment and storage medium provided by the present disclosure, when entering the refresh of the status value through the refresh instruction, if there is an intermediate order that needs to write the status value of the order status during the refresh period, then the temporary status value corresponding to the order status is written; when refreshing the status value, the historical status value is first refreshed to the latest status value, and then the temporary status value is refreshed to the latest status value. Since the temporary status value does not overlap with the historical status value before the refresh, and the temporary status value does not overlap with the latest status value after the refresh, this ensures that the status value of the newly written intermediate order is logically correct, avoids data confusion, and can also achieve refresh without stopping the service, improve the reliability of order-related services, and enhance user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] Figure 1 It is a flowchart of the state value processing method provided by the present disclosure;

[0017] Figure 2 This is one of the schematic diagrams of the method for implementing status value processing based on the insurance system provided by the present disclosure;

[0018] Figure 3 This is the second schematic diagram of the method for implementing status value processing based on the insurance system provided by the present disclosure;

[0019] Figure 4 It is a structural diagram of the state value processing device provided by the present disclosure;

[0020] Figure 5 It is a structural diagram of the electronic device provided by the present disclosure. DETAILED DESCRIPTION

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the embodiments of the present disclosure.

[0022] Due to the convenience of computer technology in managing orders, this method has been adopted in many fields, such as insurance order management in insurance systems and shopping order management in e-commerce systems. The state value processing method provided by the present disclosure can be implemented in order management in any field.

[0023] Taking the insurance order (referred to as insurance policy) of the insurance system as an example, the problems existing in the status value refresh process in the existing technology are analyzed. Specifically, the policy status of the equity insurance policy in an insurance system includes three states: pending, valid and invalid. Under new business and needs, it is necessary to adjust the status value corresponding to each order status through data refresh. Before refreshing the data (referred to as brushing data, also known as brushing the number), the historical status values ​​corresponding to the three order statuses are: 0 for pending, 1 for valid, and 2 for invalid. After refreshing the data, the latest status values ​​corresponding to the three order statuses are: 1 for pending, 2 for valid, and 3 for invalid.

[0024] In order to ensure the user experience, updates are implemented without service interruption, and smooth online compatibility with historical data (historical orders) and new data (newly written orders during the brushing process) is achieved without user awareness.

[0025] There are a few things to consider:

[0026] First, during the grayscale data refresh process, the status values ​​written for intermediate orders, regardless of whether they are based on the latest or historical status values, cannot distinguish the data status generated during the launch period. For example, during the launch period, an insurance policy was pushed with a valid order status. If the latest status value in the new code is executed, the valid status corresponds to 2. However, for historical orders before the data refresh, 2 corresponds to invalid. When users query, the system cannot distinguish the order status generated during the launch process; during the refresh process, it cannot determine whether the order should be refreshed as valid or invalid, resulting in data confusion.

[0027] Second, how to ensure that users do not notice code changes during and after the launch, i.e., a smooth launch. For example, when querying a list of valid policies, a user might use the old code to find a status of 1, while using the new code to find a status of 2. In this case, multiple queries will result in inconsistent data, leading to a poor user experience.

[0028] Third, how to distinguish and process historical data (i.e., the status values ​​of all historical orders) and data generated during the data refresh period after going online (i.e., the status values ​​of all intermediate orders).

[0029] The present disclosure provides a state value processing method to solve the above-mentioned problems. The state value processing method is implemented in a processing device with data processing function, such as a server, a smart mobile device, etc. Figure 1-Figure 3 The state value processing method provided by each embodiment of the present disclosure is described.

[0030] In one embodiment, if Figure 1 As shown, the process of implementing the status value processing method is as follows:

[0031] Step 101: After obtaining a refresh instruction for the order status value, receive at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order.

[0032] In this embodiment, a large amount of order-related data is stored in the processing device that implements the status value processing method, such as the order details of each order, the status value corresponding to each order, etc. The order-related data stored in the processing device changes in real time. For example, new orders are constantly generated, and the relevant data of the new orders will be saved in the processing device; for example, when the order status of an order changes, the status value corresponding to the order in the processing device needs to be changed accordingly. The corresponding read interface and write interface are pre-configured on the processing device to facilitate users to read and write data in the processing device, wherein the read interface is used for the client to read the order data in the processing device, and the write interface is used for the client to write new order data to the processing device.

[0033] Furthermore, the processing device also stores code supporting read and write functions. This code is configured with a pre-set status value. When the order status of a new order is written through the write interface, the code automatically obtains the status value corresponding to the order status. More specifically, before the status value in the order data is refreshed (i.e., before the refresh instruction for the order status value is received), the code running in the processing device is defined as the old code; after the status value in the order data is refreshed (i.e., after the refresh instruction for the order status value is received), the code running in the processing device is defined as the new code.

[0034] In this embodiment, order data is dynamic data. After receiving a refresh instruction for the order status value, the order for which the status value needs to be written is defined as an intermediate order. During the refresh process, one or more intermediate orders may be received for which the status value needs to be written. The first status write instruction is used to write the status value of the intermediate order, and the first status write instruction includes the order status of the intermediate order. Each time a first status write instruction is received for an intermediate order, the status value of the intermediate order is written according to the first status write instruction.

[0035] Step 102: According to at least one first status writing instruction, a temporary status value corresponding to the order status of each intermediate order is written respectively.

[0036] In this embodiment, the new code is configured with a temporary status value, which is used during the order data refresh process. The temporary status value corresponds to the order status. For example, if the preset order status is Pending, Valid, and Invalid, the temporary status values ​​are 97 for Pending, 98 for Valid, and 99 for Invalid.

[0037] Furthermore, the status value adopted by the old code before obtaining the refresh instruction is the historical status value. After obtaining the refresh instruction, the status value that the new code needs to finally adopt is the latest status value. The historical status value corresponds one-to-one to the order status, and the latest status value corresponds one-to-one to the order status. However, there is some overlap between the historical status value and the latest status value. For example, when the preset order status is pending, valid, and invalid, the historical status value is: 0 for pending, 1 for valid, and 2 for invalid; the latest status value is: 1 for pending, 2 for valid, and 3 for invalid. Then the values ​​1 and 2 are the overlapping parts. When setting the temporary status value, it cannot overlap with the historical status value or the latest status value to ensure the logical correctness of the refresh process.

[0038] In this embodiment, after obtaining the refresh instruction, when all intermediate orders need to write status values, neither the historical status value nor the latest status value is used, but the preset temporary status value is written to avoid data confusion.

[0039] Step 103: Refresh the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, wherein the historical order is the order whose historical status value has been written before the refresh instruction is obtained.

[0040] In this embodiment, the order status of any order is one of N preset states. Each of the N order states corresponds to N historical state values, and each of the N order states corresponds to N latest state values, where N is an integer greater than 1. The historical state value and latest state value corresponding to any order state are fixed, and thus the N historical state values ​​correspond one-to-one with the N latest state values. For historical orders stored before the refresh instruction is obtained, the historical state value of each historical order is directly refreshed to the latest state value.

[0041] In one embodiment, since the historical status value partially overlaps with the latest status value, and the historical status value corresponds to the latest status value one-to-one, the historical status value of each historical order is refreshed to the corresponding latest status value according to the refresh instruction. The implementation process is as follows: determine at least one latest status value that does not overlap with the historical status value; refresh the corresponding historical status values ​​respectively through the at least one latest status value that does not overlap; re-determine the unrefreshed latest status value and at least one latest status value that does not overlap with the unrefreshed historical status value, and refresh the corresponding historical status values ​​respectively through the re-determined at least one latest status value that does not overlap, until each historical status value is refreshed to the corresponding latest status value.

[0042] In a specific example, when the preset order status is pending, valid, and invalid, the historical status value is: 0 for pending, 1 for valid, and 2 for invalid; the latest status value is: 1 for pending, 2 for valid, and 3 for invalid.

[0043] The first step is to determine that the latest state value that does not overlap is 3, and refresh the historical state value 2 corresponding to the invalid state to the latest state value 3. At this point, after the refresh, there will no longer be any orders with a state value of 2 in the stored order data;

[0044] The second step is to determine that the non-overlapping state value among the latest unrefreshed state values ​​is 2. After the first step is completed, the historical state value 1 corresponding to the valid state is refreshed to the latest state value 2. At this point, after the refresh, there is no longer any order with a state value of 1 in the stored order data;

[0045] The third step is to identify the non-overlapping 1s in the latest status values ​​that have not been refreshed. After the second step is completed, the historical status value 0 corresponding to the pending status is refreshed to the latest status value 1. At this point, there are no orders with a status value of 0 in the stored order data after the refresh. At this point, all historical orders are refreshed.

[0046] In this embodiment, by refreshing the non-overlapping portion of the latest status values ​​first, we avoid situations where the same overlapping status value in the order data corresponds to two order statuses before and after the refresh. For example, if the historical status value 1 of the valid state is refreshed to the latest status value 2 in the first step, some orders with a status value of 2 will be effectively valid, while others with a status value of 2 will be effectively invalid, resulting in data confusion. Refreshing the non-overlapping portion of the latest status values ​​first ensures that the data logic is correct during the refresh process, so that the client can return the correct order list when reading the order data, further improving the reliability of order-related services.

[0047] Step 104: according to the refresh instruction, the temporary status value of each intermediate order is refreshed to the corresponding latest status value, wherein the temporary status value does not overlap with the historical status value, the temporary status value does not overlap with the latest status value, and the historical status value partially overlaps with the latest status value.

[0048] In this embodiment, after the status values ​​of the historical orders are refreshed, the refresh process of the intermediate orders is carried out. Since the temporary status value does not overlap with the historical status value, and the temporary status value does not overlap with the latest status value, the temporary status value can be refreshed directly. For example, the temporary status values ​​are: 97 for pending, 98 for valid, and 99 for invalid; the historical status values ​​are: 0 for pending, 1 for valid, and 2 for invalid; the latest status values ​​are: 1 for pending, 2 for valid, and 3 for invalid. Then the values ​​1 and 2 are overlapping parts. Specifically, the temporary status value 97 of the pending state is refreshed to the latest state value 1, the temporary status value 98 of the valid state is refreshed to the latest state value 2, and the temporary status value 99 of the invalid state is refreshed to the latest state value 3. The refresh of each temporary status value can be performed one by one according to the actual situation and needs, or it can be completed in parallel. Completing them one by one can reduce the requirements for computing resources, and completing them in parallel can speed up the refresh speed.

[0049] In one embodiment, there may be a request from the client to read an order before and after the status value is refreshed. In this case, different processing is required at different stages to return correct and complete orders to the client. Specifically, after writing the temporary status value corresponding to the order status of each intermediate order according to at least one first status write instruction, a first read instruction is received, wherein the first read instruction includes a first order status, wherein the first order status is any one of the preset N order statuses, and N is an integer greater than 1; determining a first historical status value corresponding to the first order status, and determining a first temporary status value corresponding to the first order status, wherein the first historical status value is any one of the preset N historical status values, and the first temporary status value is any one of the preset N temporary status values; according to the first read instruction, each historical order corresponding to the first historical status value is obtained, and each intermediate order corresponding to the first temporary status value is obtained.

[0050] In this embodiment, after obtaining the refresh instruction, if the temporary status value of the intermediate order has been written. Then all the orders stored in the processing device at this time include both historical orders configured with the first historical status value and intermediate orders configured with the first temporary status value. In order to ensure that all orders corresponding to the first order status are returned, the first historical status value corresponding to the first order status is determined, and the first temporary status value corresponding to the first order status is determined. Then, according to the first read instruction, each historical order corresponding to the first historical status value is obtained, and each intermediate order corresponding to the first temporary status value is obtained. For example, "to be effective" corresponds to 97, "effective" corresponds to 98, and "invalid" corresponds to 99; the historical status values ​​are: "to be effective" corresponds to 0, "effective" corresponds to 1, and "invalid" corresponds to 2; if the first order status is effective, all orders corresponding to 98 and 1 are returned.

[0051] In one embodiment, client requests to write order data may occur both before and after a status value refresh. Different processing is required at different stages to ensure the accuracy of the written data. Specifically, after refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, at least one second status write instruction corresponding to at least one refreshed order is received, wherein the second status write instruction includes the order status of the corresponding refreshed order. According to the at least one second status write instruction, the latest status value corresponding to the order status of each refreshed order is written.

[0052] In this embodiment, after the historical status values ​​of all historical orders have been refreshed to the latest status values, the stored order data only includes orders configured with temporary status values ​​and orders configured with the latest status values. Since the temporary status values ​​and the latest status values ​​do not overlap, when a second status write instruction is received after the historical order refresh is complete, the latest status value is directly written, and the temporary status value is no longer used. When the temporary status value is subsequently refreshed to the latest status value, all stored orders are configured with the latest status value, and the refresh process ends.

[0053] In one embodiment, after refreshing the historical status value of each historical order to the corresponding latest status value according to a refresh instruction, a second read instruction is received, wherein the second read instruction includes a second order status, wherein the second order status is any one of N preset order statuses, and N is an integer greater than 1; determining a second temporary status value corresponding to the second order status, and determining a second latest status value corresponding to the second order status, wherein the second temporary status value is any one of the N preset temporary status values, and the second latest status value is any one of the N preset latest status values; according to the second read instruction, obtaining each order corresponding to the second temporary status value, and obtaining each order corresponding to the second latest status value, wherein orders include historical orders, intermediate orders and / or refreshed orders.

[0054] In this embodiment, after the historical status value of each historical order is refreshed to the corresponding latest status value, the stored order data only includes orders configured with temporary status values ​​and orders configured with latest status values. At this time, when the second read instruction is received, in order to ensure that each order corresponding to the second order status is returned, it is necessary to determine the second temporary status value corresponding to the second order status, and at the same time, determine the second latest status value corresponding to the second order status. Then, according to the second read instruction, each order corresponding to the second temporary status value is obtained, as well as each order corresponding to the second latest status value. For example, "to be effective" corresponds to 97, "effective" corresponds to 98, and "invalid" corresponds to 99; the latest status values ​​are: "to be effective" corresponds to 1, "effective" corresponds to 2, and "invalid" corresponds to 3; if the second order status is effective, all orders corresponding to 98 and 2 are returned.

[0055] In one embodiment, the reading and writing of order status values ​​are handled differently at different stages of the data refresh process. To enable different processing methods, switch values ​​are configured in the new code to ensure the correctness of the read and write logic. Specifically, the switch value includes at least one, for example, the switch value includes three gear values: 1, 2, and 3.

[0056] In this embodiment, the switch value may also be configured in the read interface and the write interface to ensure that the order obtained is correct and comprehensive when reading and writing the status value.

[0057] When users read data, they can do so through a read interface. This provides a query interface to implement an order status replacement method, adjusting the code locations for all order statuses based on the switch value. For example, when the incoming order status is valid, the status value sets corresponding to different order statuses are replaced based on the switch value. For example, if the query interface receives a valid value and the switch is 2, the replaced status values ​​are 1 and 98. This ensures that the read interface returns all valid orders normally.

[0058] When users write data, they can implement it through the write interface, that is, provide a write class interface to implement the order status replacement method, and adjust the code position of all order statuses according to the switch value. For example: when the incoming order status is valid, the status value corresponding to different order statuses is replaced according to the status of the switch value. For example, when the incoming write class interface is valid and the switch value is 2, the replaced status is 98, thereby ensuring the correctness of the inserted data.

[0059] By using the replacement method through interface compatibility, interface compatibility can be achieved without changing the input parameters, achieving smooth launch and improving user experience.

[0060] In this embodiment, the switch value configuration can be implemented based on the Distributed Unified Configuration Center (DUCC). The DUCC can dynamically change the configuration value at any time without going online, simplifying the configuration process and improving the efficiency of state value processing. Alternatively, the switch value change control can be implemented using Redis, which is a high-performance non-relational database, and the operation and management backend updates the Redis value to achieve the purpose of control.

[0061] In this embodiment, when a refresh instruction for the order status value is not obtained, the switch value configured in the new code is the first switch value. When a refresh instruction for the order status value is obtained, the pre-configured first switch value is adjusted to the second switch value. Before writing the temporary status value corresponding to the order status of each intermediate order according to at least one first status write instruction, it is necessary to determine that the current switch value is the second switch value. Before determining the first historical status value corresponding to the first order status and determining the first temporary status value corresponding to the first order status, it is necessary to determine that the current switch value is the second switch value.

[0062] That is, when data refresh begins, the switch value automatically adjusts from the first switch value to the second switch value. When a first status write instruction is received, the second switch value indicates that a temporary status value needs to be configured for the newly added intermediate order. After the temporary status value is written, the stored order data includes both orders configured with temporary status values ​​and orders configured with historical status values. When a first read instruction is received, the second switch value indicates that the orders to be processed are those configured with temporary status values ​​or those configured with historical status values.

[0063] In one embodiment, after refreshing the historical status value of each historical order to the corresponding latest status value according to a refresh instruction, and before refreshing the temporary status value of each intermediate order to the corresponding latest status value according to a refresh instruction, the configured second switch value needs to be adjusted to a third switch value. Before writing the latest status value corresponding to the order status of each refreshed order according to at least one second status write instruction, the current switch value needs to be determined to be the third switch value. Before determining the second temporary status value corresponding to the second order status and determining the second latest status value corresponding to the second order status, the current switch value needs to be determined to be the third switch value.

[0064] That is, after the refresh of historical orders is completed and before the refresh of intermediate orders begins, the switch value is automatically adjusted from the second switch value to the third switch value. Since there are no orders configured with historical status values ​​in all the order data stored at this time, when the second status write instruction is received, the third switch value indicates that the latest status value needs to be configured for the refreshed orders. After the historical status values ​​of all historical orders are refreshed to the latest status values, the stored order data only includes orders configured with temporary status values ​​and orders configured with the latest status values. When the second read instruction is received, it is determined that the orders to be processed are orders configured with temporary status values ​​and orders configured with the latest status values.

[0065] In a specific embodiment, the state value processing method provided by the present disclosure is specifically introduced by taking policy management in an insurance system as an example.

[0066] In this embodiment, the insurance policy is a type of order, and the policy status of the equity insurance policy in an insurance system includes three states: pending, valid, and invalid. Under new business and needs, it is necessary to adjust the status value corresponding to each order status through data refresh. Before refreshing the data (referred to as brushing data), the historical status values ​​corresponding to the three order statuses are: pending for 0, valid for 1, and invalid for 2. After brushing the data, the latest status values ​​corresponding to the three order statuses are: pending for 1, valid for 2, and invalid for 3. The set temporary status values ​​are: pending for 97, valid for 98, and invalid for 99. The pre-set switch values ​​include 1, 2, and 3. The switch value of 1 indicates before brushing the data, the switch value of 2 indicates during brushing the data, and the switch value of 3 indicates after brushing the data.

[0067] like Figure 2 As shown, the new code is gradually launched in a grayscale manner. During the code launch process, the processing device is in a partial new code state. For the old code, there is no corresponding code to read the switch, and no switch value is configured. At this time, the management of the order status value does not involve the switch value and the new code. The switch value and the new code are not stored in the database (data base, DB) of the processing device, and the policy status values ​​stored in the data are 0, 1, and 2. When the user reads the data in the database, there is no switch value and new code, and the status values ​​read when reading the data are 0, 1, and 2. When the user writes the policy data, there is no switch value and new code, and the status values ​​written when writing the data are 0, 1, and 2.

[0068] For new code, the code for reading the switch is set. At this time, because the data flushing process has not yet begun, the switch value is 1. The switch value stored in the database is 1, indicating that the data is being flushed. The policy status values ​​stored in the data are 0, 1, and 2. When the user reads data from the database, the switch value 1 indicates that the data is being flushed. The status values ​​read when reading data are 0, 1, and 2. When the user writes policy data, the switch value 1 indicates that the data is being flushed. The status values ​​written when writing data are 0, 1, and 2.

[0069] After the new code is fully launched, all of it will be updated to the new code, and the data refresh process will be completed based on the new code.

[0070] Before refreshing, read the switch value. A switch value of 1 indicates that the data is being refreshed. A switch value of 1 stored in the database indicates that the data is being refreshed, and the policy status values ​​stored in the data are 0, 1, or 2. When the user reads data from the database, a switch value of 1 indicates that the data is being refreshed, and the status values ​​read when reading data are 0, 1, or 2. When the user writes policy data, a switch value of 1 indicates that the data is being refreshed, and the status values ​​written when writing data are 0, 1, or 2.

[0071] The new code automatically starts refreshing the historical order status values ​​and enters the data refresh phase. Specifically, the order of refreshing historical order data is as follows:

[0072] Step 1: Refresh the invalid historical status value 2 to the latest status value 3;

[0073] Step 2: refresh the valid corresponding historical status value 1 to the latest status value 2;

[0074] The third step is to refresh the historical status value 0 corresponding to the to-be-effective state to the latest status value 1.

[0075] During data flushing, the switch value is read. A switch value of 2 indicates that data is being flushed. A switch value of 2 stored in the database indicates that data is being flushed, and the stored policy status values ​​are 0, 1, 2, and 97, 98, and 99. When the user reads data from the database, a switch value of 1 indicates that data is being flushed, and the status values ​​read when reading data are 0, 1, 2, and 97, 98, and 99. When the user writes policy data, a switch value of 2 indicates that data is being flushed, and the status values ​​written when writing data are 97, 98, and 99.

[0076] After refreshing the historical data (historical status values ​​of all historical orders), it will automatically start refreshing the temporary status values ​​of the intermediate data generated during the refresh.

[0077] Step 1: Update the temporary status value 99 corresponding to the invalid state to the latest status value 3;

[0078] Step 2: Update the valid corresponding temporary status value 98 to the latest status value 2;

[0079] The third step is to refresh the temporary status value 97 to be effective to the latest status value 1.

[0080] After refreshing, the switch value is read. If the switch value is 3, it indicates that the data has been refreshed. The switch value stored in the database is 3, indicating that the data has been refreshed. The policy status values ​​stored in the data are 1, 2, 3, and 97, 98, and 99. When the user reads data from the database, the switch value 3 indicates that the data has been refreshed. The status values ​​read when reading the data are 1, 2, 3, and 97, 98, and 99. When the user writes policy data, the switch value 3 indicates that the data has been refreshed. The status values ​​written when writing the data are 1, 2, and 3.

[0081] In this embodiment, Figure 3 As shown in the figure, the process of bringing the policy status online is further introduced.

[0082] The environment status refers to the current state of the new code being launched and the state of the data refresh phase. The switch value refers to the switch value configured in the running code. The data pool stores the effective state value, which is at least one of the historical state value, the historical state value, and the latest state value.

[0083] When the environment status is the old code before going online, no switch value is configured. At this time, the status values ​​stored in the data pool are 0, 1, and 2. When the user reads data, the read status values ​​are 0, 1, and 2; when the user writes data, the written status values ​​are 0, 1, and 2.

[0084] When the environment status is the old code in the online stage, no switch value is configured. At this time, the status values ​​stored in the data pool are 0, 1, and 2. When the user reads data, the read status values ​​are 0, 1, and 2. When the user writes data, the written status values ​​are 0, 1, and 2.

[0085] When the environment status is the new code in the online state, the switch value is 1. At this time, the state values ​​stored in the data pool are 0, 1, and 2. When the user reads data, the read state values ​​are 0, 1, and 2. When the user writes data, the written state values ​​are 0, 1, and 2.

[0086] When the environment status is online and before the new code is refreshed, the switch value is 1. At this time, the status values ​​stored in the data pool are 0, 1, and 2. When the user reads data, the read status values ​​are 0, 1, and 2. When the user writes data, the written status values ​​are 0, 1, and 2.

[0087] After the environment status is online, the new code is refreshed, the switch value is 2, and the status values ​​stored in the data pool are 0, 1, 2 and 97, 98, 99; when the user reads data, the read status values ​​are 0, 1, 2 and 97, 98, 99; when the user writes data, the written status values ​​are 97, 98, 99.

[0088] After going online, the switch value in the refresh is set to 2. The query status of all query interfaces is 0 and 97 for pending, 1 and 98 for valid, and 2 and 99 for invalid. That is, (0, 97) for pending, (1, 98) for valid, and (2, 99) for invalid. Because the three status values ​​97, 98, and 99 are only generated after refreshing data after going online, 0, 1, and 2 are all historical status values. The historical status values ​​are refreshed, and the historical status value 2 corresponding to invalid is refreshed to the latest status value 3; the historical status value 1 corresponding to valid is refreshed to the latest status value 2; and the historical status value 0 corresponding to pending is refreshed to the latest status value 1.

[0089] After the environment status is online, the new code refreshes the historical status values, but the temporary status values ​​in the middle are not refreshed. The switch value is 3. At this time, the status values ​​stored in the data pool are 1, 2, 3 and 97, 98, 99; when the user reads data, the read status values ​​are 1, 2, 3 and 97, 98, 99; when the user writes data, the written status values ​​are 1, 2, 3.

[0090] Then the intermediate temporary status values ​​generated in the refresh data are refreshed, 97 is refreshed as 1, 98 is refreshed as 2, and 99 is refreshed as 3.

[0091] After the environment goes online, the new code is refreshed, and the temporary status values ​​are refreshed, the switch value is 3. At this time, the status values ​​stored in the data pool are 1, 2, and 3. When the user reads data, the read status values ​​are 97, 98, and 99; when the user writes data, the written status values ​​are 1, 2, and 3. All status values ​​are refreshed.

[0092] The status value processing method provided by the present disclosure, after entering the status value refresh through the refresh instruction, if there is an intermediate order that needs to write the status value of the order status during the refresh period, then the temporary status value corresponding to the order status is written; when refreshing the status value, the historical status value is first refreshed to the latest status value, and then the temporary status value is refreshed to the latest status value. Because the temporary status value does not overlap with the historical status value before the refresh, and the temporary status value does not overlap with the latest status value after the refresh, this ensures that the status value of the newly written intermediate order is logically correct, avoids data confusion, and can also achieve refresh without stopping the service, improving the reliability of order-related services and enhancing the user experience.

[0093] At the same time, the interface compatibility uses the replacement method to achieve interface compatibility without changing the input parameters. Combined with the switch value control of each stage of the online launch, it can achieve smooth online launch without user perception, further improving the user experience.

[0094] The state value processing device provided by the embodiment of the present disclosure is described below. The state value processing device described below and the state value processing method described above can be referred to in correspondence with each other. Figure 4 As shown, the state value processing device includes:

[0095] Receiving module 401 is configured to, after obtaining a refresh instruction for an order status value, receive at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order;

[0096] A writing module 402 is configured to write a temporary status value corresponding to the order status of each intermediate order according to at least one first status writing instruction;

[0097] A first refresh module 403 is configured to refresh the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, wherein the historical order is the order whose historical status value has been written before the refresh instruction is obtained;

[0098] The second refresh module 404 is used to refresh the temporary status value of each intermediate order to the corresponding latest status value according to the refresh instruction, wherein the temporary status value does not overlap with the historical status value and the temporary status value does not overlap with the latest status value.

[0099] Figure 5 An example of a physical structure diagram of an electronic device is shown below. Figure 5 As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other via the communication bus 504. The processor 501 may call logic instructions in the memory 503 to execute a status value processing method, which includes: after obtaining a refresh instruction for an order status value, receiving at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order; writing a temporary status value corresponding to the order status of each intermediate order according to the at least one first status write instruction; refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, wherein the historical order is an order for which a historical status value has been written before the refresh instruction is obtained; refreshing the temporary status value of each intermediate order to the corresponding latest status value according to the refresh instruction, wherein the temporary status value does not overlap with the historical status value, the temporary status value does not overlap with the latest status value, and the historical status value partially overlaps with the latest status value.

[0100] In addition, the logic instructions in the above-mentioned memory 503 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0101] On the other hand, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the status value processing method provided by the above methods, the method including: after obtaining a refresh instruction for the order status value, receiving at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order; according to the at least one first status write instruction, writing the temporary status value corresponding to the order status of each intermediate order respectively; according to the refresh instruction, refreshing the historical status value of each historical order to the corresponding latest status value, wherein the historical order is an order whose historical status value has been written before the refresh instruction is obtained; according to the refresh instruction, refreshing the temporary status value of each intermediate order to the corresponding latest status value, wherein the temporary status value does not overlap with the historical status value, the temporary status value does not overlap with the latest status value, and the historical status value partially overlaps with the latest status value.

[0102] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned status value processing methods, the methods comprising: after obtaining a refresh instruction for the order status value, receiving at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order; according to the at least one first status write instruction, writing a temporary status value corresponding to the order status of each intermediate order; according to the refresh instruction, refreshing the historical status value of each historical order to the corresponding latest status value, wherein the historical order is an order whose historical status value has been written before the refresh instruction is obtained; according to the refresh instruction, refreshing the temporary status value of each intermediate order to the corresponding latest status value, wherein the temporary status value does not overlap with the historical status value, the temporary status value does not overlap with the latest status value, and the historical status value partially overlaps with the latest status value.

[0103] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0104] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.

Claims

1. A state value processing method, characterized in that: include: After obtaining the refresh instruction of the order status value, receiving at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order; Writing a temporary status value corresponding to the order status of each of the intermediate orders according to at least one of the first status writing instructions; According to the refresh instruction, the historical status value of each historical order is refreshed to the corresponding latest status value, wherein the historical order is the order for which the historical status value has been written before the refresh instruction is obtained; According to the refresh instruction, the temporary status value of each intermediate order is refreshed to the corresponding latest status value, wherein the temporary status value does not overlap with the historical status value, the temporary status value does not overlap with the latest status value, and the historical status value partially overlaps with the latest status value; the historical status value and the latest status value have a one-to-one correspondence; The refreshing of the historical status value of each historical order to the corresponding latest status value according to the refresh instruction includes: Determining at least one of the latest state values ​​that does not overlap with the historical state values; Refresh the corresponding historical status values ​​respectively by using at least one non-overlapping latest status value; Re-determine at least one of the latest status values ​​that are not refreshed and does not overlap with the historical status values ​​that are not refreshed, and refresh the corresponding historical status values ​​respectively through the re-determined at least one latest status value that does not overlap, until each of the historical status values ​​is refreshed to the corresponding latest status value.

2. The state value processing method according to claim 1, characterized in that: After writing the temporary status value corresponding to the order status of each intermediate order according to at least one first status writing instruction, the method further includes: Receive a first read instruction, wherein the first read instruction includes a first order status, wherein the first order status is any one of N preset order statuses, where N is an integer greater than 1; Determine a first historical status value corresponding to the first order status, and determine a first temporary status value corresponding to the first order status, wherein the first historical status value is any one of the N preset historical status values, and the first temporary status value is any one of the N preset temporary status values; According to the first read instruction, each of the historical orders corresponding to the first historical status value is obtained, and each of the intermediate orders corresponding to the first temporary status value is obtained.

3. The state value processing method according to claim 1, characterized in that: After refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, the method further includes: receiving at least one second status write instruction corresponding to at least one refreshed order, wherein the second status write instruction includes the order status of the corresponding refreshed order; According to at least one second status writing instruction, the latest status value corresponding to the order status of each refreshed order is written respectively.

4. The state value processing method according to claim 3, characterized in that: After refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, the method further includes: Receiving a second read instruction, wherein the second read instruction includes a second order status, wherein the second order status is any one of N preset order statuses, where N is an integer greater than 1; Determine a second temporary status value corresponding to the second order status, and determine a second latest status value corresponding to the second order status, wherein the second temporary status value is any one of the N preset temporary status values, and the second latest status value is any one of the N preset latest status values; According to the second read instruction, each of the orders corresponding to the second temporary status value is obtained, and each of the orders corresponding to the second latest status value is obtained, wherein the orders include the historical orders, the intermediate orders and / or the refreshed orders.

5. The state value processing method according to claim 2, characterized in that: The refresh instruction for obtaining the order status value also includes: Adjusting a pre-configured first switch value to a second switch value; Before writing the temporary status value corresponding to the order status of each intermediate order according to at least one first status writing instruction, the method further includes: Determine that the current switch value is the second switch value; Before determining the first historical status value corresponding to the first order status and determining the first temporary status value corresponding to the first order status, the method further includes: The current switch value is determined to be the second switch value.

6. The state value processing method according to claim 4, characterized in that: After refreshing the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, and before refreshing the temporary status value of each intermediate order to the corresponding latest status value according to the refresh instruction, the method further includes: Adjust the configured second switch value to a third switch value; Before writing the latest status value corresponding to the order status of each refreshed order according to at least one second status writing instruction, the method further includes: Determine the current switch value as the third switch value; Before determining the second temporary status value corresponding to the second order status and determining the second latest status value corresponding to the second order status, the method further includes: The current switch value is determined to be the third switch value.

7. A state value processing device, characterized in that: include: a receiving module, configured to, after obtaining a refresh instruction for the order status value, receive at least one first status write instruction corresponding to at least one intermediate order, wherein the first status write instruction includes the order status of the corresponding intermediate order; a writing module, configured to write a temporary status value corresponding to the order status of each of the intermediate orders according to at least one of the first status writing instructions; A first refresh module is configured to refresh the historical status value of each historical order to the corresponding latest status value according to the refresh instruction, wherein the historical order is an order for which the historical status value has been written before the refresh instruction is obtained; a second refreshing module, configured to refresh the temporary status value of each intermediate order to the corresponding latest status value according to the refreshing instruction, wherein the temporary status value does not overlap with the historical status value, and the temporary status value does not overlap with the latest status value; The historical status values ​​correspond one-to-one to the latest status values; The first refreshing module is specifically configured to: Determining at least one of the latest state values ​​that does not overlap with the historical state values; Refresh the corresponding historical status values ​​respectively by using at least one non-overlapping latest status value; Re-determine at least one of the latest status values ​​that are not refreshed and does not overlap with the historical status values ​​that are not refreshed, and refresh the corresponding historical status values ​​respectively through the re-determined at least one latest status value that does not overlap, until each of the historical status values ​​is refreshed to the corresponding latest status value.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the status value processing method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the state value processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Information processing method and device based on state machine and storage medium

    CN114020368A